M.CORP Grandmaster Cheater Supreme
Reputation: 28
Joined: 28 Oct 2009 Posts: 1010
|
Posted: Mon Sep 17, 2012 2:08 am Post subject: [Solved]Javascript Question |
|
|
How do I get the movie parameter of an swf object on an HTML page by only using javascript?
HTML with flash object example:
(taken from http://armorgames.com/play/13852/planet-juicer)
| Code: | <div id="gamefilearea">
<object id="gamefile" width="640" height="480" align="middle" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param value="/files/games/planet-juicer-13852.swf" name="movie">
<param value="high" name="quality">
<param value="window" name="wmode">
<param value="false" name="allowfullscreen">
<param value="false" name="allowfullscreeninteractive">
<param value="" name="flashvars">
<embed width="640" height="480" align="middle" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="" allowfullscreeninteractive="false" allowfullscreen="false" wmode="window" name="gamefile" quality="high" src="/files/games/planet-juicer-13852.swf">
</object>
</div> |
I've been trying my own JS code, but it always returns "undefined":
| Code: | function getMovie(movieName){
var embed = document.getElementsByTagName("embed");
return embed.movie;
} |
Thanks
Edit:
I just needed to change "return embed.movie" into "return embed.src"
_________________
|
|