Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining id attribute of own Flash element from Flash

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?

like image 238
Jeremy Avatar asked Oct 24 '12 18:10

Jeremy


2 Answers

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

like image 82
Emin A. Alekperov Avatar answered Sep 21 '22 10:09

Emin A. Alekperov


you can use SWFObject to pass a var into the flash to tell it what the ID is when you load it.

swfobject.embedSWF('application.swf', '100%', '100%', null, {'id': '_id_goes_here_'}, null);
like image 21
Boyd Avatar answered Sep 20 '22 10:09

Boyd