Click to See Complete Forum and Search --> : [Problem] Please Help
flash-freak-0
07-30-2006, 09:09 AM
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.
cancerinform
07-30-2006, 12:39 PM
Larger headlines will not solve your problems ;)
You mean onEnterFrame?
flash-freak-0
07-31-2006, 12:50 AM
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.
cancerinform
07-31-2006, 08:51 AM
You can:
mc.onEnterFrame = function(){
this._x +=5;
}
flash-freak-0
08-01-2006, 01:30 AM
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?
VI Knight
08-01-2006, 09:16 AM
if you want it to stop at 200 you can use. Relplace 200 with whatever value you need to use.
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.
flash-freak-0
08-01-2006, 09:48 AM
if you want it to stop at 200 you can use. Relplace 200 with whatever value you need to use.
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?
cancerinform
08-01-2006, 10:04 AM
Here is something you may want to look at
http://www.flashscript.biz/actionscript1/basic_scroller/basic_scroller.html
flash-freak-0
08-01-2006, 10:35 AM
Here is something you may want to look at
http://www.flashscript.biz/actionscript1/basic_scroller/basic_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. :(
VI Knight
08-01-2006, 11:15 AM
he wants an easing on the motion
flash-freak-0
08-01-2006, 11:23 AM
8-( ?
flash-freak-0
08-01-2006, 11:29 AM
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?
Croat
08-01-2006, 12:58 PM
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).
cancerinform
08-01-2006, 01:23 PM
Yeah, that is one simple way of doing it. Somebody was mentioning about easing:
http://www.adobe.com/devnet/flash/articles/custom_easing.html
EVPohovich
08-01-2006, 02:39 PM
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 (http://board.flashkit.com/board/showthread.php?t=41172).
Thanks,
EVP
kenishii
08-01-2006, 03:42 PM
hey cancerinform, isn't there something on the FK regs, about being an elitist or snob or something along those lines....: )
flash-freak-0
08-01-2006, 04:14 PM
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).
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:
Croat
08-02-2006, 03:12 AM
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 (http://board.flashkit.com/board/showthread.php?t=41172).
Thanks,
EVP
No worries, never read the Regulations (im such a bad man!). Sorry.
Flash_Geek
08-02-2006, 04:09 AM
Hey, the Tween class is what your looking for, it does motions tweens, but via actionscript.
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 @ flash_kit_help@hotmail.com
Cheers
flashkit.com
Copyright Internet.com Inc., All Rights Reserved.