|
-
[Problem] Please Help
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.
-
Senior Member
Larger headlines will not solve your problems 
You mean onEnterFrame?
- The right of the People to create Flash movies shall not be infringed. -
-
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.
-
Senior Member
You can:
mc.onEnterFrame = function(){
this._x +=5;
}
- The right of the People to create Flash movies shall not be infringed. -
-
 Originally Posted by cancerinform
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!
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.
Code:
mc.onEnterFrame = function(){
this._x +=5;
if (this._x >= 200){
this._x=200;
}
}
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.
-
 Originally Posted by VI Knight
if you want it to stop at 200 you can use. Relplace 200 with whatever value you need to use.
Code:
mc.onEnterFrame = function(){
this._x +=5;
if (this._x >= 200){
this._x=200;
}
}
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.
well as you said complicated... how complicated did you say it was again?
I know there is a tutorial for this in www.actionscript.org , but I can't seem to find it?
-
Senior Member
- The right of the People to create Flash movies shall not be infringed. -
-
 Originally Posted by cancerinform
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.
-
he wants an easing on the motion
-
-
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).
-
Senior Member
Yeah, that is one simple way of doing it. Somebody was mentioning about easing:
http://www.adobe.com/devnet/flash/ar...om_easing.html
- The right of the People to create Flash movies shall not be infringed. -
-
FK'n Elitist Super Mod
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....: )
-
-
 Originally Posted by EVPohovich
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
No worries, never read the Regulations (im such a bad man!). Sorry.
-
Tween Class
Hey, the Tween class is what your looking for, it does motions tweens, but via actionscript.
Code:
import mx.transitions.Tween
import mx.transitions.easing.*
btn_btn.onRelease = function(){
new Tween(target,property,start value, end value, time, frames?)
}
the Tween class uses these parameters:
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
Ben a.k.a. Flash Geek Need Help? Get It Within 24 hours. If you don't have one of these messenger clients, just email me at my msn address below: Msn: ben" at "benmartinstudios" dot "com"
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
|