How to detect if the movie is a projector or inside a web page

I found myself with this problem:

How to detect if the movie is a projector or inside a web page.

Does anyone have a clue?

Thank you!

The solutions is not perfect but I noticed that when movie runs inside html file, the _url string is allways unescaped. When it runs as a projector, or simply in flash player, the path is escaped.

file:///D|/Work/detect/release%5Fdetect.swf swf played inside Flash player
file:///D|/Work/detect/release%5Fdetect.exe

file://D:\Work\detect\release_detect.swf webpage from disk
http://mydomain/detect/release_detect.swf webpage from domain

This was for simple AS inside .fla file

The following is for AS 2.0 classes:

file:///D|/Work/detect/detect.exe .exe projector
file:///D|/Work/detect/detect.swf swf played inside Flash player
file:///D|/Work/detect/detect.swf from authoring

file://D:\Work\detect\detect.swf webpage from disk
http://mydomain/detect/detect.swf webpage from domain

Diferences are 3 (/// instead of //, | instead of :, / instead of )
The only reliable one is /// instead of //

I surely would preffer a cleaner solution, for detecting exe/swf-authoring/web, but this will do.

Thank you again!

You’re welcome!