You can't see GlobalVars because it's a Singleton.  Models are often used
that way.  Try var g:GlobalVars = GlobalVars.instance; 

 

I do that a lot when using a Model and when I'm done debugging, I remove it.

 

Jake Churchill

CF Webtools

11204 Davenport, Ste. 100

Omaha, NE  68154

http://www.cfwebtools.com

402-408-3733 x103

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Scott
Sent: Tuesday, September 01, 2009 5:36 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] RE: creationcomplete firing when a component is
disabled

 

  

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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Scott
Sent: Tuesday, September 01, 2009 4:20 PM
To: flexcoders@yahoogroups.com
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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 4:59 PM
To: flexcoders@yahoogroups.com
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 <http://www.adobe.com/>  Systems Inc.

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

 


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


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



Reply via email to