Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 54
Registered: ‎12-22-2010
My Device: Not Specified
Accepted Solution

AS3 animation slow/choppy

Hello Everyone,

 

I'm having a bit of an issue with the simulator and was hoping one of you knows how to make things better, if at all possible.

 

My problem is when using the ENTER_FRAME or TIMER events for animation. Animation on the simulator is very slow/choppy/inconsistent. I'm assuming this is related to VMWare and not the Simulator OS.

 

Has anyone run into this issue? If so, were you able to resolve it? If not, any other suggestions?

 

Thanks!

Developer
Posts: 274
Registered: ‎11-01-2010
My Device: PlayBook?
My Carrier: WiFi

Re: AS3 animation slow/choppy

For me the sim runs a bit slower but nothing bad enough that I can't test. I assume it will run fine on the actual device, as it runs fine on my desktop. It sounds like you are having a worse time with it.

 

What frame rate are you running at?

 

 

Developer
Posts: 54
Registered: ‎12-22-2010
My Device: Not Specified

Re: AS3 animation slow/choppy

I have it set to 30 right now. I"ll just stick to Timers and test on a browser window just in case. I also believe it will run ok on the actual device. Thanks for the input.

Developer
Posts: 54
Registered: ‎12-22-2010
My Device: Not Specified

Re: AS3 animation slow/choppy

After testing it on two different systems, one of them being an overclocked i7, I noticed the swf using up %100 of the cpu. ALL CORES!!! All it is is rotating a sprite with a few movie clips on its displayList. Smiley Sad now I'm stuck as this is an integral part of my app. Any ideas?

Developer
Posts: 54
Registered: ‎12-22-2010
My Device: Not Specified

Re: AS3 animation slow/choppy

Rotten,

 

I gave you kudos because you mentioned your desktop and that prompted me to test it on mine. I believe the issue is trying to rotate items with filters applied to them. I'm exporting the movieclips from flash as SWC files. After revising the assets and removing several filters, CPU usage came down to 50%. It's still a very high usage for a simple app so I might just remove them altogether.

 

Developer
Posts: 274
Registered: ‎11-01-2010
My Device: PlayBook?
My Carrier: WiFi

Re: AS3 animation slow/choppy

[ Edited ]

I'm also running at 30 fps.

 

Filters are bad for performance. Try to minimze their usage as best as you can. Often you can achieve the same effect by creating the effect you want in an external image editor (e.g. Photoshop) and then importing the image.

 

Rotating with a filter is probably even worse because using filters sets cacheAsBitmap to true. Rotating (or scaling) objects with cacheAsBitmap uses up more CPU. So you have the first performance loss simply using filters and then you take another hit when rotating on top of that. If you're doing a lot of this that can be pretty bad.

 

http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36c11f3d612431904db9-7ffc.html

 

However, that still may not be the entire source of all your performance issues. Try removing them entirely and see if everything clears up and you'll know if they are the sole issue or not.

Developer
Posts: 54
Registered: ‎12-22-2010
My Device: Not Specified

Re: AS3 animation slow/choppy

Yep. That did it. I removed all filters but a drop shadow and it's running smooth. It look much cleaner as the filters were also a bit distorted when rotated. I'll follow the link you posted tomorrow morning.

 

Thanks again!

Highlighted
Developer
Posts: 200
Registered: ‎03-10-2011
My Device: Not Specified

Re: AS3 animation slow/choppy

I have the same issue in the simulator, but I have no filters. I have 4 buttons that are tweened into the scene with the Caurina tweener. They were fine but now that I tweened their 3D rotation so that when they come in they rotate a little, it lags in the simulator. On my PC it runs with ease (AMD Athlon II x4 630). I assume this is just because of the simulator? There's nothing really complex going on, just using the basic 3D engine built into Flash. For normal QNX icon buttons.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: AS3 animation slow/choppy

I no longer make many assumptions about what's the fault of the simulator and what's not, and especially not about whether anything the simulator does is representative of the real hardware.

 

That said, we know the simulator doesn't have full OpenGL acceleration working, so presumably some cases of graphics performance issues are attributable to that and should be better on real hardware.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!