Expand my Community achievements bar.

Error updating textarea more than once

Avatar

Level 1
hi,

I'm using webservice and I update the textarea with
lastresult for first time successfully. When I try to call the
webservice the second time, the textarea throws following error:

ArgumentError: Error #2025: The supplied DisplayObject must
be a child of the caller.

....



Following is simple code:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">

<mx:Script>

<![CDATA[

import flash.events.*;

import mx.events.*;

import mx.controls.*;

import flash.text.TextField;

import flash.events.TextEvent;

import mx.events.MenuEvent;

import mx.collections.*;

import mx.states.*;

import mx.rpc.events.ResultEvent

import mx.rpc.events.FaultEvent



public function change(str:String):void{

Read.ReadFile.send();

}

]]>

</mx:Script>

<mx:WebService id="Read" wsdl="
http://192.168.1.10/webservice/ReadService.asmx?WSDL"
showBusyCursor="true"

fault="Alert.show(event.fault.faultString)">

<mx:operation name="ReadFile">

<mx:request>

<fname>{"ch1.txt"}</fname>

</mx:request>

</mx:operation>

</mx:WebService>



<mx:HBox width="100%" height="100%">

<mx:Button label="one" id="one" click="change('one')"/>

<mx:Button label="two" id="two" click="change('two')"/>

<mx:Button label="three" id="three"
click="change('three')"/>

<mx:TextArea id="txt" width="100%" height="100%"
htmlText="{Read.ReadFile.lastResult}"/>

</mx:HBox>

</mx:Application>



Kindly help me out, how to update textfield using lastResult,
everytime I call webservice. This I need to fix within Fri evening.
Please someone help me out with this !



Warm regards,

Kemp

0 Replies