Time-out in flash
- Started
- Last post
- 31 Responses
- ********0
fricking nerds
- caseyc0
I tried to resist my inner nerd urging me to reply but couldnt resist...
So, using _root gets a slap on the wrist from you but we should let you get away with "cheating" the compiler by evaluating everything?
:)
Try using a dynamic class or assigning the evals to vars so you dont have to do the same eval over and over again. That's all I'm saying. Over.
- joyride0
lol...
ps - it's a touchscreen. no mouseup/down only mouseMove.
And yes, I'm a nerd and I laugh all the way to the bank.
- st33d0
How's this for knowing it all:
http://pastebin.coconut.se/?id=4…
due to popular request.
This time the evals are really necessary because Flash has scope issues with events.
But yeah - I shoulda done it properly the first time.
*hangs head in shame
- st33d0
Ah, didn't turn off the interval when it called the function.
Otherwise the screensaver will keep restarting.
- caseyc0
Here's my quick take on it, I'm not a fan of setInterval as you can tell.
http://pastebin.coconut.se/?id=4…
Also, mine still runs the timer while its idle so you can do things while the screen saver is running, say you wanted to shut the whole thing down after 5mins of idle time etc.
st33d, to my knowledge Mouse doesnt throw any of those events (onMouseUp, etc) is it actually working for you?
- st33d0
I'm running the code from the timeline - I just wrote it so it could be dumped in anywhere.
Look up the Mouse class, it's one of Flash's listener classes. I felt that an MC had mouse listeners on it anyway which is why I chose that route to begin with. I just did the setInterval for the other snobs.
http://www.learnthat.com/compute…
It's working fine on mine (Flash MX2004). I always test code before I post.
But yeah, setInterval kills all scope when you enter the function you sent it to. I just usually send 'this' as a param to it.
- undo_undo0
hey st33d if it works it works. if its pride yr looking for then this thread was worth every drop!
you n33rds!!
- caseyc0
Sweet, for some reason I was thinking the Mouse.onWhatever events never worked. Good looking out.
- Inkyfingers0
A big thanks to everyone who responsed. Theres certainly a number of ways of achieving it. I really need to brush up on my ActionScripting.
Thanks again.
