1.FlashVars(单向传递)
A.传递:在<embed 中设置 FlashVars=”name1=value1&name2=value2”
B.接受:在as中写入 var value1=application.parameters.name1 即可
2.HttpService
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
countriesService.send();
}
private function changeHandler(event:Event):void {
statesService.send();
}
]]>
</mx:Script>
<!-- 载入纯静态的xml数据 -->
<mx:HTTPService id="countriesService" url="http://www.rightactionscript.com/states/xml/countries.xml" />
<!-- 载入由php生成的xml数据 -->
<mx:HTTPService id="statesService" url="http://www.rightactionscript.com/states/xml/states.php">
<!-- 以下标签就是要发送到服务端的数据了,可以这样理解:有一个名为country的变量,它的值为花括号{}里的内容 -->
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:HTTPService>
<mx:VBox>
<!-- 此控件的数据由第一个<mx:HTTPService/>控件接收的内容提供,并且由这个ComboBox控制着第二个ComboBox所要显示的内容 -->
<mx:ComboBox id="country" dataProvider="{countriesService.lastResult.countries.country}"
change="changeHandler(event)" />
<!-- 下面的ComboBox已经绑定了{statesService.lastResult.states.state},随它的数据改变而改变 -->
<mx:ComboBox dataProvider="{statesService.lastResult.states.state}" />
</mx:VBox>
</mx:Application>
3.URLLoader
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private var _countriesService:URLLoader;
private var _statesService:URLLoader;
private function initializeHandler(event:Event):void {
_countriesService = new URLLoader();
_countriesService.addEventListener(Event.COMPLETE, countriesCompleteHandler);
_countriesService.load(new URLRequest("http://www.rightactionscript.com/states/xml/countries.xml"));
_statesService = new URLLoader();
_statesService.addEventListener(Event.COMPLETE, statesCompleteHandler);
XML.ignoreWhitespace = true;
}
private function countriesCompleteHandler(event:Event):void {
var xml:XML = new XML(_countriesService.data);
country.dataProvider = xml.children();
}
private function statesCompleteHandler(event:Event):void {
var xml:XML = new XML(_statesService.data);
state.dataProvider = xml.children();
}
private function changeHandler(event:Event):void {
var request:URLRequest = new URLRequest("http://www.rightactionscript.com/states/xml/states.php");
var parameters:URLVariables = new URLVariables();
parameters.country = country.value;
request.data = parameters;
_statesService.load(request);
}
]]>
</mx:Script>
<mx:VBox>
<mx:ComboBox id="country" change="changeHandler(event)" />
<mx:ComboBox id="state" />
</mx:VBox>
</mx:Application>
4.WebService方法1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
statesService.getCountries();
}
private function changeHandler(event:Event):void {
statesService.getStates(country.value);
}
]]>
</mx:Script>
<mx:WebService id="statesService"
wsdl="http://www.rightactionscript.com/states/webservice/StatesService.php?wsdl">
<mx:operation name="getCountries" />
<mx:operation name="getStates" />
</mx:WebService>
<mx:VBox>
<mx:ComboBox id="country"
dataProvider="{statesService.getCountries.lastResult}" change="changeHandler(event)" />
<mx:ComboBox dataProvider="{statesService.getStates.lastResult}" />
</mx:VBox>
</mx:Application>
5.WebService方法2
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
statesService.getCountries.send( );
}
private function changeHandler(event:Event):void {
statesService.getStates.send( );
}
]]>
</mx:Script>
<mx:WebService id="statesService" wsdl="http://www.rightactionscript.com/states/webservice/StatesService.php?wsdl">
<mx:operation name="getCountries" />
<mx:operation name="getStates">
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:VBox>
<mx:ComboBox id="country"
dataProvider="{statesService.getCountries.lastResult}" change="changeHandler(event)" />
<mx:ComboBox dataProvider="{statesService.getStates.lastResult}" />
</mx:VBox>
</mx:Application>
A.传递:在<embed 中设置 FlashVars=”name1=value1&name2=value2”
B.接受:在as中写入 var value1=application.parameters.name1 即可
2.HttpService
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
countriesService.send();
}
private function changeHandler(event:Event):void {
statesService.send();
}
]]>
</mx:Script>
<!-- 载入纯静态的xml数据 -->
<mx:HTTPService id="countriesService" url="http://www.rightactionscript.com/states/xml/countries.xml" />
<!-- 载入由php生成的xml数据 -->
<mx:HTTPService id="statesService" url="http://www.rightactionscript.com/states/xml/states.php">
<!-- 以下标签就是要发送到服务端的数据了,可以这样理解:有一个名为country的变量,它的值为花括号{}里的内容 -->
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:HTTPService>
<mx:VBox>
<!-- 此控件的数据由第一个<mx:HTTPService/>控件接收的内容提供,并且由这个ComboBox控制着第二个ComboBox所要显示的内容 -->
<mx:ComboBox id="country" dataProvider="{countriesService.lastResult.countries.country}"
change="changeHandler(event)" />
<!-- 下面的ComboBox已经绑定了{statesService.lastResult.states.state},随它的数据改变而改变 -->
<mx:ComboBox dataProvider="{statesService.lastResult.states.state}" />
</mx:VBox>
</mx:Application>
3.URLLoader
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private var _countriesService:URLLoader;
private var _statesService:URLLoader;
private function initializeHandler(event:Event):void {
_countriesService = new URLLoader();
_countriesService.addEventListener(Event.COMPLETE, countriesCompleteHandler);
_countriesService.load(new URLRequest("http://www.rightactionscript.com/states/xml/countries.xml"));
_statesService = new URLLoader();
_statesService.addEventListener(Event.COMPLETE, statesCompleteHandler);
XML.ignoreWhitespace = true;
}
private function countriesCompleteHandler(event:Event):void {
var xml:XML = new XML(_countriesService.data);
country.dataProvider = xml.children();
}
private function statesCompleteHandler(event:Event):void {
var xml:XML = new XML(_statesService.data);
state.dataProvider = xml.children();
}
private function changeHandler(event:Event):void {
var request:URLRequest = new URLRequest("http://www.rightactionscript.com/states/xml/states.php");
var parameters:URLVariables = new URLVariables();
parameters.country = country.value;
request.data = parameters;
_statesService.load(request);
}
]]>
</mx:Script>
<mx:VBox>
<mx:ComboBox id="country" change="changeHandler(event)" />
<mx:ComboBox id="state" />
</mx:VBox>
</mx:Application>
4.WebService方法1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
statesService.getCountries();
}
private function changeHandler(event:Event):void {
statesService.getStates(country.value);
}
]]>
</mx:Script>
<mx:WebService id="statesService"
wsdl="http://www.rightactionscript.com/states/webservice/StatesService.php?wsdl">
<mx:operation name="getCountries" />
<mx:operation name="getStates" />
</mx:WebService>
<mx:VBox>
<mx:ComboBox id="country"
dataProvider="{statesService.getCountries.lastResult}" change="changeHandler(event)" />
<mx:ComboBox dataProvider="{statesService.getStates.lastResult}" />
</mx:VBox>
</mx:Application>
5.WebService方法2
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
statesService.getCountries.send( );
}
private function changeHandler(event:Event):void {
statesService.getStates.send( );
}
]]>
</mx:Script>
<mx:WebService id="statesService" wsdl="http://www.rightactionscript.com/states/webservice/StatesService.php?wsdl">
<mx:operation name="getCountries" />
<mx:operation name="getStates">
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:VBox>
<mx:ComboBox id="country"
dataProvider="{statesService.getCountries.lastResult}" change="changeHandler(event)" />
<mx:ComboBox dataProvider="{statesService.getStates.lastResult}" />
</mx:VBox>
</mx:Application>
发表评论
-
消息拦截器(MessageInterceptors)
2010-11-02 16:20 1013public class DeleteItemIntercep ... -
arguments
2010-11-02 11:33 709arguments 对象 在将参数传递给某个函数时,可以使用 ... -
PropertyChangeEvent的应用
2010-11-02 11:14 1281private var object:Object = {}; ... -
js与flash的函数交互
2010-08-10 11:01 778flash使用的actionscript跟javascript ... -
as 传输游戏数据
2010-07-09 16:28 792AS3]利用ByteArray压缩游戏关卡数据 ByteArr ... -
Taobao Logo显示
2010-04-28 10:26 716今天看见淘宝的首页的logo居然是swf格式,然后觉得要是如果 ... -
cairngorm commands deal with lots of things
2010-03-30 14:16 656Yeah. As the best practice say ... -
关于安全认证的几点思路
2010-03-29 01:23 6941 php cookie , sig_str md5 (u ... -
compress images at client side
2010-03-28 02:55 8631. Allow user to browse for ima ... -
flash背景平铺
2010-03-25 00:58 985其实有很多方法实现,这里就按播放器的版本从低到高的实现方法来说 ... -
Socket通信学习资料
2009-11-27 12:33 1099Socket通信学习资料 什么是Socket?Socket协 ... -
CallLater简单解释
2009-11-18 17:11 1813目前FlashPlayer的运行机理是单线程模式,所以,在每一 ... -
Tweener _bezier 使用
2009-11-17 15:31 1221在做camera曲线运动的时候,发现新版的Tweener对_b ...
相关推荐
在这里我们只需要使用的是粗体标识的SetVariable方法,JS通过调用此方法能够直接更改SWF中的变量值。首先我们需要定义插入的SWF的 ID,例如id为VskyDemo,那么我们可以通过下面的JS语句来完成SWF内部变量的设置: ...
1.支持FlashVars调用html代码中的参数; 2.支持Flv/Mp4格式视频文件播放;...15.可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合; 16.代码简洁明了,界面美观,适合各类网站使用;
与操作系统剪贴板交互 23.12节.添加HTML内容 23.13节.在ActionScript和JavaScript之间跨脚本操作 23.14节.本地SQL数据库 23.15节.检测和监控网络连接 23.16节.检测用户是否在线 23.17节.创建系统托盘图标 第二十四章...
id: 控件标识 (与 js 交互时用以对应控件) url: 上传地址 jsobj: js 对象 (上传各阶段会调用 js 相应的方法 参考: events ) maxsize: 最大上传尺寸 (单位 Mbs, 默认: 20, 设置成 0 则不检测文件尺寸) name: 上传控件...
flash_images_FlashVars.rar,FLASH接收外部传入参数,QQ:292258449
flex3.6 动态改变图标的小树 可扩展参数 唯一不足 1,显示根节点会报错,可以通过xml修改 2,xml没有配成FlashVars参数,因为如果不用脚本,实现,最好用动态语言配合使用(jsp)
代码如下: 代码如下: function init() { if(swfobject.hasFlashPlayerVersion(“10”)){ var flashvars = {}; flashvars.xmlPath = “coffee”; flashvars.name = “coffee”; var params = {}; params.quality = ...
一款免费好用的Flash MP3网页播放器,支持MP3/flv音乐列表播放器功能: 1.支持FlashVars调用html代码中的参数; 2....可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合;
免费MP3/flv音乐列表播放器功能:1....8.可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合;9.代码简洁明了,界面美观,适合各类网站使用。(提示:请在IIS下或其它网站环境下测试)
1.支持FlashVars调用html代码中的参数; 2.支持Flv/Mp4格式视频文件播放;...15.可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合; 16.代码简洁明了,界面美观,适合各类网站使用;
1)新添了10 种背景特效和12种文本特效; 2)可以在指定循环次数后停止播放音频; 3)可以指定"字宽度" 与 "字高度" 参数; 4)用户可以选择是否对 Flash 影片进行保护以免被导入使用; 5)循环播放完成可以...
. 重写播放器基础架构; 2. 修改播放器双击全屏功能; 3.... 4. 支持自定义用户logo功能; 5.... 6....7. 新增配置文件功能,此功能将实现与asp,...16. 可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合
酷播迷你(CuPlayerMini)V2.2版[经典黑] (2012-08-22更新) 酷播迷你CuPlayerMiniV2.2功能...15.可以与动易、织梦、帝国等各类CMS系统结合,实现与此类CMS系统后台的融合; 16.代码简洁明了,界面美观,适合各类网站使用
前几天发表了 将FlashVars写在JS函数中,实现与后台的实时变量更新,但是仅支持 IE,随后与 Luckyer 进行了交流,发现用 SetVariable 可以很方便的实现多浏览器兼容。举例如下。
由外部参数flashvars指定数据源的文件位置或render链接,在源数据上加href和target属性来控制打开窗口,可自定义父节点和子节点图标,不设置采用系统默认,感兴趣的你可以了解下啊,或许对你有所帮助
在FLASH 9 时代,有一个通杀所有浏览器的js复制内容到剪贴板的方案:这个方案是一个最流行的方法: 著名的Clipboard Copy解决方案 利用一个clipboard.swf作为桥梁,复制内容到剪贴板。原理是:创建一个隐藏的flash...
var flashvars={ f:'http://img.ksbbs.com/asset/Mon_1605/0ec8cc80112a2d6.mp4', c:0, b:1, i:'http://www.ckplayer.com/static/images/cqdw.jpg' }; var params={bgcolor:'#FFF',allowFullScreen:true,...
调用方法 [removed][removed] [removed] var s1 = new SWFObject("player.swf","ply","328","200","9","#FFFFFF"); s1.addParam("allowfullscreen","true"); s1.addParam("allowscriptaccess","always"); s1....
12、提供更丰富的JS函数接口,用于更方便的处理AS与JS的交互,以及JS与AS的交互; 13、支持视频分享,支持微博分享(新浪微博/腾讯微博/百度收藏/人人网 分享),支持分享模式控制; 14、支持普通 / 高清视频...
使用方法:把代码添加到模板中,或者像我一样,放到广告代码中进行调用。注意修改swf文件和mp3文件路径。如需自动开始并循环播放,请添加代码 &autostart=1&autoreplay=1 ,如”mp3=...