1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FlashVars

Posted at

FlashVarsを利用してFlashに値を渡す方法です。
ここではmyURL=http://weblogs.adobe.comをFlashに渡します。

flashvars.html
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="myflashvars" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="myflashvars.swf" />
<param name="FlashVars" value="myURL=http://weblogs.adobe.com/">
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="myflashvars.swf" FlashVars="myURL=http://weblogs.adobe.com/" quality="high" bgcolor="#ffffff" width="550" height="400" name="myflashvars" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_jp" />
</object>

<script type="text/javascript">
	//<!--
	var so = new SWFObject("myflashvars.swf", "myflashvars", "550", "400", "10", "#ffffff");
	so.addParam("FlashVars", "myURL=http://weblogs.adobe.com");
	so.write("myflashvars");
	//-->
</script>
flashvars.as
// ActionScript2.0の場合
trace(_level0.myURL);

// ActionScript3.0の場合
var flashVars:Object = this.loaderInfo.parameters;
trace(flashVars['myURL']);

この記事は、以前ブログで公開していた記事、内容を再編集したものです。
ActionScript 1.0/2.0/3.0とFlex 3の内容が中心です。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?