Orkut Gmail Calendar Documents Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion need help with XMLList
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
prateek srivastava  
View profile  
 More options Nov 24 2009, 10:09 am
From: prateek srivastava <me.prateek.srivast...@gmail.com>
Date: Tue, 24 Nov 2009 10:09:00 +0530
Subject: Re: [Pune Flex Users:2071] need help with XMLList

well I think you missed a small point that flex HTTPService call is
Asynchronus, so it has to wait till it receives the result, Alert in the
consult function will be executed as soon as the request is sent, hence it
will always give 0,

On Mon, Nov 23, 2009 at 12:40 PM, SVictor <svicto...@gmail.com> wrote:

> Hi all, I need Your help with something in my code....

> Here is my code:
> ******************************************
>        import mx.controls.Alert;
>        import mx.rpc.events.ResultEvent;
>        import mx.rpc.http.HTTPService;

>        public class Controler{

>                        [Bindable]
>                        public var lista:XMLList;

>                public function consult():XMLList{
>                        var service:HTTPService = new HTTPService();
>                        service.url="http://localhost/Something.php";
>                        service.useProxy=false;
>                        service.resultFormat="e4x";
>                        service.addEventListener(ResultEvent.RESULT, met);
>                        service.send();
>                        Alert.show(lista.length());     //prints 0 =S
>                        return this.lista;
>                }

>                private function met(event:ResultEvent):void{
>                        lista = event.result.option as XMLList;
>                        Alert.show(this.lista.length()); //prints the real
> value, actually:
> 6
>                }
>        }
> **********************************************

> The thing is: I got data from a database, working fine, in the
> function met I got the data and the alert.show shows the length of the
> var lista:XMLList wich is [Bindable] but when i used again in the
> consult function I got a big 0 (zero) and I dont know what the problem
> is, some help please...

> well I know the problem is that the var lista:XMLList dont make the
> upgrade but I dont know why...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google