Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: LennonLenford on Jul 29th, 2012  |  syntax: ActionScript 3  |  size: 0.75 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import flash.display.MovieClip;
  2.         import flash.events.Event;
  3.         import flash.events.ProgressEvent;
  4.         import flash.text.TextField;
  5.         import flash.display.Stage;
  6.  
  7.                 var info:TextField = new TextField();
  8.                
  9.                 startPreloader()
  10.                 function startPreloader() {
  11.                         loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
  12.                        
  13.                         info.textColor = 0xFFFFFF;
  14.                         stage.addChild(info);
  15.                         info.text = "Loading...";
  16.                 }
  17.                
  18.                 function progress(e:ProgressEvent):void {
  19.                         if (e.bytesLoaded >= e.bytesTotal){
  20.                                 loadingFinished();
  21.                         }
  22.                 }
  23.                
  24.                 function loadingFinished():void {
  25.                         loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
  26.                        
  27.                         Stage.removeChild(info);
  28.                        
  29.                         startup();
  30.                 }
  31.                
  32.                 function startup():void {
  33.                         gotoAndStop(2);
  34.                 }