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

Animate CC How can i cache as bitmap movie clip?

Community Beginner ,
Oct 07, 2016 Oct 07, 2016

I have a movie clip (enemy) inside the enemy i have 3 frames for iddle, attack and run.The enemies are inside Array.What is the better way to cache as bitmap the enemy and movie clips inside the enemy?

var greengoblinVelocity: int = 0;

var e: int;
for (e = numChildren - 1; e >= 0; e--)
{
var childdE: DisplayObject = getChildAt(e);
if (childdE.name.indexOf("enemy") > -1)
{
  
GreenGoblinArray.push(MovieClip(childdE));
  
MovieClip(childdE).hitPoints = 2;
  
MovieClip(childdE).currentX = 0;
  
MovieClip(childdE).startAttack = 0;
}
}


stage
.addEventListener(Event.ENTER_FRAME, gameloop);
function gameloop(event: Event😞 void
{
for (var enl = 0; enl < GreenGoblinArray.length; enl++)
  
{
  
var enemy: Enemy = GreenGoblinArray[enl] as Enemy;
  
}
}

TOPICS
ActionScript
1.0K
Translate
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 Expert ,
Oct 07, 2016 Oct 07, 2016
LATEST

it doesn't make any sense to cacheAsBitmap a movieclip that will be changing frames more than rarely.

create 3 movieclips of the 3 frames and cache each of them if there's enough memory and a significant performance benefit.

Translate
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