Hi,
I have a scrolling/zoom in animation done in as3. At times the animation is jerky. I am wondering how I can possibly smooth this out. I am using several quite large mc's that are all being manipulate at the same time. Would it help to make mc's that are off the screen invisible until they are visually needed? I am very new to flash/as3 so I don't know a lot about what might slow down the animation. Any suggestions would be very helpful.
I am working in cs4. Here is a link to the page I am working on. It is mostly the "Harman" button that I am getting this jerkiness on and then only sometimes. Hover over the logo to expand the menu. I wonder if I just have too much going on at the same time?
The code I am working with is this:
Thanks in advance for any help you can give. :)Code:var harmanTimerIn:Timer = new Timer(40,20);
harmanTimerIn.addEventListener(TimerEvent.TIMER, harmanAniIn);
function harmanAniIn(evt:TimerEvent): void {
//trace(harmanTimerIn.currentCount);
var heightChange:Number = swfHeight/6;
var heightChange2:Number = swfHeight/20;
if(harmanTimerIn.currentCount > 5 && harmanTimerIn.currentCount < 16) {
var preWidth:Number = pan4_7.width;
pan4_7.height = pan4_7.height+heightChange;
pan4_7.width = pan4_7.height*pan4_7AR;
pan4_7.y = pan4_7.y-(heightChange/2);
pan4_7.x = pan4_7.x-(pan4_7.width-preWidth)/4;
preWidth = pan1_3.width;
pan1_3.height = pan1_3.height+heightChange;
pan1_3.width = pan1_3.height*pan1_3AR;
pan1_3.y = pan1_3.y-(heightChange/2);
pan1_3.x = pan4_7.x-pan1_3.width;
preWidth = hpan3_6.width;
hpan3_6.height = hpan3_6.height+heightChange2;
hpan3_6.width = hpan3_6.height*hpan3_6AR;
hpan3_6.y = hpan3_6.y-((heightChange2/2)+(heightChange2/10));
hpan3_6.x = hpan3_6.x-(hpan3_6.width-preWidth)/4;
preWidth = hpan1_2.width;
hpan1_2.height = hpan1_2.height+heightChange2;
hpan1_2.width = hpan1_2.height*hpan1_2AR;
hpan1_2.y = hpan1_2.y-((heightChange2/2)+(heightChange2/10));
hpan1_2.x = hpan3_6.x-hpan1_2.width;
preWidth = hpan7_9.width;
hpan7_9.height = hpan7_9.height+heightChange2;
hpan7_9.width = hpan7_9.height*hpan7_9AR;
hpan7_9.y = hpan7_9.y-((heightChange2/2)+(heightChange2/10));
hpan7_9.x = hpan3_6.x+hpan3_6.width;
}
if(harmanTimerIn.currentCount > 15) {
pan4_7.alpha -= .2;
pan1_3.alpha -= .2;
pan8_10.alpha -= .2;
}
if(harmanTimerIn.currentCount == 20) {
pan4_7.visible=false;
pan1_3.visible=false;
pan8_10.visible=false;
pan11_13.visible=false;
pan14_16.visible=false;
logoMain.visible=false;
scrollSwitch = "on";
page_close.visible=true;
harmanTimerIn.stop();
harmanTimerIn.reset();
}
}