IN A NUTSHELL--------------------------------- how can i write this line in Action Script? while(mouse is not released) do { whatever } -------------------------------------------------- I want; to add a script to a button , btw i was using Flash CS3 proffesional and didn;t know you can't add a script to an object using as 3.0 so i was forcd to use actionscript 2.0. I want to add a script to a button instance name "R" that will move the object instance name "timeline" to the left as long as you hold the mouse down. so i have this so far but it will only move the timeline with a single click.... see If i only knew how to write the while condition... //on(press){ // while(cord == true){ // _root.timeline._x = _root.timeline._x - 10; // } //} Thank you....
try: on(press){ moveI=setInterval(moveF,60); } on(release){ clearInterval(moveI); } // attach the following to the frame that contains your button: function moveF(){ _root.timeline._x -= 10; }
Figured it out...It was kinda weird, when i retyped the clearInterval(moveI) then it started to work. something about copy pasting that doesn't work.
[q][i]Originally posted by: [b][b]kglad[/b][/b][/i] try: [/q] thank you for your help........brilliant idea though it didn't work all to well.. I studied your code and it makes sense it should work fine...As I click on the button once it moves continuously, but when i release the button it still continues to move...Interesting.. Also As i click on the button the speed increases. Thanks again.
Don't see what you're looking for? Try a search.
|