Tween Easing After Mouse Stops Moving
hi guys,
am wondering if anyone can help with this .. i see it done all the time but can't seem to figure it.
I'm wanting to have an effect where the clip moves left or right based on mouse movement. I'm currently using the onMouseMove function to make it move either way ( though i'm not sure if i'm keeping it this way ).
I want it though to come to a gradual stop though when you stop moving the mouse rather than stopping straight away. Using what seems to be like a tween or easing. I've looked at both of these in actionscript but can't seem to make them work...
here's the code for what i'm wanting to move :
Code: this.createEmptyMovieClip("parentContainerSml", 3); this.createEmptyMovieClip("parentContainerLg", 2); var i:Number; for(i = 0; i <= 10; i++) { var container_mc:MovieClip = parentContainerSml.createEmptyMovieClip("containerSml" + i + "_mc", i) container_mc.attachMovie("bluePattern_sml", "patternSml" + i + "_mc", i); container_mc._x = 186 * i; container_mc._y = 100;
var containerLg_mc:MovieClip = parentContainerLg.createEmptyMovieClip("containerLg" + i + "_mc", i) containerLg_mc.attachMovie("bluePattern_lg", "patternLg" + i + "_mc", i); containerLg_mc._x = 260 * i; containerLg_mc._y = 30; };
parentContainerSml._alpha = 60; parentContainerLg._alpha = 30;
var mouseListener:Object = new Object(); mouseListener.onMouseMove = function() { if(_xmouse < 390) { parentContainerSml._x++; } else if(_xmouse > 410) { parentContainerSml._x--; }; };
Mouse.addListener(mouseListener); Basically this just gives you to main movieClips, each of which has 10 clips inside that have an image sitting inside them. So imagine 2 horizontal rows of 10 images each.
When you move either way one of them moves. This is the one i want to have an easing effect when the mouse stops.
any help greatly appreciated.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-05-2006, 12:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Detect When Mouse Stops Moving
i'd like to hide the cursor unless the mouse is being moved. i call Mouse.hide() onMouseMove, but i wish there was an onMouseStop event. i'm having a hard time figuring out how to detect when the mouse has stopped moving. Ideas?
Disappearing Buttons When Mouse Stops Moving
I have multiple buttons in a flash movie, and there is a bug that makes the buttons not buttons (the hand icon becomes the plain old arrow and the links don't work in IE6) when the mouse is NOT moving. If the mouse is moving, the buttons work fine. When I test the movie in flash, it works fine. When I test it in IE the bug is there. When I load it into Adsys (our ad server) it works fine, but on the website, (viewed with IE6) the bug is back.
Anyone know what is causing this, cuz I am stumped.
How To Stop Panning Background When Mouse Stops Moving
Hello all,
I have a background that pans left and right depending on which way the mouse is moved. Is there a way that when the mouse has stopped moving that the panning also stops, then restarts when the mouse starts moving again?? Thanks in advance.
[F8] Mouse Moving Image Follows Easing
Hi all. Check this site out: http://www.flowersfeedthesoul.com/main.html . See how when u move the cursor, those movieclips follow the mouse, easing out. How can I do that. Also there are some sites that use the similar effect, but in reverse: when u move the mouse to the left, the movieclips go to the right. Please help I really wanna use this effect on my new site. Thank you.
Mouse Moving Movieclip Follows Easing
Hi all.
Here is may script inside the movie clip that goes the opposite way the mouse goes (on _x axis):
frame 1: function norma(a, b) {
return Math.sqrt(a*a+b*b);
}
frame 2: n=norma(_xmouse, _ymouse);
setProperty (this, _x , n/-15);
frame 3: gotoAndPlay(2)
Now I want the movieclip to ease in and out as the mouse stops (when the user stops moving the mouse around). HOW DO I DO THAT? Please help i really wanna use this effect on my new site. THANKS
Easing While Moving Something In Relation To Mouse?
Hey guys. I have a stack of images that I need to move down when the mouse is above y = 250 and up when the mouse is below y = 250. I have this code, but the problem is I don't know how to add easing. Can anyone pose a solution? Thanks
ActionScript Code:
onEnterFrame = function() { someConstant = 2342; lastIndex = picThumbArray.length - 1; lastImage = imageStack_mc["picContainer"+lastIndex]; firstImage = imageStack_mc.picContainer0; if (_xmouse > 750 && _xmouse < 950) { if (_ymouse < 250) { if (imageStack_mc._y < 45) { imageStack_mc._y += 2; //imageStack_mc._y = (45 - imageStack_mc._y) / someConstant; } } else { if (imageStack_mc._y > (540 - (83 * picThumbArray.length + 75))) { imageStack_mc._y -= 2; } } }}
p.s. that one line thats commented out, this one: //imageStack_mc._y = (45 - imageStack_mc._y) / someConstant; is my attempt at easing , but that code just makes it zoom instantly to 45. wierd.
Easing Function Never Stops
My easing function isn't stopping.
It never reaches where I want.
I can't remove Math.Round cuz I'm using a pixel font.
here is the code:
PHP Code:
bt_texto.useHandCursor = false;
bt_texto.onRollOver = function(){
texto_up();
}
bt_texto.onRollOut = function(){
texto_down();
}
function texto_up(){
_root.onEnterFrame = function() {
trace(texto._y);
texto._y = Math.round(texto._y+(300-texto._y)/4);
if (texto._y == 300) {
delete (this.onEnterFrame);
}
};
}
function texto_down(){
_root.onEnterFrame = function() {
trace(texto._y);
texto._y = Math.round(texto._y+(460-texto._y)/4);
if (texto._y == 460) {
delete (this.onEnterFrame);
}
};
}
Easing Function Never Stops
Hey,
I need some help here please.
My easing function never reaches the coordinates I want it to reach.
I attached the .fla I'm working on and the code.
Thank in advance.
PHP Code:
bt_texto.useHandCursor = false;
bt_texto.onRollOver = function(){
texto_up();
}
bt_texto.onRollOut = function(){
texto_down();
}
function texto_up(){
_root.onEnterFrame = function() {
trace(texto._y);
texto._y = Math.round(texto._y+(300-texto._y)/4);
if (texto._y == 300) {
delete (this.onEnterFrame);
}
};
}
function texto_down(){
_root.onEnterFrame = function() {
trace(texto._y);
texto._y = Math.round(texto._y+(460-texto._y)/4);
if (texto._y == 460) {
delete (this.onEnterFrame);
}
};
}
Button Stops Looping Mc With Easing?
Hi, does anyone know how I can make this:
on (release) {
my_mc.stop();
}
(Where my_mc is a movieclip that has continuous looping movement)
I want the continuous movement to easeOut and stop at its current timeline location when I click a button.
Any help is truly appreciated.
How Do I Create A Movieclip To Play If Mouse Is Unactive, And Stops When Mouse Moves?
I am in the process of creting a world map navigation for a global ite portal.
In the map a user can hover over different continents to zoom in on specific countries then click on that country's to goto its specific website.
However I think the world map looks a little un-user friendly so was looking at playing a quick tutorial movie (a mouse cursor, moving over a continent and highlighting it) when the mouse is not being moved, then stops when the user moves the mouse.
This feature a little reminisant of when sonic the hedgehog used to tap his foot if you didnt use your joypad for a while.
I would also like to start the movie (after he preloader ive used) with the tutorial playing, so the user can understand the way it works straight away.
I am a novice at action scripting, so all help would be appreciated!
Thanks
M
How Do I Create A Movieclip To Play If Mouse Is Unactive, And Stops When Mouse Moves?
I am in the process of creting a world map navigation for a global ite portal.
In the map a user can hover over different continents to zoom in on specific countries then click on that country's to goto its specific website.
However I think the world map looks a little un-user friendly so was looking at playing a quick tutorial movie (a mouse cursor, moving over a continent and highlighting it) when the mouse is not being moved, then stops when the user moves the mouse.
This feature a little reminisant of when sonic the hedgehog used to tap his foot if you didnt use your joypad for a while.
I would also like to start the movie (after he preloader ive used) with the tutorial playing, so the user can understand the way it works straight away.
I am a novice at action scripting, so all help would be appreciated!
Thanks
M
How Do I Create?: Scrolling Image Stops On Mouse Over-starts On Mouse Off
I’m trying to create this animation:
I have an long rectangular image (with more images going across it) scrolling FROM the right side of the screen to the left (very slowly). similar to a ticker.
I want the scrolling to stop when the viewer mouses over the menu strip. If they press on the image that they have just moused over, I have a movie clip I want to play for that image (a few images pop up, one bigger than the other). When the viewer mouses off, the movie clip disappears, and the menu continues scrolling to the left, from the right.
Greatly appreciated!!
Tween Sometimes Stops Before Finished.
I have a tween that moves an object from its current x pos to 300 and another tween that moves it from its current x pos to 0. this creates a slide-out/slide-in effect. it works well except about 1/30 times it fails to complete, and just stops somewhere in between 0 and 300. since this is so random and I cant figure out any pirticular thing to cause it and I am having a difficult time troubleshooting it. I am wondering if anyone knows of any perticular thing that might cause a tween to stop before its finished?
BTW i am talking about the tween class created from code not a timeline tween.
Thanks!
Tween Stops Unexpectedly
I'm relying heavily on fl.transition.Tween to do a few things in the site i'm working on.
Very randomly, tweens stop in the middle of a transition.
I traced the y variable in expandRetractContent() which is called on MOTION_CHANGE and it looks good the whole time. Then, the tween just stops. I have to replay the movie a few times to get it to happen. I'd say it does it 1 out of 5 times. Is this a known issue? Or am I doing something wrong?
Here's the code.
PHP Code:
var tween:Tween = new Tween(this.dummyTween, "y", Regular.easeOut, this.cbox_h, this.loadBoxHeight, 1, true);tween.addEventListener(TweenEvent.MOTION_CHANGE, expandRetractContent);tween.addEventListener(TweenEvent.MOTION_FINISH, loadSectionHandler);//MOTION_FINISH is never triggered //tried to see if MOTION_STOP was being triggered but it's not//tween.addEventListener(TweenEvent.MOTION_STOP,why);
Tween() Stops Working
Hi all,
I'm looping through a large amount of Movie Clips (150). There is a fade in/fade out for each one as it goes through the loop.
Around Movie Clip 11, the alpha tween starts to have some trouble. It seems to stop tweening for a while, but then tries to again later on down the line. The tween goes from perfect, to non-existant, to a slight tween but not what it was.
Here's my code:
Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
i = 0;
function fader() {
attachMovie("item" + i, "instance" + i, i, { _x:0, _y:0 });
var alpha:Tween = new Tween(eval("instance" + i), "_alpha", none, 0, 100, 1, true);
setTimeout(fadeOut, 5000);
setTimeout(eval(removeClip), 6000);
}
function fadeOut() {
var alpha:Tween = new Tween(eval("instance" + i), "_alpha", none, 100, 0, 1, true);
if(i<150) {
i++;
fader();
}
}
function removeClip() {
removeMovieClip("instance" + i);
}
fader();
I tried changing the seconds to frames, with a boolean false for useSeconds but that didn't quite work out so well either.
Any suggestions?
Thanks!
-Brian
Action When Cursor Stops Moving
Hi
I have seen flashsites where it seems that menus you have clicked at dissapear when the cursor has not moved for a while, is there anyone that knows how this is done ?
Thanx
AS2: SwapDepths - Stops Movieclip From Moving
I have 4 cards on a carousel moving around - each card has to come to the front every time it moves around. My problem is I go to swap the depths using movieclip.swapDepth(1) and it brings it to the front but it then stops that movieclip moving on in the main time line so it stops moving back around. Does anyone know why it is doing this? I have also tried using moveiclip.getNextHighestDepth() + 1 but that does nothing!
Thanks for any help as I am stumped!
How To Make Motion Tween Seem Like It Never Stops..?
I've created a small flash header which has a image in the background scrolling from right to left. I've turned the image into a movie symbol because I want it to continue scrolling even after the main timeline stops.
The issue I'm having is that once the movie symbol timeline reaches the end, you see a slight pause and it starts again.
The only way i see to go around this issue to just paste in the image multiple times and add more frames so that the scrolling lasts longer...however that really doesn't solve the main issue.
So basically I just want to have a image seem like it's scrolling from right to left forever, without showing that slight pause that happens, once the timeline restarts on the movie symbol.
HitTest For A Moving Object, So That It Stops On Collision?
Hi,
Im fiddling about with an old game i started, and i have a series of invisble MCs around my 'spaceship' that hitTest with a 'ground' MC, and i have all that working. The spaceship flies around freely, its not a side-scrolling game or anything.
Basically, i dont want to just die instantly as soon as i touch the landscape, but all my attempts at making the ship stop, or bounce back, fail horribly and the ship ends up getting stuck in the landscape.
Any help? i can attach the game file if itll help.
Sorry, always forget, using MX 2004, AS 2
beedle
Button Stops Moving When ._alpha Is Changed
Hello,
I have a situation where a button (button1) is moving around the screen inside of a movie clip (links1) using a motion tween between two locations. However, if I add AS2 script to dynamically change the alpha, the button stops moving for some reason.
links1.button1._alpha = 20;
If I change the alpha globally using the color property slider it works and continues to move.
If I put the button inside another movie clip first and change the alpha of that movie clip, it works, but I already did alot of tedious keyframing of the button so I would like to avoid this. Swapping the symbol only swaps it within keyframes, not the intire timeline animation.
Why does changing the alpha of a button cause the movie to stop incrementing?
Carousel - Slowly Stops Moving On Boundaries
Hi,
I want the carousel to stop moving slowly when you get over the boundaries.
In the code below the carousel stops immediatly (speed 0):
Code:
this.onMouseMove = function() {
if (this._ymouse<20 || this._ymouse>150 || this._xmouse<20 || this._xmouse>780) {
speed = 0;
} else {
speed = (this._xmouse-centerX)/4000;
}
};
Thanks in advanced,
Bye Mario :)
LoadClip Stops Import Mx.transitions.Tween?
Hi, all!
Why it is not possible to use loadClip() function and importing classes mx.transitions.Tween, mx.transitions.easing.* at the same time. For example(it is just silly example):
//frame 1
Code:
stop();
mclPics.loadClip("PICS/"+sSectionNo+"/b"+nPicNo+".jpg", mcPics);
mcFloor.onRelease = function (){
gotoAndStop("2");
}
//frame 2
// if the clip is loading in frame 1, xs1:Tween does not work
Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
var xs1:Tween = new Tween(s1, "_x", Back.easeIn, s1._x, 900, 1, true);
Any ideas how I can make it work?
Fighting Game...why Does My Character Stops Moving After Running?
ok...in my fighting game....
-I made a movie clip named "Player1".
-I made a button in the first frame of the clip.
-I called the first frame "standing"
-The second frame is when running...
-This is the action of the button
on (keyPress "<Left>") {
gotoAndStop (2);
}
in this frame (2), I got another button with a movie clip inside (when the character is running.)
This is the action of the button on frame #2
onClipEvent (enterFrame) {
if (key.isdown(key.LEFT)) {
_x-=15;
}
}
onClipEvent (enterFrame) {
if (!key.isdown(key.LEFT)) {
gotoAndStop ("standing");
}
}
When I run the game, the character runs when I press the LEFT key but when he stops running, all the keyboard keys don't work if I repress on it...what's the problem????
Please reply!!
-=FL/SHMAN=-
Moveable Mask After Blur Filter... Stops Moving
Okay, I have a bunch of pairs of images. And I have a custom cursor with a mask inside that displays alternate versions of the images by being a mask to them. All works beautifully, until I use a blurFilter transition to fade between one image to the next.
All the images get loaded before the mask is set, and I've narrowed the problem to the blur filter. What's happening, is that once I apply the blur filter, the mask seems to stop moving. The movieClip that it's nested in moves fine though. Basically, for a few seconds after I apply the blur, the mask works, but then it just stops moving and only displays the one location where it was when it stopped moving. If I don't apply the blur filter everything works fine. No problems at all...
Anyone encountered this before or have any thoughts? I'm stumped...
Moving A Mc With Easing
Hi,
Just wondered whether anyone can help me?
I need to make a movieclip move from out of the scene (from the right), to cover the whole scene but i need to it ease out strong and then I need to automatically go to a new scene once it has done this.
Does anyone have any tips, hints or ideas that would help? would you use onEnterFrame?
Thanks
Moving Vertical Bar Which Holds Moving Thumbnail Images When Mouse Is Over
Hi!
im not completely new to Flash MX - have utilised all basic animation tween/morphing /buttons
and very simple action script- movie controls - stop , back ,forward etc
however i need a moving bar feature, e.g. a moving news reel or a vertical bar which holds a number of images i.e.10 and
when the mouse is over - i want it to move downwards and when is not over the feature i want it to stop moving
(or even instaed of the feature to automatically scroll images i could also use a button to press to move through the images)
then: the thumbnail images from the moving feature i need to be selectable which then produces a larger version of the image on
another section of the page.
i dont no if i put this thread in the right forum!
if any one knows of any tutorials or has any suggestions to help implement this feature
i would appreaciate any help!
- dont really know where to start with it!
thanks
(i have looked at the flash kit tutorials but havent found what im looking for
dont even no if this is more of an animation or action script questions)
EASING In And Out On The Same Tween
I am trying to ease a tween that has both moving symbol and a fade to black" tint associated to it. Can I EASE IN the symbol movement and EASE OUT the 100%black to 0% black tint fade?
I appreciate any help anyone has on this. I am using mx 2004 version7. Thanks
Tween Easing...
How can I apply no easing to a tween?
Code:
var textTween = new Tween(tickertxt, "x", Regular.easeNone, 518.5, -1258.3, 25, true);
I am getting an error with the above script. Thanks for any help.
Tween Easing
I've got all my tweens working fine, problem is, I don't want them to ease at all.
How to I get them to have the same consistent speed through the whole tween?
I've tried making the easing argument "null", "Regular.easeOut", and things like that.
Any ideas?
Thanks.
Easing In And Out On The Same Tween
I have a motion tween that I want to ease on both the beginning and end of the motion.
As far as I can tell I can only set one value for easing and in the easing graph I can't add more points.
The only way I've been able to have both ease in and out is to create another keyframe in the middle and apply and ease out on that.
Trying So Simulate Easing When Moving With AS...
I see it everywhere, but I have no idea on how to implement it.
Here's a sample of what I'm using:
Code:
onClipEvent(enterFrame)
{
if (hoursNow - 12 > 5) { hstripX = -23 - (hoursNow - 6) * 50; }
else { hstripX = -323 - (hoursNow * 50); }
_root.hstrip._x = hstripX;
}
hstrip - the mc I'm moving.
hstripX - end X variable to move the mc to.
Basic script, moves the mc over 50 pixels every hour (I'm making a clock, so I have one for seconds, minutes as well.) It moves just fine, but I want it to ease out. How do I go about doing that? Any help would be good.
I tried just adding a gradually decreasing number to hstripX, so that it would gradually get closer to hstripX, but it didn't work (granted, I didn't see if my code was buggy... it was just a basic switch statement.)
Any help would be amazing. TTYL
Moving _x Position W/easing?
I have a gallery with a menu that is a row of
thumbnails (horizontal--right to left). And a button
on each side of the tumbnail menu---and of course when
you click on the right button the menu scrolls to the
right and vise-versa for the left button. The code I
have on the buttons is pretty basic:
right_btn.onRelease = function(){
menu_01._x -= 20;
}
I'm trying to set-up the menu so that when you click on one on the buttons
the menu slides over so many pixels and eases out. And I also need the
buttons to know when the menu mc has reached its end(say the menu is only 400
pixels wide). I've tried a few different things with no luck.
Any idea's or direction to a tutorial???
I would really any help.
thanks,
hutch
[F8] Tween And Easing Class Help
I have been using the following actionscript to animate different mc's.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(b6, "_xscale", Strong.easeOut, 0, 70, 15, false);
new Tween(b6, "_yscale", Strong.easeOut, 0, 70, 15, false);
new Tween(b6, "_alpha", Strong.easeOut, 0, 100, 30, false);
I can't seem to get the above code to work for more than one mc at a time, so i've put this actionscript on a keyframe each time i use it. Is there a way to apply this actionscript to more than one mc on the same frame? something like the code below is what i'm looking for, but the code below doesn't work. It animates the first mc but not the second or any following.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(myClip_mc, "_xscale", Strong.easeOut, 0, 70, 15, false);
new Tween(myClip_mc, "_yscale", Strong.easeOut, 0, 70, 15, false);
new Tween(myClip_mc, "_alpha", Strong.easeOut, 0, 100, 30, false);
new Tween(myClip2_mc, "_xscale", Strong.easeOut, 0, 70, 15, false);
new Tween(myClip2_mc, "_yscale", Strong.easeOut, 0, 70, 15, false);
new Tween(myClip2_mc, "_alpha", Strong.easeOut, 0, 100, 30, false);
thanks in advance for any assistance.
Jay
Tween Easing Probz
When I have one tween here it works, but when I have 4 sets of tweens nothing happens. What's wrong here?:
import fl.transitions.Tween;
import fl.transitions.easing.*;
buttonSectionA.addEventListener(MouseEvent.CLICK , SectionA);
function SectionA(event:MouseEvent):void
{
var myTweenA:Tween = new Tween(mainBox, 'x', Strong.easeOut, 0, 65, 1, true);
}
buttonSectionB.addEventListener(MouseEvent.CLICK , SectionB);
function SectionB(event:MouseEvent):void
{
var myTweenB:Tween = new Tween(mainBox, 'x', Strong.easeOut, 0, -831, 1, true);
}
buttonSectionC.addEventListener(MouseEvent.CLICK , SectionC);
function SectionC(event:MouseEvent):void
{
var myTweenC:Tween = new Tween(mainBox, 'x', Strong.easeOut, 0, -1731, 1, true);
}
buttonSectionE.addEventListener(MouseEvent.CLICK , SectionE);
function SectionE(event:MouseEvent):void
{
var myTweenD:Tween = new Tween(mainBox, 'x', Strong.easeOut, 0, -2631, 1, true);
}
Here's the error message I get:
The error message I get referring to the function and tween lines are repeated 4 times:
The class or interface 'MouseEvent' could not be loaded.
The class or interface 'fl.transitions.Tween' could not be loaded.
Also, when I use just one of the tween, it keeps going to the starting x point, rather than tween from the current xpoint. Any ideas? Thanks
Tween Easing And Yoyo
can you use tween easing in this version of flash??
My code is as follows
ActionScript Code:
myButton_btn.onRelease = function()
{
trace("buttonpressed")
tweenBall();
};
function tweenBall()
{
trace("Im here");
easeType = mx.transitions.easing.Bounce.easeOut;
var begin = 20;
var end = 380;
var time = .5;
var mc = myBall;
ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
trace("dont this"+mc);
}
But it does not move the movie clip myBall and i dont know why???
Help apreciated...
Easing On Motion Tween
ok, i put a square on a movie clip. On the 5th frame, i carried it, 10-15 cm right. And i put that movie clip on the scene. How can i ease the movement of the square in movie clip?
X&y Easing Tween Question?
Hi,
I'm looking for either a flash component or AS3 that emulates this user experience:
http://www.phcinque.it/fondo.swf
I'm reposting this because I was advised to use tweenlite or tweenmax, but I feel what I'm looking to do in the above link (http://www.phcinque.it/fondo.swf) may not need something as involved as the beforementioned tween engines (tweenlite or tweenmax)...
Something like this: http://monkeyflash.com/tutorials/using-the-tween-class/ I think will be enough for me to accomplish what I want to do...BUT I need to move the movie across both x&y coordinates..
Can anyone help me out?
Thanks in advance for the support!
Easing On Motion Tween
ok, i put a square on a movie clip. On the 5th frame, i carried it, 10-15 cm right. And i put that movie clip on the scene. How can i ease the movement of the square in movie clip?
AS2 - Math And Easing Tween
hello all,
I need some math help I think...
I've built a code to cyclically move a scene on the bottom of my stage; I've done this to make a slowing-and-stop-easing effect at anytime the command will arrive. The entire scene mc is _x long something like 6000 px
The whole code goes in this way:
1) importing on the stage (with attachMovie) a mc with this code inside:
onClipEvent(enterFrame) {
_parent._parent.fondo_mc._x -= countermovement;
if (_parent._parent.fondo_mc._x <= -5800) {
_parent._parent.fondo_mc._x = -30;
}
}
2) In the main timeline this code:
var c countermovement:Number = 6;
attachMovie("procemuovifondo", "procemuovifondo", 5000);
function slowAndStop () {
procemuovifondo.onEnterFrame = function () {
if (countermovement > 0) {
countermovement --;
trace ("counter" + countermovement);
} else {
removeMovieClip(procemuovifondo);
}
}
}
The code goes right, but I need to improve it.
Now there is just a variable, I tought to use two vars to implement the whole code in a setInterval, but maybe it's unuseful, and actually I can't use it in the right way.
Second issue: actually when slowAndStop function is called the scene slow too fast, if I take it to 15 it slow better but the scene is running too fast...
The best would be that the scene slow down and stop following:
A) a temporal variable (and I can try to implement it with setInterval, that for istance is a cycle)
B) an indipendent moving variable, so that on one side I set the speed, on the other side I set the slow-and-stop in a matter of time with countermovement.
I also tried to use a second variable:
var counter:Number = 15;
// set the _x increment
var countermovement:Number = counter/2;
but the scene slow and goes backward a bit gre:
thanking you in advance
Simple Actions - Easing And Moving
Hi all,
Got a question regarding easing and moving some objects on RollOver / RollOut.
Lets take the following setting
http://img422.imageshack.us/img422/4933/buttons6ml.jpg
3 simple buttons
what i want the clip to do is that when a user Rollovers button 1 , then button 2 and 3 fades (_alpha) to 0 (zero).
And when you rollout of button 1 then button 2 and 3 fades alphas back to 100
Same goes to button 2 and 3.
When you Rollover button 2 then button 1 and 3 will _alpha out to 0 and on RollOut then button 1 and 3 re-appears.
I did manage to make 'something' out of it, but it doesnt quite work and i have a feeling that i am using too much code.
Also, the alpha changes for alll the buttons instead of just 1 , 2 or 3.
onClipEvent (load) {
_alpha = 100;
div = 4;
}
onClipEvent (enterFrame) {
_alpha += (endAlpha-_alpha)/div;
button1.onRollOver = function() {
endAlpha = 20;
};
button1.onRollOut = function() {
endAlpha = 100;
};
}
There is another catch though.
Because i want to be able to have text slide in place as well.
Lets say you RollOver button 1
Then button 2 and 3 fade out.
But on the location where button 2 and 3 were... i want text to slide in (as to give a description for button 1)
Alot of simple things but for me very frustrating to do.
I have tried reading alot of easing AS examples but can't seem to re-program it to my needs
anybody can help ? Big big thank you in advance.
Moving An MC With Easing With A Click Of A Button
Hello. I am having some trouble getting my movie clip to move with some easing
I have been following the Sliding Menu tutorial (http://www.kirupa.com/developer/flash8/slidingMenu.htm)
There used to be one which you could enter an x and y value that you wish a movie clip to move to on a button click.
It used to be in the place of that tutorial.
Any idea where this has gone?
Thanks
Easing/AScript Tween Question...thx
Quick "how-to" question:
I am trying to create an effect whereby clicking on a button will trigger an "eased" tween- specifically targeting a MC, which will hopefully go gracefully from one position to another. In the finished product, there will be several of these buttons, each linked to a single MC to control. Can anyone point me in the right direction, code-wise, of how to accomplish this in ActionScript?? Thanks in advance...
? How The Heck ? Tween Easing Problems
hi. this has been a problem a few times for me.
i have a scene where an object is to appear very large (fill the stage) and must tween out to distance (make much smaller) and then come to a smooth stop. This obviously calls for the object to be moving very very fast near the point of view area, and then slow as it moves further away.
so... easy right? set easing to 100... BUT, the scaling of the object effectively negates the easing alltogether.
short of adding keyframes all over and manually adjusting the speed, which looks like hell, does anyone have any suggestions? this has been a problem several times for me in my flash experience. id LOVE it if someone had a solution. thanks in advance for any help/advice you can give on this.
Scripting A Tween With 'easing' Effects
hey all. just curious: is there any way to actionsscript the 'easing in' and 'easing out' capabilities of a motion tween? i.e. i have a 'slideshow' that tweens between images using a pretty basic script (utilizing the setInterval function). the motion of the slideshow is purely linear, though, and i would like to know if i could (and how difficult it would be) add the
'easing' effect somewhere in the script, just to make the animation look nicer.
any ideas?
cheers
j
Help Needed With Motion Tween Easing.
Can anyone help?
I am trying to create a motion tween where the object moves quickly accross the screen then slows down and eases in slowly to its finish point.
I have tried everything but the object always seems to move at an even speed,
??
Paul the confused
Easing Tween: Stopping And Starting
Hey,
http://vivid-beatz.homeftp.net/testScroller.html
That is an example of a scrolling bar that will have different images, and what I would like to have happen, is on mouse over, it slows down to a stop - like it does in this one...
http://vivid-beatz.homeftp.net/testScroller2.html
And then when you mouse out, it starts back up again.
Only problem is, with the second one - this is the code
function tweenStop() {
easeType = mx.transitions.easing.Regular.easeOut;
var begin = scrollerFinal._x;
var end = (scrollerFinal._x-50);
var time = 2;
var mc = scrollerFinal;
stopTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time, true);
}
So it is actually moving the _x value, instead of the frame number. So as you can see from the source file, it screws up the animation.
Also I can get it to start moving again afterwards. Which I need happening as well. =(
Any help would be much appreciated =)
Cheers,
Brodie.
Source file is here - http://vivid-beatz.homeftp.net/testScroller.fla
|