Ok, it's been one of those days...  Perhaps I shouldn't program when I'm
ill.

 

I finally figured out what the heck was going on and want to post this
in case someone else runs into it.

 

I'm building an Air application that connected to a CF server.  I
created a process to pull an XML file with the server information to set
up the remote object.  This file was populated into the GlobalVars.  The
problem was the first screen initialized (including the remote object
call) before the XML file was read.  I stumbled on the answer by
accident when I went to see what was in the
GlobalVars.instance.strServer variable.  Incidentally, why doesn't the
debugger see this variable?  If I do the following:

 

Private var strTemp:string;

strTemp = GlobalVars.instance.strServer

 

I can then watch the variable in the debugger.

 

Anyway, I set the original variable to [Bindable] and my problem went
away.  It was then I realized that the remote object with the endpoint
variable was initialized in a non-configured state.

 

GRR.

 

Thanks for your help anyway, Alex.  I learned something new about
overloading variables in flex which I'm sure will come in handy later
on.

 

Scott

 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Scott
Sent: Tuesday, September 01, 2009 4:20 PM
To: [email protected]
Subject: RE: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

Yeah, that got me next... I had to add in the event into the
init(evt::Event):void.

 

With all the work, I've got the same issue...

 

It's trying to initialize the remoteobject before it has the required
information provided after the login.

 

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 4:59 PM
To: [email protected]
Subject: RE: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

I assume you mis-typed the first one?  There are too many )'s.  The
params to addEventListener take a method reference, not a call to a
method, so 

 

addEventListener("bLoggedInChagned", init)

 

is correct.

 

Do you have a function init()?  Is it in the same file as this code?
Otherwise, you'll need to make it public and get access to it.  BTW, the
init() must now take an event as its parameter

 

public function init(event:Event):void

{

                // call webservice or something like that

}

 

 

Alex Harui

Flex SDK Developer

Adobe Systems Inc. <http://www.adobe.com/> 

Blog: http://blogs.adobe.com/aharui <http://blogs.adobe.com/aharui> 

 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 




-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

Reply via email to