admin管理员组文章数量:1336576
I am trying to run a jQuery function on my HTML page from AS3.
This is my jQuery function:
function loadImage(imageNumber)
{
imageURL = '<img src="images/image' + imageNumber + '.jpg">';
$("#imageBox").html(imageURL);
}
Here are the settings of my flash file in the HTML page:
<param name="allowScriptAccess" value="always" />
<param name="bgcolor" value="#ffffff" />
<embed src="links.swf" quality="high" bgcolor="#ffffff" width="320" height="242" name="links" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="" />
and finally... here is the AS3 script in my .swf file:
function gotoImage1(e:MouseEvent):void {
var jsmand:String = "loadImage(1);"
var link:URLRequest = new URLRequest("javascript:" + jsmand + "");
navigateToURL(link, '_self');
}
Thankyou in advance for taking the time to look and any help is massively appreciated.
Kindest Regards.Tom
I am trying to run a jQuery function on my HTML page from AS3.
This is my jQuery function:
function loadImage(imageNumber)
{
imageURL = '<img src="images/image' + imageNumber + '.jpg">';
$("#imageBox").html(imageURL);
}
Here are the settings of my flash file in the HTML page:
<param name="allowScriptAccess" value="always" />
<param name="bgcolor" value="#ffffff" />
<embed src="links.swf" quality="high" bgcolor="#ffffff" width="320" height="242" name="links" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe./go/getflashplayer" />
and finally... here is the AS3 script in my .swf file:
function gotoImage1(e:MouseEvent):void {
var jsmand:String = "loadImage(1);"
var link:URLRequest = new URLRequest("javascript:" + jsmand + "");
navigateToURL(link, '_self');
}
Thankyou in advance for taking the time to look and any help is massively appreciated.
Kindest Regards.Tom
Share Improve this question asked Apr 10, 2009 at 21:00 TischTisch 2,6474 gold badges28 silver badges34 bronze badges2 Answers
Reset to default 6You can use ExternalInterface
instead:
if (ExternalInterface.available) {
ExternalInterface.call('function(){ alert("test"); }');
}
Documentation: http://livedocs.adobe./flex/3/langref/flash/external/ExternalInterface.html
The final solution was:
function gotoImage2(e:MouseEvent):void
{
if(ExternalInterface.available)
{
ExternalInterface.call('function(){ loadImage(2); }');
}
}
Just in case anyone wanted to see how it ended...
本文标签: javascriptHow can I run a jQuery function using AS3Stack Overflow
版权声明:本文标题:javascript - How can I run a jQuery function using AS3 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742411835a2469942.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论