Flex与Javascript互相通信
Flex与Javascript互相通信。
在Flex中有这么一个类:ExternalInterface.在这个类中它给我们:call和addCallback
Flex中As调用Js的方法是:
1、导入包 (import flash.external.ExternalInterface;)
2、使用ExternalInterface.call("Js函数名称",参数)进行调用,其返回的值就是Js函数所返回的值
Js调用As的方法是:
1、导入包 (import flash.external.ExternalInterface;)
2、在initApp中使用ExternalInterface.addCallback("用于Js调用的函数名",As中的函数名)进行注册下
3、js中 就可以用document.getElementById("Flas在Html中的ID").注册时设置的函数名(参数)进行调用.
相关文档:
flex项目和组件等
open-source project : Flex
Adobe APIs
主要包含corelib, mappr, flickr, youtube及加密等类库.
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries
as3awss3lib
与 Amazon S3 交互的 ActionScript 3.0 类库
http://code.google.com/p/as3 ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Panel width="382" height="277" layout="absolute">
......
<!-- -->
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:宋体;
panose-1:2 ......
package org.openscales.core.format
{
import flash.utils.getQualifiedClassName;
import flash.xml.XMLNode;
import org.openscales.core.Util;
import org.openscales.core.feature.Feature;
import org.openscales.core.geometry.Collection;
import org.openscales.core. ......