Created
May 29, 2015 03:33
-
-
Save zwetan/e35436d785162b294138 to your computer and use it in GitHub Desktop.
async, event and timers in redtamarin -- alpha quality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/as3shebang -- | |
import shell.Program; | |
import shell.Runtime; | |
import flash.events.TimerEvent; | |
import flash.utils.Timer; | |
Program.atExit( function() { trace( "I'm out" ); } ); | |
var timerHandler:Function = function( event:* ):void | |
{ | |
trace( "TIMER" ); | |
} | |
var timerCompleteHandler:Function = function( event:* ):void | |
{ | |
trace( "TIMER_COMPLETE" ); | |
Program.exit(); | |
} | |
var mytimer:* = new Timer( 5000, 2 ); | |
mytimer.addEventListener( TimerEvent.TIMER, timerHandler ); | |
mytimer.addEventListener( TimerEvent.TIMER_COMPLETE, timerCompleteHandler ); | |
mytimer.start(); | |
Runtime.goAsync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when you run this script you'll see a lot of debug output, it is normal
you should see