Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

Smooth Movie Clip Movements on Rollover?

 
Jump to:  
 
charner
PostPosted: Fri May 23, 2008 7:48 pm    Post subject: Smooth Movie Clip Movements on Rollover?
       
I've been trying to figure out how to simply make movie clips nudge/move
slightly to the right or left (doesn't even need to be a random movement, but
that would be great too) and then return to the original place. I would like to
have easing in that, not a sharp movement. Right now, I am using a tween code
(import mx.transitions.Tween; import mx.transitions.easing.*Wink but it won't
allow me to start from one point, bounce/elastic (whatever) to another point
and then ease right back. It only bounces TO another place. I want something
that is almost like a mild repellent of the mouse or something. Any ideas?

Thanks,
Christy
 

 
charner
PostPosted: Fri May 23, 2008 8:31 pm    Post subject: Re: Smooth Movie Clip Movements on Rollover?
       
Skip the last part about the "mild repellent of the mouse". Come to think of it, that would actually be a bad thing! Smile

Christy
 

 
clbeech
PostPosted: Fri May 23, 2008 10:44 pm    Post subject: Re: Smooth Movie Clip Movements on Rollover?
       
you must have been doing some reading to use the methods you have mentioned -
so look into the onMotionFinished handler and the yoyo methods - you could use
these to play the tween in reverse once the first tween is finished, as in:


var xp = Math.round(Math.random()*10);
var tw = new Tween(obj, '_x', Elastic.easeOut, obj._x, obj._x+xp, 10, false);
tw.onMotionFinished = function() {
tw.yoyo();
}
 

 
charner
PostPosted: Mon May 26, 2008 2:59 pm    Post subject: Re: Smooth Movie Clip Movements on Rollover?
       
Thanks. I'd tried a bit of onMotionComplete before, but nothing worked. I
played around with it more since you suggested it and finally figured it out. I
guess you just have to play around with the code for a bit to get something
that looks realistic! My final code (in case anyone in the world actually
cares!) was:

myBall1_mc.onRollOver = function() {
var myHoriTween1:Tween = new Tween(myBall1_mc, "_x", Regular.easeInOut, 100,
120,.5, true);
myHoriTween1.onMotionFinished = function (){
var myHoriTween1a:Tween = new Tween(myBall1_mc, "_x", Elastic.easeOut, 120,
100, 2, true);
}
};

Thanks again
Christy
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Szafy BHP przepisy kulinarne Gazeta Makumba - Big Cyc sprzęt fitness