Tuesday, July 8, 2008

Flash Bugs/Differences per Browser

One thing I learned during the Transitions project is that Flash files do not act the same way in every browser. Working with differences between browsers is one of the most aggravating things in the web development world, at least in my opinion. If you are not careful, you can develop/test an entire project in Firefox and when you go to deploy the night before the deadline you find out that IE craps out... or vice versus. It is awesome.

For the longest time I thought Flash was safe from these types of things since it runs in its own environment. Sure I noticed that reloads might take a second or two longer in one browser versus the other, or that you may need to use swfObject to get around the ActiveX gobblygook in IE. But I never thought Flash contained show stopping differences dependent on browsers... I thought those differences were saved only for the CSS and Javascript gurus of the world.

I was wrong... I ran into 2 show stoppers that raised their ugly heads right before deployment.

Ugly Head #1:
I was preloading by using a small index.swf and loading a large content.swf. Nothing fancy or high tech, but it worked for what I wanted. The user answers some intro questions in the index.swf while the bulk is loading in the background.

I used a loader and listened for the ProgressEvent and displayed the current percent loaded. Safari/Firefox worked like a charm. In IE, however, the ProgressEvent.bytesTotal comes back as 0 so the percentage loaded is Infinite. From what I researched it only happens in IE when loading another SWF file. Thats awesome. I ended up hacking around it. If anyone knows a clean fix, please let me know.

In our next project I am using the more traditional way of just having one swf and having clips/classes load on a certain frame and listening to the loaderInfo. Here is my current source that I plan on using as the base for upcoming projects.

Ugly Head #2:
Printing a swf that is embedded in an HTML page works perfectly in IE but shows up blank in Firefox. We eventually just had Flash encode the jpg and send the byteArray to the backend and have the backend display the jpg instead of the swf. Anyone know of any other work arounds?


Anyone else have any ugly heads they would like to share/vent about? Plus work-a-rounds... if possible.

5 comments:

Anonymous said...

Yep, noticed that too.

For example I am loading some images from an xml into a flash As 3.0 flash gallery and using some tweens as intro animation .. well .. in firefox the tweens mess up the gallery and the images don't appear anymore. No workaround for this.

Also trying to load something that isn't there .. completely crashes the browser now (Ie /firefox) not safari for unknown reasons.

I am really scared of this different behavior problem .. I hoped to dodge the "TEST IT IN ALL BROWSERS" mayhem.

Ickydime said...

Curious... what tween engine are you using?

Definitely agree about dodging the test in all browsers... brutal.

outsource seo said...
This comment has been removed by a blog administrator.
seo reseller said...

Flash isnt recommended on most business website. one reason is browser compatibility other one is connection speed you need a fast connection to execute flash well on your computer third is not all mobile phones run with flash.

Anonymous said...

this is common problem that all of us web designers face when testing our designed website on different browsers. Our Website Development Portfolioshow only those sites that are running fine on all browser and we have few of them