actionscript animation dropping frames


i had idea actionscript - wanted use stage listen mouse clicks , mc add mousex mousey positions

 

these scale until click recieve

 

 

problems start ocurring once 10 mc's on screen - dont think memory link problem (ran memory)

 

from analysis done using

http://code.google.com/p/mrdoob/wiki/stats

 

 

the problem seems lie in time takes calculation

the code simple enough array , scaling

any 1 input

 

 

 

 

var mcarray:array = new array();
var i:int = 0;
stage.addeventlistener(mouseevent.mouse_down,addingmctostage,false,0,true);

 

function addingmctostage(evt:event){
var circletemp:circle = new circle();
circletemp.x = mousex
circletemp.y = mousey
mcarray.push(addchild(circletemp));
trace(mcarray.length)
//trace(mcarray[mcarray.length-1])
if(!mcarray[mcarray.length-1].haseventlistener(event.enter_frame))
{
mcarray[mcarray.length-1].addeventlistener(event.enter_frame,scalingmc,false,0,true);
}
}

 


var mc:movieclip;
var pos:int;
function scalingmc(evt:event){
//trace(mcarray.length-1);
trace(system.totalmemory)
//trace('.');
pos = mcarray.length-1;
mc = mcarray[pos] movieclip;
if(mcarray.length==1){
//trace('this first')
mc.scaley = mc.scalex = mc.scalex + 0.1;
//mc.scaley = mc.scaley + 0.1;

 


}
else{

//mc[pos].removeeventlistener(event.enter_frame,scalingmc);     

if(!mcarray[mcarray.length-1].haseventlistener(event.enter_frame))
{
mcarray[mcarray.length-1].addeventlistener(event.enter_frame,scalingmc,false,0,true);
}

mc.scaley = mc.scalex = mc.scalex + 0.1;
//mc.scaley = mc.scaley + 0.1;


}


}



More discussions in Using Flash Player


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts