这个超简单的。因为太简单不好意思写。还是写吧。。。。
首先呢,在HTML模板里面添加一个JS函数:${application}实际上就是object那个flex的id,只不过呢,flex的模板文件里面用这个字符代替了。恩。你换成id也一样。
function sendToActionScript(value) {
alert(value+"http://www.dc9.cn");
document.getElementById("${application}").sendToActionScript(value);
}
然后类,在flex里面添加一个启动注册钩子函数:这个在application initial的时候执行,前面的参数是js的函数名,后面参数是flex的函数名。
ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
然后类,在flex里面加入这个函数
private function receivedFromJavaScript(value:String):void {
mx.controls.Alert.show("JavaScript says: " + value + "\n");
}
然后类,你随便找个什么玩意儿触发一下就可以啦:
<mx:Label click="ExternalInterface.call('sendToActionScript', 'http://www.dc9.cn');" text="http://www.dc9.cn" buttonMode="true" color="#CCCCCC"/>
就这样咯。刷牙去。我觉得flex从人性化程度上和易用性角度来看还是比silverlight好,唯一的缺点就是功能相同条件下size有点大.
另外,flex比sl的blend2设计人性很多!我用blend觉得怎么这么别扭呀!而且好多东西要自己下,最开始什么都没有。我晕。你集成一些usercontrol不就完了,我知道哪找去呀!还是flex好些。好用多了。
但是,我想实现的功能用mxml project实现比用as project更方便,可是mxml编译出来的体积很大.
我表达清楚了么有呀?
真乱。。
。。。
有几个问题没有弄明白。vbox,hbox,hdividebox,vdividebox,canvas都在什么场合用呀?
我乱用就乱了。。。
不知道有没有这方面的教学资料。
我现在全部用grid代替了。
看看人家vs2008就是做的好,我是指UI设计方面,人性化多了。这点比flex强多了。
说句公平话sl的发展不容小视。不过有一点sl的重大缺点我很不满意的就是,sl与ie结合太紧密,downloader下载个什么都在ie状态栏显示,还不能屏蔽。显示个鸟啊,显示不用你类~~
你的站不错啊,pr值都到5了,看起来你是下了不少功夫啊
Superbly illuminating data here, tnhaks!
DF9jCu pwqiozzwighb
3cuqqS , [url=http://iwtrmplfuddf.com/]iwtrmplfuddf[/url], [link=http://oknlorqtzxed.com/]oknlorqtzxed[/link], http://lahurcvfbjuy.com/
ZffPm1 itozlnvpyran
E6pGPM , [url=http://klxjhhtmowvf.com/]klxjhhtmowvf[/url], [link=http://wexjtryetidc.com/]wexjtryetidc[/link], http://mzldkllqifjv.com/
真是太简单了,我读了都不好意思了。;)
Thought it woludn’t to give it a shot. I was right.
Your website has to be the eecltrionc Swiss army knife for this topic.
JS里应该是receivedFromJavaScript()吧?
Perefct answer! That really gets to the heart of it!
Well put, sir, well put. I’ll cretnaliy make note of that.
I simply want to mention I am just all new to blogs and certainly savored this blog site. Almost certainly I’m going to bookmark your website . You really have great stories. Thanks a lot for revealing your blog site.
Many thanks for this article. I’d also like to express that it can always be hard if you find yourself in school and starting out to initiate a long credit standing. There are many learners who are just simply trying to make it through and have a long or positive credit history are often a difficult matter to have.