views:

49

answers:

2

Hi Guys,

I'm developing a site which has a flash background playing a small video loop scaled to fill the whole background. Over the top I have a number of HTML elements which are animated using javascript. The problem I am having is that (predominantly in FF, but also in others to a lesser degree) the flash seems to be causing my javascript animations to run rather jerky, and in some cases missing the animation altogether and just jumping to the end state.

Does anybody have any thoughts on how to make the 2 work together nicely?

Many thanks

Matt

+1  A: 

You'll notice the same effect on BBC Iplayer - if you've played a few videos, then use the left and right scroller. The javascript animation is no longer smooth.

The is more noticeable in FF.

Chrome creates an entirely separate process for the flash, and therefore smoother, Safari is quite lightweight therefore smoother at times.

Bit of a bugger really - the only thing I can suggest is ensure your swf is optimised for CPU - if it contains lots of code, ensure you doing good memory management.

I had the same trouble once and I targeted FP10 - this offset a lot of visual work off the CPU (therefore the current process in the browser) and gave it to the GPU.

--

Aside from this, you're pretty much at the mercy of how powerful the clients machine is.

Glycerine
Thanks Glycerine. Do you think there would be any performance improvements if it was compressed into an older format? Or even just a SWF? There is no audio, so it's just an animated background really.
Matt Brailsford
A: 

Additional for my answer above:

Thanks Glycerine. Do you think there would be any performance improvements if it was compressed into an older format? Or even just a SWF? There is no audio, so it's just an animated background really. – - Matt Brailsford

I think a newer format would be better - if you can do FP10, then again, you'll be able to utilise the user GPU, if your working in CS3, best to go for FP9.5.

Ensure your stage objects are cached for bitmap if your using large vectors http://www.adobe.com/devnet/flash/articles/bitmap_caching_print.html

This ensures any heavy animation (even animation we regard as light) will run smoother because there turned into pixel data as opposed to complicated vector information. Its a small fix but it may work.

Try and target the AS3 engine as well. Even if your not using code. I keep saying it runs better than the as2, as1 engine with arguments from people but I'm sure you'll find your favourite camp.

If you have very large images scaled down, use a smaller form factor by photoshoping then to a smaller size. This will not only improve rendering speeds, but also swf file size.

Try those.

Glycerine
Awesome, cheers Glycerine. I'll give some of these a shot. There is actualy very little in my flash file, as it is purley just a video background, everything else is in HTML. I'll try targeting AS3 though, as it's currently AS2 using a Video object.
Matt Brailsford
Dang! no luck. Rewritten for AS3 with hardware acceleration enabled and its stil jerky. Guess it's going to be a case of one or the other.
Matt Brailsford
did you cacheAsBitmap? got a url?
Glycerine
Can you cacheAsBitmap with a video? Do you have an email address? Can't make the URL puplicly available yet.
Matt Brailsford
Ooh Course Video - [slaps head] - ye, I'll PM my email for you. You can PM on here right? - Messaged through your website.
Glycerine