从 javascript/jquery 调用 AS 函数
使用jquery,JS我们可以在flex代码中调用一个函数。下面是我有一个调用AS代码的按钮。如果可以的话,可以这样做吗?
<script>
function callas()
{
addBody();//call flex function
}
</script>
<input type="button" onclick="callas();" />
FLEX 代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它应该是这样的:
Javascript
Actionscript / flex
来源:
http://kb2.adobe.com/cps/156/tn_15683.html
http://code.google.com/p/swfobject/wiki/documentation#How_can_you_configure_your_Flash_content ?
It should be something like this:
Javascript
Actionscript / flex
sources:
http://kb2.adobe.com/cps/156/tn_15683.html
http://code.google.com/p/swfobject/wiki/documentation#How_can_you_configure_your_Flash_content?
您需要利用名为
ExternalInterface
的 Actionscript 类来与 Javascript 交互。因此,如果您想从 Flex 或 Flash 调用 Javascript 函数,那么您应该使用类似以下内容:
如果您想从 Javascript 调用 Actionscript,请尝试以下操作:
You need to utilize an Actionscript class named
ExternalInterface
to interact with Javascript.So, if you'd like to call a Javascript function from Flex or Flash, then you should use something like this:
Should you want to call Actionscript from Javascript, try the following: