• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
May 22, 2012 May 22, 2012

Copy link to clipboard

Copied

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;

}

TOPICS
ActionScript

Views

783

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 23, 2012 May 23, 2012

Copy link to clipboard

Copied

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/WS4bebcd66a74275c36c11f3d612431904db9-7ffc.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 23, 2012 May 23, 2012

Copy link to clipboard

Copied

LATEST

is there any way to do it to items inside graphic symbols? since they are light weight?

if i have a few movieclips with animated graphic symbols inside them how do i reference them to cache them if i cant make classes or as linkages for the graphic symbols

the way i would do it with movieclips is to

objectanimationmovieclip.seperateobjects.vectorobject.cacheAsBitmap = true

but if i have no class names for graphic symbols is there no way to refrence them?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines