Loading and Interacting with External Movies : Loader « Network « Flash / Flex / ActionScript






Loading and Interacting with External Movies

 

package {
  import flash.display.*;
  import flash.net.URLRequest;
  import flash.events.Event;

  public class LoaderExample extends Sprite {
    
    private var _loader:Loader;
    
    public function LoaderExample(  ) {
      _loader = new Loader(  );
      addChild( _loader );
      
      _loader.contentLoaderInfo.addEventListener( Event.INIT, handleInit );
      
      _loader.load( new URLRequest( "ExternalMovie.swf" ) );
    }
    
    private function handleInit( event:Event ):void {
      var movie:* = _loader.content;
      
      trace( movie.getColor(  ) );
      
      movie.setColor( 0xFF0000 );
    }
  }
}

        








Related examples in the same category

1.Main.Swf Listener Receives Notification for an Event Targeted at a Module.swf Display Object
2.Add mouse click listener to a loaded swf
3.Loading External Images at Runtime
4.Add event listener to content loader info
5.Adding a Loader to the display list
6.Displaying load progress
7.Load-error handling
8.Polling for the existence of a loaded object
9.Handling an event announcing a loaded object's availability
10.Load an image using Loader