我根本不知道Flash,但我猜想有一些事件可以在JavaScript中处理,表明Flash对象已加载。例如,在Silverlight中,您可以提供一个JavaScript“回调”,该回调在加载Silverlight控件后调用。
下面是我的blog中的一些代码,它显示了我在Silverlight中的含义,希望您可以将其转换为Flash版本。
1-给在所述网页中的元素的ID
2-通过,Silverlight应用程序分配的JavaScript函数将集中于应用在浏览器中“的onLoad”参数。
<object id="silverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/DragSnapDemo.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="onLoad" value="silverlightControlHost_Load" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
3-最后写在Silverlight应用程序已经被加载
function silverlightControlHost_Load(sender, args)
{
var control = document.getElementById("silverlightControl");
control.focus();
}
更新时调用的JavaScript函数:找到以下链接可能会有所帮助
http://kb2.adobe.com/cps/155/tn_15586.html
http://www.actionscript.org/forums/archive/index.php3/t-120307.html
感谢您的回复,我可能没有提供足够的细节。 Flash对象不在网页上。直接在WebBrowser控件上设置SWF的URL。这就是说我可以使用InvokeScript来编写一些JavaScript。其次,将焦点设置为Flash对象似乎不够。我需要将注意力集中到Flash中的一个元素上,而我无法实现这一点。 Flash SWF文件是第三方,不在我们的控制范围之内。 – Phill 2010-07-06 09:14:00
@Phill,对不起,我不能提供任何信息,因为我说我不知道闪光灯,我只是希望SL信息可以帮助你在正确的方向。 – 2010-07-06 16:22:11