/    Sign up×
Community /Pin to ProfileBookmark

GetElementByID of Flash Published SWF

I published a SWF file to an html file using Flash, but I can’t find the SWF’s ID to use the document.getElementByID() to use JS to interact with the SWF. I’ve tried getelementbyname but I’m lost.

Here’s the one line of code I’m trying to use to interact with the SWF:

<input type=”button” onclick=”document.getElementByName(‘movie’).togglePlayback()” value=”click me” />

and here’s the body code that comes with publishing a swf

<script language=”JavaScript” type=”text/javascript”>
AC_FL_RunContent(
‘codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0‘,
‘width’, ‘550’,
‘height’, ‘400’,
‘src’, ‘External Interface’,
‘quality’, ‘high’,
‘pluginspage’, ‘http://www.adobe.com/go/getflashplayer‘,
‘align’, ‘middle’,
‘play’, ‘true’,
‘loop’, ‘true’,
‘scale’, ‘showall’,
‘wmode’, ‘window’,
‘devicefont’, ‘false’,
‘id’, ‘example’,
‘bgcolor’, ‘#999999’,
‘name’, ‘movie’,
‘menu’, ‘true’,
‘allowFullScreen’, ‘false’,
‘allowScriptAccess’,’always’,
‘movie’, ‘External Interface’,
‘salign’, ”
); //end AC code

</script>
<noscript>
<object classid=”example” codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0” name=”movie” width=”550″ height=”400″ align=”middle” id=”example”>
<param name=”allowScriptAccess” value=”sameDomain” />
<param name=”allowFullScreen” value=”false” />
<param name=”movie” value=”External Interface.swf” /><param name=”quality” value=”high” /><param name=”bgcolor” value=”#999999″ /> <embed src=”External Interface.swf” quality=”high” bgcolor=”#999999″ width=”550″ height=”400″ name=”movie” align=”middle” allowScriptAccess=”always” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.adobe.com/go/getflashplayer” />
</object>

There’s also an additional JS file that’s linked to the page, but I don’t think it has to do with the SWF’s ID. I just want to know what to change or add so I can interact with the damn SWF

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Marius_MiliunasauthorMay 08.2010 — searched adobe live docs, and used their html form to upload the SWF, so all's well now
×

Success!

Help @Marius_Miliunas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...