| 1 |
import flash.events.*; |
|---|
| 2 |
import mx.events.*; |
|---|
| 3 |
import mx.collections.ArrayCollection; |
|---|
| 4 |
import flash.net.*; |
|---|
| 5 |
|
|---|
| 6 |
private function bCalculator_clickEvent(event:MouseEvent):void { |
|---|
| 7 |
var r:Function = function(res:Object):void { |
|---|
| 8 |
tAnswer.text = String(res); |
|---|
| 9 |
} |
|---|
| 10 |
if (nc != null) |
|---|
| 11 |
nc.call('CalculatorService.add', new Responder(r, null), parseInt(tN1.text), parseInt(tN2.text)); |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
| 14 |
[Bindable] |
|---|
| 15 |
private var dgQuery_data:ArrayCollection = new ArrayCollection(); |
|---|
| 16 |
|
|---|
| 17 |
private function bQuery_clickEvent(event:MouseEvent):void { |
|---|
| 18 |
var r:Function = function(res:Object):void { |
|---|
| 19 |
for each(var p:Object in res) { |
|---|
| 20 |
dgQuery_data.addItem(p); |
|---|
| 21 |
} |
|---|
| 22 |
} |
|---|
| 23 |
|
|---|
| 24 |
var query:Object = {limit: 5, nameLen: 3, minAge: 30, maxAge: 40}; |
|---|
| 25 |
nc.call('QueryService.getPeopleList', new Responder(r, null), query); |
|---|
| 26 |
} |
|---|
| 27 |
|
|---|
| 28 |
private var nc:NetConnection = null; |
|---|
| 29 |
|
|---|
| 30 |
private function init():void { |
|---|
| 31 |
addEventListener(Event.CLOSING, application_closingEvent); |
|---|
| 32 |
try { |
|---|
| 33 |
nc = new NetConnection(); |
|---|
| 34 |
nc.connect('http://localhost/~daoki/amf.abx'); |
|---|
| 35 |
} catch (err:Error) { |
|---|
| 36 |
trace(err.message); |
|---|
| 37 |
} |
|---|
| 38 |
} |
|---|
| 39 |
|
|---|
| 40 |
private function application_closingEvent(event:Event):void { |
|---|
| 41 |
nc.close(); |
|---|
| 42 |
} |
|---|