I need to create a sideways scroll effect, ideally using only actionscript, but to keep it simple I essentially need to be able to click and hold down a button and have another MC move, a progressive movement as opposed to an abrupt change from point A to B. I can’t use motion tweening animation between frames it has to be done with code…
do you have a fla? What you can do it set up a button to create an onEnterFrame handler for your movie clip that will move it a few pixels at a time. This will end up looking like motion. Then, you set it up to delete the onEnterFrame handler when they let go of the button, stopping the motion. I posted something like this a couple days ago let me see if i can find it.
Thanks grandsp5 that worked perfectly, I have never come across anything like
[AS]this.onEnterFrame = function(){
if(targetMovie._x < moviesXLimit) targetMovie._x+=5;
}
[/AS]
Is this new to FlashMX, do you know where i can learn more?
The onEnterFrame handler is I believe a new thing. (I only started flash about a 2 and a half months ago so I’m not totally sure, I really only have experience with MX) Do some searching on the forums, I had a thread i posted about the onEnterFrame handler a while back. It basically runs a check at the framerate of the movie and executes the code. IE - that code would be executed 12 times a second if your fps is 12.