Skip to main content
Participant
July 28, 2007
Answered

Mouse button releasing problem

  • July 28, 2007
  • 3 replies
  • 341 views
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 professional and didn;t know you can't add a script to an object using as 3.0 so i was forced to use action script 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....
This topic has been closed for replies.
Correct answer kglad
try:

3 replies

Armen_ZenAuthor
Participant
July 29, 2007
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.

Anyhow, Thank you very much...
kglad
Community Expert
Community Expert
July 29, 2007
you're welcome.
kglad
Community Expert
Community Expert
July 29, 2007
did you include the on(release) code for your button?
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 28, 2007
try:

Armen_ZenAuthor
Participant
July 29, 2007
quote:

Originally posted by: kglad
try:




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...Interestingly enough it won;t stop the moveI inteval .. Also As i click on the button the speed increases.
Thanks for your help again.