<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>刘钢的博客 - 我是UED &#187; swf</title>
	<atom:link href="http://www.iamued.com/tag/swf/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iamued.com</link>
	<description>http://www.IamUED.com</description>
	<lastBuildDate>Wed, 18 Jan 2012 02:51:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>JavaScript控制flash操作 兼容IE FF</title>
		<link>http://www.iamued.com/qianduan/611.html</link>
		<comments>http://www.iamued.com/qianduan/611.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 01:53:57 +0000</pubDate>
		<dc:creator>RichieLiu</dc:creator>
				<category><![CDATA[JavaScript脚本]]></category>
		<category><![CDATA[前端开发]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://www.iamued.com/?p=611</guid>
		<description><![CDATA[Flash INTERACTION WITH JAVASCRIPT 今天开发富媒体广告遇到的问题 用JS控制flash 只在IE平台下有效 费尽周折才找到兼容的解决方案 方法如下： 翻译自：http://www.permadi.com/tutorial/flashjscommand/index.html 查看Demo http://www.iamued.com/demo/flashjs/ 重点在于 object的id属性 和 EMBED 的name属性 swliveconnect=”true” 属性 通过js获取flash对象的方法兼容表如下 通过上图得到JavaScript方法来获取flash对象 兼容多浏览器 获取到flash对象可以利用相关方法进行操作   播放：: Play() 停止: StopPlay() 停止并回到首帧: Rewind() 下一帧: TGetProperty(nameOfTargetMovieClip, propertyIndex) and GotoFrame(frameNum) 方大或缩小: Zoom(relative percentage) 发送数据: SetVariable(variableName, variableValue) 读取数据: GetVariable(variableName) 查看Demo http://www.iamued.com/demo/flashjs/]]></description>
			<content:encoded><![CDATA[<p>Flash INTERACTION WITH JAVASCRIPT<br />
今天开发富媒体广告遇到的问题 用JS控制flash 只在IE平台下有效 费尽周折才找到兼容的解决方案<br />
方法如下：<br />
翻译自：http://www.permadi.com/tutorial/flashjscommand/index.html<br />
<a href="http://www.iamued.com/demo/flashjs/">查看Demo http://www.iamued.com/demo/flashjs/</a><br />
重点在于 object的id属性 和 EMBED 的name属性 swliveconnect=”true” 属性</p>
<pre class="brush: xml; title: ; notranslate">
&lt;OBJECT classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot;http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot;
  WIDTH=&quot;150&quot; HEIGHT=&quot;75&quot; id=&quot;simplemovie&quot; ALIGN=&quot;&quot;&gt;
  &lt;PARAM NAME=movie VALUE=&quot;simplemovie.swf&quot;&gt;
  &lt;PARAM NAME=quality VALUE=medium&gt;
  &lt;PARAM NAME=bgcolor VALUE=#FFFFFF&gt;
  &lt;EMBED src=&quot;simplemovie.swf&quot;
    quality=medium
    swliveconnect=&quot;true&quot;
    bgcolor=#FFFFFF WIDTH=&quot;150&quot; HEIGHT=&quot;75&quot;
    name=&quot;simplemovie&quot;
    ALIGN=&quot;&quot;
    TYPE=&quot;application/x-shockwave-flash&quot;
    PLUGINSPAGE=&quot;http://www.macromedia.com/go/getflashplayer&quot;&gt;
  &lt;/EMBED&gt;
&lt;/OBJECT&gt;
</pre>
<p>通过js获取flash对象的方法兼容表如下<br />
<span id="more-611"></span><br />
<img src="http://iamued-wordpress.stor.sinaapp.com/uploads/2009/11/flashjr.jpg" alt="" width="597" height="387" /></p>
<p>通过上图得到JavaScript方法来获取flash对象 兼容多浏览器</p>
<pre class="brush: jscript; title: ; notranslate"> function getFlashMovieObject(movieName)
{
  if (window.document[movieName])
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf(&quot;Microsoft Internet&quot;)==-1)
  {
    if (document.embeds &amp;&amp; document.embeds[movieName])
      return document.embeds[movieName];
  }
  else // if (navigator.appName.indexOf(&quot;Microsoft Internet&quot;)!=-1)
  {
    return document.getElementById(movieName);
  }
}
</pre>
<p>获取到flash对象可以利用相关方法进行操作</p>
<p> </p>
<li>播放：: <strong>Play()</strong></li>
<li>停止: <strong>StopPlay()</strong></li>
<li>停止并回到首帧: <strong>Rewind()</strong></li>
<li>下一帧: <strong>TGetProperty(nameOfTargetMovieClip, propertyIndex) </strong>and<strong> GotoFrame(frameNum)</strong></li>
<li>方大或缩小: <strong>Zoom(relative percentage)</strong></li>
<li>发送数据: <strong>SetVariable(variableName, variableValue)</strong></li>
<li>读取数据: <strong>GetVariable(variableName)</strong></li>
<p><a href="http://www.iamued.com/demo/flashjs/">查看Demo http://www.iamued.com/demo/flashjs/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamued.com/qianduan/611.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

