8/25/2010 3:47:15 AM
Title:
How to get flashvar value in AS3
Here is my HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>socnhimusic</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #009933;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1000" height="1000" id="socnhimusic" align="middle">
<param name="movie" value="socnhimusic.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#009933" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="flashvars" value="id=327" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="socnhimusic.swf" width="1000" height="1000">
<param name="movie" value="socnhimusic.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#009933" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="flashvars" value="id=327"
/>
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
I want to get the id value by AS3, Please help me.
8/25/2010 3:58:33 AM
to read flashvars you can use LoaderInfo Object ,
create a method
//this method returns the Object
private function readFlashVars():Object {
return Object( LoaderInfo( this.loaderInfo ).parameters );
}
//to read "Id" varibale in your case use
var myId = readFlashVars().id;