_rotation & redraws

Jan 18, 2005   //   by Tuomas Artman   //  No Comments

While developing a rather complex spiderweb-UI with loads of nodes and sub-nodes that are connected to each other I wondered why my CPU jumped to 100% although nothing was moving on the screen.

When moving a lot of MC’s around the screen with ease-outs or on elastic paths I usually just update the _x-property of all MC’s without checking if it really needs updating (reached it’s end-position), since Flash is smart enough not to redraw the MC if the the property’s value has not changed from the last update.

As it turns out, Flash is not so smart when it comes to the  _rotation-property. Setting the _rotation-property will make Flash redraw the MC no matter even if the value does not change. So mClip._rotation = mClip._rotation will make Flash redraw the element, where mClip._x = mClip._x will not.

Reclaim the CPU!

Leave a comment