Skip navigation
Currently Being Moderated

can you specify movieclips as cache as bitmap, inside one large loaded movieclip?

May 22, 2012 8:05 PM

Tags: #cacheasbitmap #action_script_3 #actionscript3 #loading #load #actionscript_3.0 #cache.as.bitmap #.cacheasbitmap

at this point I'm not sure if i have to individualy add cacheasbitmap/cacheasbitmapmatrix to true to each display object that needs it and load them seperatly

or if i can load the movieclip that they are in first and specify their properties later then add it to the stage when it is all loaded.

 

can anyone tell me the best way to do this or maybe some tutorials to check out?

 

the AS for the loading is

 

var PLoading:Bitmap = new Bitmap (new PlaneLoading());

addChild(PLoading); //loading screen

var PLevel:PlaneLevel = new PlaneLevel();

this.addEventListener(Event.ENTER_FRAME, loading); //reoccuring event listener happens as often as is set by FPS

 

function loading(e:Event):void //

{

    var total:Number = this.stage.loaderInfo.bytesTotal;

    var loaded:Number = this.stage.loaderInfo.bytesLoaded;

    var percent:Number = loaded/total * 100;

    trace (percent);

    if (total == loaded) //checks if all bytes for all movieclips have been loaded

    {

        this.removeEventListener(Event.ENTER_FRAME, loading);

        onComplete();

    }

}

function onComplete ():void //removes loading picture, and loads level movieclip

{

    removeChild(PLoading);

    addChild(PLevel);

    PLevel.x = 475.15;

    PLevel.y = 315.35;

}

 
Replies
  • Currently Being Moderated
    May 23, 2012 2:14 PM   in reply to DKNMSIS
    It is the same do it individually for each MovieClip or all contained in a MovieClip. What you should know is that a movie clip with cachebitmap = true consume resources whenever it is drawn and if a movie clip is an animation, each frame will be redrawn.

     

    look this:

     

    http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36c11f3d612431 904db9-7ffc.html

     

     

     

     

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points