Ok so you press left button and it doesnt loop try this post that code in and then go to frame 5 then go to the actionscript/sounds window then press the + button then click the button that says ''go to frame'' then change those drop down menus so it says ''keyframe 1'' and ''play'' that should make it loop.
You're not trying to use this in the main timeline are you? Because the onEnterFrame will only work on a child movie within the main timeline. Use a dummy movie clip with your repeated actions like this in it. or use setInterval to have the function keep checking.
If the frame you go to is the last one, try gotoAndStop instead of gotoAndPlay. You might have forgotten to set a stop action at the end of your movie.
Examine the attached file...left arrow goes to frame 3...right to frame 5...I presume you are needing multiple actions..
note...the keyframes have been named (as mentioned before)(rightclick/rename in movie explorer or timeline)..jumping is unpredictable otherwise and causes the effect you describe.
I had to add a dummy frame at the end which was needed for stability (aka stopping in the first keyframe is not reliable)...the flash player does have the odd quirk..
The code does work in the main timeline (even though it shouldn't) but I was going to suggest creating a movieclip for handling your keyboard actions (in a similar way that buttons are types of movieclips)...so actions would become _root.gotoAndPlay("three"); and so on...note the movieclip would need to be present in all main timeline frames.
Instead of onEnterFrame you could also use a key listener.
That probably requires less cpu load because it is only triggered when a key is pressed and doesn't have to perform actionscript code each enterFrame event.
Instead of onEnterFrame you could also use a key listener.
That probably requires less cpu load because it is only triggered when a key is pressed and doesn't have to perform actionscript code each enterFrame event.
Yes that sounds better...the method I used was the only one I could find when I was looking some time ago....macromedia incorporate key detection into the button action so I needed the equivelent method for koolmoves.
I remember trying a key listener without success...do you have an example of working syntax?
Thankyou for that...I'm off to play with it myself (perhaps I should rephrase that!)
regards
mike
edit...well I'm pleased to report that it worked a treat...perfect response which is independant of frame rate (does a small celebration dance) definately a better method...ow where did ksands go
note...I used it in the main timeline.