STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 228089 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2561 · P5121 |
This is the info page for Flash #161540 |
INSTRUCTIONS DO NOT include these notes in your movie! Everything you need is in the first frame of this .FLA file. Copy the movie clip on the first frame of this .FLA, then paste it into the first frame of your .FLA. HOW IT WORKS The loader will automatically stop your movie/game from playing while it loads, displaying a progress bar. Once your Flash is 100% loaded, the loader will present a [PLAY] button. Pressing this button simply starts playing everything after your first frame. That's it! CHANGES Some people prefer their movie to automatically start playing when it's 100% loaded. To do this, edit the actions in the first frame of the loader clip by changing var AUTO_PLAY = false; to var AUTO_PLAY = true; Also, you're completely welcome to edit any of the graphics in this loader...we love seeing the NG Tank Logo in your games and movies, though! :) |
ActionScript [AS3]
Section 1//NGLoader (NGLoader) package { import flash.events.*; import flash.display.*; import flash.system.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class NGLoader extends MovieClip { public const AUTO_PLAY:Boolean = false; public var ngButton:SimpleButton; public var bar:MovieClip; public var playButton:SimpleButton; public var loadingComplete:Boolean; public var initialized:Boolean; public function NGLoader(){ addFrameScript(0, frame1, 1, frame2); } public function init():void{ if (initialized){ return; }; initialized = true; stop(); if (((root) && ((root is MovieClip)))){ MovieClip(root).stop(); }; loadingComplete = false; ngButton.addEventListener(MouseEvent.CLICK, ngButtonClickHandler, false, 0, true); addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 0, true); if (meetsVersion([9, 0, 28, 0])){ addEventListener(Event.REMOVED_FROM_STAGE, cleanup, false, 0, true); }; enterFrameHandler(); } public function meetsVersion(_arg1:Array):Boolean{ var _local2:Array = String(Capabilities.version.split(" ")[1]).split(","); var _local3:uint; while (_local3 < _arg1.length) { if (uint(_local2[_local3]) > _arg1[_local3]){ return (true); }; if (uint(_local2[_local3]) < _arg1[_local3]){ return (false); }; _local3++; }; return (true); } public function enterFrameHandler(_arg1:Event=null):void{ var _local2:Number; if (!loadingComplete){ _local2 = 0; if (loaderInfo){ _local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal); }; if (bar){ bar.scaleX = _local2; }; if (_local2 == 1){ loadingComplete = true; if (AUTO_PLAY){ startMovie(); } else { gotoAndPlay("loaded"); }; }; }; } public function ngButtonClickHandler(_arg1:Event):void{ navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank"); } public function cleanup(_arg1:Event=null){ if (initialized){ ngButton.removeEventListener(MouseEvent.CLICK, ngButtonClickHandler); removeEventListener(Event.ENTER_FRAME, enterFrameHandler); if (meetsVersion([9, 0, 28, 0])){ removeEventListener(Event.REMOVED_FROM_STAGE, cleanup); }; }; initialized = false; } public function startMovie():void{ cleanup(); if (((root) && ((root is MovieClip)))){ MovieClip(root).play(); }; dispatchEvent(new Event(Event.COMPLETE)); } public function playButtonClickHandler(_arg1:Event=null):void{ startMovie(); } function frame1(){ initialized = false; init(); } function frame2(){ stop(); if (((playButton) && (!(playButton.hasEventListener(MouseEvent.CLICK))))){ playButton.addEventListener(MouseEvent.CLICK, playButtonClickHandler, false, 0, true); }; } } }//package
Library Items
Symbol 1 Graphic | Used by:18 | |
Symbol 2 Graphic | Used by:3 | |
Symbol 3 MovieClip | Uses:2 | Used by:18 |
Symbol 4 Graphic | Used by:18 | |
Symbol 5 Graphic | Used by:8 9 | |
Symbol 6 Graphic | Used by:8 9 | |
Symbol 7 Graphic | Used by:8 9 | |
Symbol 8 MovieClip | Uses:5 6 7 | Used by:9 |
Symbol 9 Button | Uses:8 5 6 7 | Used by:18 |
Symbol 10 Graphic | Used by:18 | |
Symbol 11 Graphic | Used by:17 | |
Symbol 12 Graphic | Used by:17 | |
Symbol 13 Graphic | Used by:17 | |
Symbol 14 Graphic | Used by:17 | |
Symbol 15 Graphic | Used by:17 | |
Symbol 16 Graphic | Used by:17 | |
Symbol 17 Button | Uses:11 12 13 14 15 16 | Used by:18 |
Symbol 18 MovieClip {NGLoader} | Uses:1 3 4 9 10 17 | Used by:Timeline |
Symbol 19 Font | Used by:20 | |
Symbol 20 Text | Uses:19 | Used by:Timeline |
Symbol 21 Video | Used by:Timeline | |
Streaming Sound 1 | Used by:Timeline |
Instance Names
"bar" | Symbol 18 MovieClip {NGLoader} Frame 1 | Symbol 3 MovieClip |
"ngButton" | Symbol 18 MovieClip {NGLoader} Frame 1 | Symbol 9 Button |
"playButton" | Symbol 18 MovieClip {NGLoader} Frame 2 | Symbol 17 Button |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access local files only, Metadata not present, AS3. |
Labels
"loaded" | Symbol 18 MovieClip {NGLoader} Frame 2 |
|