DoubleClick Studio AS3 API Reference

class com.google.ads.studio.AssetLoader

Extends com.google.ads.studio:PageLoadDependentComponent

The Loader component (AssetLoader class) is a conditional loader. It can be used to load in an asset into a movieclip, wait for an HTML page to load and perform an action, or control movie playback flow. Valid assets are SWF or images.

For more information, see the Loader component.

The loader loads the asset in a nested movieClip so the hierarchy of a loader on root is root.loaderInstance.content. The position of the loaded content is x:0, y:0 inside the loader instance.

Once the movieClip is loaded, you may access the loaded movieClip in the following manner:
   var childMovie = loaderInstance.getContentMovieClip();
   
You may also listen for the load event:
   // Setup: loaderInstance is the instance name of the Loader component
   // on the stage.
    
   import com.google.ads.studio.events.StudioEvent;
    
   var childMovie:MovieClip;
   var loadHandler:Function = function(loadEvent:StudioEvent):void {
     childMovie = loadEvent.content;
     // Alternatively, loaderInstance.getContentMovieClip() will also return
     // the loaded MovieClip.
   };
   loaderInstance.addEventListener(StudioEvent.LOAD, loadHandler);
   

Expand Events

Constructors

AssetLoader() : void

Instance Methods

Defined in: com.google.ads.studio:EnabledComponent

getEnabler() : Object
isInitialized() : Boolean

Returns whether the component has initialized.

Defined in com.google.ads.studio:AssetLoader

getContentMovieClip() : MovieClip

Gets the content movieclip the movie is loaded into if the load movie option is selected.

     import com.google.ads.studio.AssetLoader;
      
     var loadHandler:Function = function(event:StudioEvent):void {
       var content:MovieClip = loaderInstance.getContentMovieClip();
       trace("childText value is " + content.childText);
     };
     loaderInstance.addEventListener(StudioEvent.LOAD, loadHandler);
     

getMovieClipLoader() : StudioLoader

Gets the MovieClipLoader instance if the user wants to do fine-grained monitoring of the movie clip's loading progress.

     import com.google.ads.studio.AssetLoader;
      
     var loader = loaderInstance.getMovieClipLoader();
     var loadProgress:Function = function(event:ProgressEvent):void {
       trace("Load progress " + event.bytesLoaded + " bytes of " +
           event.bytesTotal + ".");
     };
     loader.contentLoaderInfo.addEventListener(
         ProgressEvent.PROGRESS,
         loadProgress);
     

Back to top

  1. com.google.ads.studio
    1. AssetLoader
    2. ContextualDiscovery
    3. F2fEnabler
    4. FullScreenButton
    5. HtmlEnabler
    6. ProxyEnabler
    7. VpaidEnabler
  1. com.google.ads.studio.configurable
    1. Configurable
  1. com.google.ads.studio.display
    1. StudioLoader
  1. com.google.ads.studio.events
    1. StudioEvent
    2. StudioVideoEvent
  1. com.google.ads.studio.expanding
    1. Expanding
  1. com.google.ads.studio.localconnect
    1. LocalConnectWrapper
  1. com.google.ads.studio.video
    1. ConfigurableVideoPlayer
    2. EnhancedVideoController
    3. PlayPauseButton
    4. Playlist
    5. Scrubber
    6. SoundToggleButton
    7. VideoController
    8. VideoEntry
    9. VideoPlayer
    10. VideoPlayerAdvanced
  1. com.google.ads.studio.vpaid
    1. VpaidTimer