/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import flash.utils.Timer; import flash.events.TimerEvent; var xTime : int = 0; var xCount : int = 100; var xHalf : int = xCount / 2; var xTimer : Timer; xTimer = new Timer(10); xTimer.addEventListener(TimerEvent.TIMER, xfOnTimer, false, 0, true); xTimer.start(); function xfOnTimer(e : TimerEvent) : void { xCount--; // for the dramatic finish if (xCount < 2) xTime += 4000; else if (xCount < 5) xTime += 200 else if (xCount < 10) xTime += 100; else if (xCount < 50) xTime += 10 // frame changing if (mcContent.currentFrame == mcContent.totalFrames) mcContent.gotoAndStop(1); else mcContent.nextFrame() // new interval xTimer.stop(); if (xCount != 1) { xTimer = new Timer(xTime); xTimer.addEventListener(TimerEvent.TIMER, xfOnTimer, false, 0, true); xTimer.start(); } }
URL: http://simplistika.com/jackpot-slots/