Determining id attribute of own Flash element from Flash

actionscript-3, flash

Solution

You can use the `objectID` property of the `flash.external.ExternalInterface` class.

Problem

I have a Flash application written in ActionScript 3 embedded in a web page using SWFObject 2.0. After it has been loaded, the Flash application will be running in an `<object>` or `<embed>` tag with an `id` attribute. How can I determine the value of the `id` attribute of the element from inside the Flash application?

Original source