Skip to main content
Participant
April 2, 2012
Question

¿How i make a Browser Detect swf movie?

  • April 2, 2012
  • 1 reply
  • 1219 views

Hi, i use a simple embed swf movie in one of many pages i own, but recently I build a new page in html5. But i tested in Internet Explorer and doesnt work well. What i need its a script code in AS3 to use in my swf movie that detect the browser and if the browser its IE9 load an old page, but if its other browser is like mozilla or chrome, load  the new page in html5.

http://firefawx.webs.com/problem.jpg

It is possible to do that in AS3 right?

Thanks to all

Firefawx 

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 2, 2012

i think you want to detect the browser using javascript and use javascript to direct the browser to the html5 or flash page.

Participant
April 2, 2012

No, if that what i want i sure ask for that, dont you think? lol

I want a As3 code to put into my opening page that detect browser and take de choise it selft to load one page or another.

Something like this

If current is Internet explorer then load page 1

else load page 2

You understand me now?

Please help me ok?

Thankx

sinious
Legend
April 2, 2012

You should take kglads advice and not load flash unless you actually want to. JavaScript should be used to do that detection as you'll need it to do it via Flash anyhow.

Here's a tutorial on flash communicating via ExternalInterface with the browser to read its useragent string to determine what browser it is, nonetheless.

You can paste this in your browsers address bar to pop a dialog with what Flash is going to get back. This is just basic JavaScript. You could use what you see returned here easier than going through the hassle of ExternalInterface..

javascript:alert(window.navigator.userAgent.toString());