I heard of an action that controls the movements of a movie clip.
Can any body tell me the actionscript? I don't really rememder what it is.
Printable View
I heard of an action that controls the movements of a movie clip.
Can any body tell me the actionscript? I don't really rememder what it is.
Larger headlines will not solve your problems ;)
You mean onEnterFrame?
I'm not quiet sure? actually, I dont know hehe. its alternatively if your tired to animate a movie clip to move from wherever to wherever using tween, we can use actionscript, instead.
You can:
mc.onEnterFrame = function(){
this._x +=5;
}
yay! this is just what the doctor ordered! But.. The speed is constant, and doesn't stop!Quote:
Originally Posted by cancerinform
How can I make the movie clip stop in a specific time, and how can I make it slow down before it stops? :( is there an actionscript for this?
if you want it to stop at 200 you can use. Relplace 200 with whatever value you need to use.
as for slowing it down that will be a little more complicated. but there are a couple of ways of doing it. One would be the use of the tween class and the other would be a few nested if statements.Code:mc.onEnterFrame = function(){
this._x +=5;
if (this._x >= 200){
this._x=200;
}
}
well as you said complicated... how complicated did you say it was again? :(Quote:
Originally Posted by VI Knight
I know there is a tutorial for this in www.actionscript.org , but I can't seem to find it?
Here is something you may want to look at
http://www.flashscript.biz/actionscr..._scroller.html
Thanks for the link, but this is just not what I wanted. I didnt actually say I wanted it to be slow, I wanted it to slow down before it stops. :(Quote:
Originally Posted by cancerinform
he wants an easing on the motion
8-( ?
Does anybody visit www.actionscript.org Cuz I'm sure there is a tutorial for what I want. but that was a long time ago I saw it, so now I'm not sure where it is now?
Wouldent easing just be something like:
x_move = 5;
x_pos = 300;
x_ease = 10;
mc.onEnterFrame = function() {
xm = x_pos-_x;
_x += xm/x_ease;
};
EDIT: Just tested it and it worked for me (with a few tweaks ;p).
Yeah, that is one simple way of doing it. Somebody was mentioning about easing:
http://www.adobe.com/devnet/flash/ar...om_easing.html
Thread Title Edited.
Please do not do that in the future.
Croat that footer is WAAAY to large. Please knock it down to within Flask Kit Regulations.
Thanks,
EVP
hey cancerinform, isn't there something on the FK regs, about being an elitist or snob or something along those lines....: )
YAY, this is exactly what I wanted, thanks croat! :D :hug: thanks for everybody who tried to help me! :cap: you guys are helpful :grouphug:Quote:
Originally Posted by Croat
Quote:
Originally Posted by EVPohovich
No worries, never read the Regulations (im such a bad man!). Sorry.
Hey, the Tween class is what your looking for, it does motions tweens, but via actionscript.
the Tween class uses these parameters:Code:import mx.transitions.Tween
import mx.transitions.easing.*
btn_btn.onRelease = function(){
new Tween(target,property,start value, end value, time, frames?)
}
target - this is the target of your tween
property - this is the property of your target that you want to change (in your case, _x for horizontal position, and _y for vertical position) the property parameter must be enclosed in quotation marks (e.g. "_x")
start value - this is the value that the tween will start on, if you want to use the current value of your target, type target.property (e.g. your mc has an instance name of box_mc, and you want to tween it horizontally, you would type box_mc._x)
end value - this is the value that the tween will finish on
time - this is the amount of time that you want the tween to take
seconds? - this is a boolean value (true or false) if true, time will be measured in frames, if false, time will be measure in frames
Any questions, email me or ask via msn @ [email protected]
Cheers