-
Laggy swf.
My swf starts with 100 movieclips, and that makes it really laggy. After a while in the swf, those movieclips are being removed through AS3. And after they are removed, the swf is still that laggy! And if I start off with zero movieclips, it is not laggy at all.
Please help! In AS2 I could simply use updateAfterEvent...
-
trace("AKA: Biro Barna");
Hi Pattt, could you post your .fla file ? or something that we could take a look at because it's really hard to tell what's wrong ( if there's anything wrong ).
-
There isn't anything wrong with the code really.
The only thing is that the swf keeps being slow even after the movieclips (that made the swf slow) is gone.
In AS2, that could be fixed with updateAfterEvent, but now I don't know.
Any idea?
-
trace("AKA: Biro Barna");
Just because you think your code is ok and it isn't causing the lagging doesn't mean you're right. Anyways, here's an example for updateAfterEvent:
code: function onTimer(event:TimerEvent):void {
if (40 < my_mc.x && my_mc.x < 375) {
my_mc.x-= 50;
} else {
my_mc.x=374;
}
event.updateAfterEvent();
}
var moveTimer:Timer=new Timer(50,250);
moveTimer.addEventListener(TimerEvent.TIMER,onTime r);
moveTimer.start();
Hope it helped with anything.
Good luck.
-
Okey, maybe updateAfterEvent isn't going to help me then.
Alright, let's look at the part where the movieclips are removed:
removeEventListener(Event.ENTER_FRAME, run);
Object(parent).removeChild(this);
Every movieclip has a enterFrame event, that are been removed also.
Could there be some problems here?
-
trace("AKA: Biro Barna");
Easily could, having separate listener for lots of movie clips is a pain in the arsche... Btw, if you are using Enter_Frame that updates itself anyways after each event, that's why we use it for preloaders...
IMHO try thinking of an other way of doing whatever you want to do... Once your movie reaches really high amount of movie clips and each of those clips containing enter frame event, will surely kill your animations speed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|