|
-
[RESOLVED] animated moving movie clip with actionscript 2.0
I have a movie clip that needs to move to a location when a button is pressed. I need the movement to be animated rather then just jump to the location. I think it would have something to do with affecting the movieclips _x and _y but i can't figure out how to make it animated.
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
-
you could animate it by hand on the timeline add a stop to the first frame and the end frame, and when you would like to have the animation start just add
myButtonName.onRelease = function ():Void { animationName.play(); }
that works well if it is only ever going to animation to one position, if you want it to go to a different position, you can do it with code using a Tween Library. There is one built into flash, but I always use third party engines. One of the more popular ones is GreenSock TweenLite. It is very simple and they have examples on their site (http://www.greensock.com/tweenlite/)
-
The movie clip is moving to one of five locations, i would rather use just action script. I know it can be done i just don't know quite how to do it.
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
-
like i said, check out the greensock site. they have examples and a little tool to help you through it
-
Prid - Outing
Give your movieclip an instance name of mc, and use this code on your frame:
Actionscript Code:
speed = 10; // the higher the slower
mc.onEnterFrame = function(){ this._x += (mouseX - this._x)/speed; this._y += (mouseY - this._y)/speed; }
onMouseDown = function(){ mouseX = _root._xmouse; mouseY = _root._ymouse; }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Thanks Nig 13, can you explain how to use it? how is it activated when i click a button?
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
-
Never mind i figured it out.
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|