Closed GoogleCodeExporter closed 9 years ago
The same goes for ExternalInterface.objectID
Original comment by tucker...@gmail.com
on 17 Aug 2010 at 8:19
From the action script docs for flash.external.ExternalInterface:
objectID : String
[static] [read-only] Returns the id attribute of the object tag in Internet
Explorer, or the name attribute of the embed tag in Netscape.
Original comment by tucker...@gmail.com
on 30 Aug 2010 at 2:45
After playing with the object element some more I found that if you put a name
attribute in the object element for Firefox, objectID and id work as expected.
Original comment by tucker...@gmail.com
on 13 Sep 2010 at 10:59
Adding the name attribute worked in Firefox and Chrome, but not in Safari. To
get it to work in Safari, I added an embed tag with just the name attribute:
I did this using the callback in swfobject:
swfobject.embedSWF(
... all other params ...,
// callback
function (e) {
if (e.success) {
var flash = $(e.ref);
// mozilla and webkit
if ($.browser.webkit || $.browser.mozilla) {
// add name attribute
flash.attr('name', e.id);
}
if ($.browser.webkit) {
// add embed element
flash.append('<embed name=" + e.id + " />');
}
}
}
);
Original comment by JNSal...@gmail.com
on 20 Jan 2011 at 5:59
Guys, did you try adding the id/name properties using the attributes object as
per the docs in swfobject? This will add the id and name attributes in the
<object> tag which is required for ExternalInterface etc
<script type="text/javascript">
var flashvars = {
name1: "hello",
name2: "world",
name3: "foobar"
};
var params = {
menu: "false"
};
var attributes = {
id: "myDynamicContent",
name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120",
"9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
SWFObject never generates an <embed> tag...
Original comment by aran.rhee@gmail.com
on 20 Jan 2011 at 4:14
Yes that is what I ended up doing.
Original comment by tucker...@gmail.com
on 21 Jan 2011 at 2:09
I'm closing this issue then
Original comment by aran.rhee@gmail.com
on 21 Jan 2011 at 4:44
Original issue reported on code.google.com by
tucker...@gmail.com
on 17 Aug 2010 at 7:42