accessing public variables


i have following code , not getting correct value. can see trying do. questions let me know. thanks.

<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationcomplete="load_list()">

<mx:script>
<![cdata[
import mx.controls.alert;
import mx.collections.arraycollection;
import mx.rpc.events.resultevent;

[bindable]
public var material1_id: int;

public function load_list():void{
material1_id = 0;
}

public function addrec():void{
alert.show('value before' + material1_id.tostring());
insertservice.addmaterial('123'); // calls webservice , returns query
alert.show('value after' + material1_id.tostring());
}

public function addmaterial(event:resultevent):void{
material1_id = 9;
}
]]>
</mx:script>

<mx:remoteobject
id ="insertservice"
destination="coldfusion"
source ="insert"
>
<mx:method name="addmaterial" result="addmaterial(event)" >
</mx:remoteobject>

</mx:application>

i'm not sure 100% trying do... how send data cfc. when addmaterial function gets invoked can display data. ran query in cfc , returned data array. easier me. edited code , commented date , notes. let me know if helps any:
re_looking @ code... returntype of cfc?

<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationcomplete="load_list()">

<mx:script>
<![cdata[
import mx.controls.alert;
import mx.collections.arraycollection;
import mx.rpc.events.resultevent;

[bindable]
public var material1_id: int;

public function load_list():void{
//material1_id = 0;

//run remote object , call function
insertservice.addmaterial(); // can send data function this. insertservice.addmaterial("dog") added 1/3/07
}

public function addrec():void{
alert.show('value before' + material1_id.tostring());
insertservice.addmaterial('123'); // calls webservice , returns query
alert.show('value after' + material1_id.tostring());
}

public function addmaterial(event:resultevent):void{
material1_id = 9;
}

]]>
</mx:script>

<!--
<mx:remoteobject id ="insertservice" destination="coldfusion" source ="insert">
<mx:method name="addmaterial" result="addmaterial(event)" >
</mx:remoteobject>
-->

<mx:remoteobject id="insertservice" destination="coldfusion" source="insert" result="addmaterial(event)"/> <!-- added 1/3/07 -->


</mx:application>


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial