Created
April 16, 2012 06:50
-
-
Save lynxerzhang/2396792 to your computer and use it in GitHub Desktop.
about displayobject's cacheAsBitmap and updateAfterEvent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is a case: | |
In a very large-size Movieclip (as a game 'map', roughly 4000(width) * 2000(height)), set this movieclip's property 'cacheAsBitmap' to true, and this mc has dozen children, when you start drag this mc, you could obviously feel 'mousemove' is not smooth, Even if you register the mousemove listener and handle 'updateAfterEvent' method. drag mc is still not smooth. (and worse the fps is slower). | |
so read adobe's API documentation, found the 'cacheAsBitmap' property has some pay attention points... | |
"The cacheAsBitmap property is best used with movie clips that have mostly static content and that do not scale and rotate frequently. " | |
so I think this maybe the reason why above example's mc drag is not smooth, because internal children is change it's propery(like, 'rotation' "x", "y") will handle entire root mc to recreate the bitmap cache. and the mouseEvent's method | |
'updateAfterEvent' will enforce flashplayer to redraw immediately in every mouseMove operation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment