FABridge教程(Flex+Ajax) 2
首先在fademo.mxml中声明一个button,并添加一个btnClick方法:
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="0" minHeight="0" width="400" height="300" xmlns:bridge="bridge.*">
<fx:Declarations>
<bridge:FABridge/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<!--[CDATA[
import mx.controls.Alert;
public function btnClick():void
{
Alert.show("按钮被点击了","title");
}
]]-->
</fx:Script>
<s:TextInput x="160" y="96" id="txtName"/>
<s:Button x="218" y="139" label="按钮" id="btn"/>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://n
相关文档:
Flex事件机制是观察者模式,即首先要注册事件,事件分发后通过事件响应函数进行处理。
例如在AS3中:
button.addEventListener(“click”,onClick);//向button注册一个click事件
internal function onClick(evt:MouseEvent):void{txt.text=“click a button!”;}//事件响应函数 那么注册事件注册什么呢?通 ......
have been studying parsing JSON from PHP using AJAX to display it in
the client side and jQuery had been a great help to me. Here is a very
simple code in parsing JSON using jQuery that i made.
tablejsondata.php
This file makes the request to a php file and displays the returned data into a tabl ......
由于avm版本的问题,flex3无法直接调用flash做的swf文件,弄了一天,最后终于想到了一个办法,将LocalConnect和flex调用as3两种方式攒在了一起,算是暂时把这个问题解决了!
存起来,留着以后修改
第一步:用flash做一个as2的文件
我在里面添加了一个按钮
在第一帧写下面的代码
mybtn.onRelease=function()
{
......
作为一个不入流的flex开发人员总结一下不入流的感悟。
我一定要记住,as中的变量的作用范围只有两种,function和class,所以要想用闭包就需要一个createFunction的东西才行,不要妄想在for循环中用闭包了。看了一下as3的参考,发现它的前世和lua还真像,as3的继承其实还是prototype来做的,就是lua的元表了, ......
一、JSON 是什么?
JSON 的全称是JavaScript Object Notation,是一种轻量级的数据交换格式。
JSON 与XML 具有相同的特性,例如易于人编写和阅读,易于机器生成和解析。但是JSON 比
XML 数据传输的有效性要高出很多。JSON 完全独立与编程语言,使用文本格式保存。
JSON 数据有两种结构:
• Name-Value 对构成的集 ......