-
1. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
moccamaximum Mar 21, 2013 1:23 AM (in response to saariko)To help your performance issues a little more background of the workflow is needed.
I receive normal vector animations from the app's artists
Are these the users? Do they draw something in your app and you upload it to a repository? Why is there a need to save to bitmapdata when it is never added to the display list?
Do you record the act of drawing (to make it replayable) and this is what you mean by "animations"?
-
2. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
saariko Mar 21, 2013 1:31 AM (in response to moccamaximum)sure, sorry for that
this is a children's book. each page has animations in it. all these animations are vector animations in timelines in FLAs I receive from the devloping artists (not the users).
Every page has an FLA which i publish to a swf.
what i actually do is replace vector animations in loaded SWFs with bitmap version of them.
At app runtime, upon each new page, i load the swf, go though all the animations in it (looping through the content's children) and each movieclip i rasterize into array of bitmapdatas.
My custom "Bitmap Movieclip" places on the displaylist a replcaement bitmap for each movieclip, and on ENTER_FRAME i switch the bitmaps' bitmapdatas from the array.
this gives very hight performance
is that cleaer?
-
3. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
moccamaximum Mar 21, 2013 1:38 AM (in response to saariko)Now I understand. Why do you do this at runtime? If you only "convert" the Vectoranimations into Bitmapdata you should look into JSFL
This will enable you to convert library assets of multiple flas and should be much quicker then the workflow you described.
-
4. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
saariko Mar 21, 2013 1:46 AM (in response to moccamaximum)thanx,
but your suggestion is not dynamic
converting at runtime gives 2 things:
1. much smaller app size
2. drawing the vector to bitmapdatas with correct scaling unsures best graphics on different screen sizes and different scrren PPIs (the convereter is "smart")
-
5. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
moccamaximum Mar 21, 2013 1:57 AM (in response to saariko)I´m not a dedicated mobile developer, and have not enough details how complex the animations are you have to handle, but from a pure technical aspect this whole procedure you are talking of, seems like a very performance intense thing to me. Maybe I´m not understanding it right, though. Basically I see: everytime your app runs on a users device you are taking screenshots (writing Bitmapdata) of everything on stage, displaying it and immediately getting rid of it?
-
6. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
moccamaximum Mar 21, 2013 2:03 AM (in response to moccamaximum)Anyway...You could check if the last Pixel in your Bitmapdata is available to "wait" that it has actually been drawn. Use the getPixel32() method for that.
-
7. Re: AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?
saariko Mar 21, 2013 2:25 AM (in response to moccamaximum)So sorry, MY BAD
waiting for FRAME_CONSTRUCTED is the answer!
should this thread be closed/deleted?
how to do so?


