AS3 ExternalInterface的电话使用jQuery

编程入门 行业动态 更新时间:2024-10-19 23:24:30
本文介绍了AS3 ExternalInterface的电话使用jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我打电话到嵌入在使用ExternalInterface一个HTML页面中的Flash应用程序。 下面code正常工作(我用一个按钮来测试):

$(文件)。就绪(函数(){     $(#键)。点击(函数(){         VAR应用=的document.getElementById('的applicationID)         console.debug(表观)         app.pageUnloading()     }) })

所以这个调用到Flash应用程序精细和打印:

<嵌入ID =的applicationIDWIDTH =600HEIGHT =400ALIGN =中间类型=应用程序/ x-冲击波闪光PLUGINSPAGE =HTTP ://www.adobe/go/getflashplayer的allowScriptAccess =导航特殊NAME =FlexMoedersBGCOLOR =#CCCCCC品质=高SRC =ApplicationID.swf>

但是,当我使用由ID获取元素的jQuery的$#方法,我收到了不同的对象返回:

$(文件)。就绪(函数(){     $(#键)。点击(函数(){         VAR应用= $(#的applicationID)         console.debug(表观)         app.pageUnloading()     }) })

当我用这个告诉我:

app.pageUnloaded不是一个函数

和以下被打印

[嵌入#的applicationID]

我也曾尝试:

VAR应用= $(#的applicationID)。VAL() VAR应用= $(#的applicationID)。得到(0)

但仍然没有成功。没有人有任何想法在这里?

解决方案

VAR应用= $('#的applicationID')[0]

VAR应用= $('#的applicationID)。得到(0)

应该做同样的事情,

VAR应用=的document.getElementById('的applicationID)

I'm calling into a flash app embedded in a html page using the ExternalInterface. The following code works fine (I'm using a button to test):

$(document).ready(function(){ $("#button").click(function(){ var app = document.getElementById('ApplicationID') console.debug(app) app.pageUnloading() }) })

So this calls into the flash app fine and prints:

<embed id="ApplicationID" width="600" height="400" align="middle" type="application/x-shockwave-flash" pluginspage="www.adobe/go/getflashplayer" allowscriptaccess="sameDomain" name="FlexMoeders" bgcolor="#cccccc" quality="high" src="ApplicationID.swf">

But when I use the jquery $# method of getting an element by id, I receive a different object back:

$(document).ready(function(){ $("#button").click(function(){ var app = $("#ApplicationID") console.debug(app) app.pageUnloading() }) })

When I use this I'm told:

app.pageUnloaded is not a function

and the following is printed:

[embed#ApplicationID]

I have also tried:

var app = $("#ApplicationID").val() var app = $("#ApplicationID").get(0)

But still no success. Does anyone have any ideas here?

解决方案

var app = $('#ApplicationID')[0]

or

var app = $('#ApplicationID').get(0)

should do the same thing as

var app = document.getElementById('ApplicationID')

更多推荐

AS3 ExternalInterface的电话使用jQuery

本文发布于:2023-11-23 16:00:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622050.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电话   ExternalInterface   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!