The rumors are true: _visible = false still eats CPU

Posted on Thursday 14 July 2005

I have heard a couple of times that a movieclip with _visible = false can still consume CPU under some circumstances but I quickly dismissed these rumors as cluelessness/urban legends. I am currently working on a kiosk project that has a ton of views on stage (> 50) with tons of components in each of the views. Usually I am a proponent of just-in-time instantiation of views but in this case it's a kiosk that is going to be open all day and responsiveness is key so instead the views are attached on stage by the main controller in the first few frames. Well this movie was constantly running 90-100% CPU with nothing but a single background bitmap visible. Everything else was set to _visible = false. I searched for all the usual suspects: onEnterFrame, doLater, invalidate being called incessantly, Tween, etc. I even installed the debug player to see if it wasn't trying to access a ghost property or some other voodoo.

But it was none of the above. The simple fact that the views were on stage was causing the CPU to rise. All views inherit from the same base class so in the init function I set:


_x = -2000;
_y = -2000;
 

CPU usage instantly dropped to less than 10%. I since then modified the show(), hide() and move() functions appropriately to both set _visible to false AND move the movieclips off stage and the app's responsiveness has gone through the roof. This has not been fixed in Flash player 8. I do not have a working demo since it's under NDA and I'm a bit pressed for time here but if any of you guys can do a demo showing the issue and send a bug report to MM, that'd be great.


WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '131' AND comment_approved = '1' ORDER BY comment_date

No comments have been added to this post yet.

Leave a comment




Your e-mail address is never displayed. If you run into issues with SpamKarma blocking you, email me at $patrick->5etdemi(com)


RSS feed for comments on this post | TrackBack URI