I have a MovieClip with 100 frames and I'm trying to get it to play the specific frames based on its acceleration values.
Here's an image explaining what I'm aiming for. The MC with 100 frames should go and stay at the 50th frame. Depending on its movement from left or right, it should play the movieclip frames inside forward or backward.
Unless the gif has a glitch when the slider is returning thats not possible because why would you slide it left and it slides but than you bring it back and it doesnt slide. If you make it move with code it will work but not with key frames
Unless the gif has a glitch when the slider is returning thats not possible because why would you slide it left and it slides but than you bring it back and it doesnt slide. If you make it move with code it will work but not with key frames
onClipEvent (enterFrame) {
var fNum:Number = 50;
gotoAndStop(fNum);
}
Normally the code above works if you manually enter a number but I need it to read it from the position value of another object to create the swing effect.
So it should look like ;
onClipEvent (enterFrame) {
var fNum:Number = _root.Target._x;
gotoAndStop(fNum);
}
I figured out that the problem was that the _x value had fractions and that was whats messing up the script. I added a 'math:round' before '_root.Target._x' and it worked like a charm. I got the first part working where the frame it plays change depending on the _x position of another object. Now I wanna calculate the _x difference of the current and previous frames of that object and tell the MC which frame to play.
if you were declaring the variable outside of the movieclip then it would be referenced using _root.fNum or _parent.fNum
Thanks for the help I think I've figured it out with the code above. I got something else to do for the swing now. Would you mind helping me convert a few AS1 scripts into AS2 ?
actions for as1 & as2 are written for the same environment on flash cs6, your tween ran fine in cs6
maybe you are asking for it to be ported to actionscript compiler 2.0 which is actionscript 3.0?
The flash was set to be published for flash 5 with AS1. When I changed it to Flash 8 and AS2 it didn't work. It didn't show any errors but the spring effect wasn't working. I just need this script to run in AS2.
merre chrissmas alloys, i jus wonder if you have fixed the guy, or maybe you no downloaded file or perhap you not able to help because you can not do it.
honest is only answer alloy