RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Jake Churchill
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. 





RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
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 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. 


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
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 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. 


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
Nevermind.  I needed to create a new function and add that within that
function's body.

 

It's still not firing the init() function right but I'll play around
with it.

 

sj

 



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

 

  

I've been playing around with this...

 

I added in the line

 

GlobalVars.instance.addEventListener("bLoggedInChanged"), init);

 

And I got the error:

 

"Access of undefined property init"

 

I then tried:

 

init()

 

and got:

 

"Call to a possibly undefined method init"

 

I even selected it from the "." auto selection which gave it the ()
after init.

 



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

 

  

If I were writing the code, GlobalVars would look like:

 

Class GlobalVars

 

[Bindable("bLoggedInChanged")]

Public function get bLoggedIn():Boolean

{

Return _bLoggedIn;

}

 

Public function set bLoggedIn(value:Boolean):void

{

If (_bLoggedIn != value)

{

_bLoggedIn = value;

dispatchEvent(new
Event("bLoggedInChanged");

}

}

 

And somewhere in the app I would do:

 

GlobalVars.instance.addEventListener("bLoggedInChanged", init);

 

Alex Harui

Flex SDK Developer

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

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

 

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

 

  

Unfortunately, it's not a manual process...

 



 

I just have it watch the variable that tells the application the user is
logged in...

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

No, you misunderstood. Alex meant that you need to call init when you
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}








On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us> > wrote:

  

Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="100%" height="100%"
enabled="false" creationComplete="init()" >

 
! 

Still causes the init() to fire...  Is this a bug?

 

sj



From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] RE: creationcomplete firing when a component is
disabled

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

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

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

 

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] creationcomplete firing when a component is
disabled

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  

RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Alex Harui
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

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


I've been playing around with this...

I added in the line

GlobalVars.instance.addEventListener("bLoggedInChanged"), init);

And I got the error:

"Access of undefined property init"

I then tried:

init()

and got:

"Call to a possibly undefined method init"

I even selected it from the "." auto selection which gave it the () after init.


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


If I were writing the code, GlobalVars would look like:

Class GlobalVars

[Bindable("bLoggedInChanged")]
Public function get bLoggedIn():Boolean
{
Return _bLoggedIn;
}

Public function set bLoggedIn(value:Boolean):void
{
If (_bLoggedIn != value)
{
_bLoggedIn = value;
dispatchEvent(new Event("bLoggedInChanged");
}
}

And somewhere in the app I would do:

GlobalVars.instance.addEventListener("bLoggedInChanged", init);

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

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


Unfortunately, it's not a manual process...



I just have it watch the variable that tells the application the user is logged 
in...


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component is 
disabled



No, you misunderstood. Alex meant that you need to call init when you 
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}






On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us>> 
wrote:


Makes sense, but I tried that already...



http://www.adobe.com/2006/mxml"; width="100%" height="100%" 
enabled="false" creationComplete="init()" >


   !

Still causes the init() to fire...  Is this a bug?



sj



From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] RE: creationcomplete firing when a component is disabled





Disabling is about interactivity, not creation, which is why creationComplete 
fires.



Somewhere you probably have code that sets enabled=true, and that code can call 
init().



Alex Harui

Flex SDK Developer

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

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



From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] creationcomplete firing when a component is disabled





I've got a troubling issue...



On my main page I have a tabNavigator that has several different pages for my 
app.  This navigator is disabled until the user logs in.  However, even though 
the navigator is disabled; it still fires off the creationcomple

RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
I've been playing around with this...

 

I added in the line

 

GlobalVars.instance.addEventListener("bLoggedInChanged"), init);

 

And I got the error:

 

"Access of undefined property init"

 

I then tried:

 

init()

 

and got:

 

"Call to a possibly undefined method init"

 

I even selected it from the "." auto selection which gave it the ()
after init.

 



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

 

  

If I were writing the code, GlobalVars would look like:

 

Class GlobalVars

 

[Bindable("bLoggedInChanged")]

Public function get bLoggedIn():Boolean

{

Return _bLoggedIn;

}

 

Public function set bLoggedIn(value:Boolean):void

{

If (_bLoggedIn != value)

{

_bLoggedIn = value;

dispatchEvent(new
Event("bLoggedInChanged");

}

}

 

And somewhere in the app I would do:

 

GlobalVars.instance.addEventListener("bLoggedInChanged", init);

 

Alex Harui

Flex SDK Developer

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

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

 

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

 

  

Unfortunately, it's not a manual process...

 



 

I just have it watch the variable that tells the application the user is
logged in...

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

No, you misunderstood. Alex meant that you need to call init when you
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}







On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us> > wrote:

  

Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="100%" height="100%"
enabled="false" creationComplete="init()" >

 
! 

Still causes the init() to fire...  Is this a bug?

 

sj



From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] RE: creationcomplete firing when a component is
disabled

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

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

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

 

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] creationcomplete firing when a component is
disabled

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  Scott

 

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

believed to be clean. 




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com <mailto:fotis.chatzini...@gmail.com> , 


-- 
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. 


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
Ok. Great. Thanks much.

 

sj

 



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

 

  

If I were writing the code, GlobalVars would look like:

 

Class GlobalVars

 

[Bindable("bLoggedInChanged")]

Public function get bLoggedIn():Boolean

{

Return _bLoggedIn;

}

 

Public function set bLoggedIn(value:Boolean):void

{

If (_bLoggedIn != value)

{

_bLoggedIn = value;

dispatchEvent(new
Event("bLoggedInChanged");

}

}

 

And somewhere in the app I would do:

 

GlobalVars.instance.addEventListener("bLoggedInChanged", init);

 

Alex Harui

Flex SDK Developer

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

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

 

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

 

  

Unfortunately, it's not a manual process...

 



 

I just have it watch the variable that tells the application the user is
logged in...

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

No, you misunderstood. Alex meant that you need to call init when you
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}







On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us> > wrote:

  

Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="100%" height="100%"
enabled="false" creationComplete="init()" >

 
! 

Still causes the init() to fire...  Is this a bug?

 

sj



From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] RE: creationcomplete firing when a component is
disabled

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

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

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

 

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] creationcomplete firing when a component is
disabled

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  Scott

 

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

believed to be clean. 




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com <mailto:fotis.chatzini...@gmail.com> , 


-- 
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. 


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Alex Harui
If I were writing the code, GlobalVars would look like:

Class GlobalVars

[Bindable("bLoggedInChanged")]
Public function get bLoggedIn():Boolean
{
Return _bLoggedIn;
}

Public function set bLoggedIn(value:Boolean):void
{
If (_bLoggedIn != value)
{
_bLoggedIn = value;
dispatchEvent(new Event("bLoggedInChanged");
}
}

And somewhere in the app I would do:

GlobalVars.instance.addEventListener("bLoggedInChanged", init);

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

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


Unfortunately, it's not a manual process...



I just have it watch the variable that tells the application the user is logged 
in...


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component is 
disabled



No, you misunderstood. Alex meant that you need to call init when you 
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}




On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us>> 
wrote:


Makes sense, but I tried that already...



http://www.adobe.com/2006/mxml"; width="100%" height="100%" 
enabled="false" creationComplete="init()" >


   !

Still causes the init() to fire...  Is this a bug?



sj



From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] RE: creationcomplete firing when a component is disabled





Disabling is about interactivity, not creation, which is why creationComplete 
fires.



Somewhere you probably have code that sets enabled=true, and that code can call 
init().



Alex Harui

Flex SDK Developer

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

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



From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] creationcomplete firing when a component is disabled





I've got a troubling issue...



On my main page I have a tabNavigator that has several different pages for my 
app.  This navigator is disabled until the user logs in.  However, even though 
the navigator is disabled; it still fires off the creationcomplete which is 
giving me grief because the data connection hasn't been built yet.



Falling short of creating a custom event, is there a way to fire off the init() 
function when the component is enabled instead of when it's creationComplete?



 Thanks

  Scott

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



--
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com<mailto:fotis.chatzini...@gmail.com>,

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



RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
Unfortunately, it's not a manual process...

 



 

I just have it watch the variable that tells the application the user is
logged in...

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Fotis Chatzinikos
Sent: Tuesday, September 01, 2009 2:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] RE: creationcomplete firing when a component
is disabled

 

  

No, you misunderstood. Alex meant that you need to call init when you
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}





On Tue, Sep 1, 2009 at 9:01 PM, Scott mailto:h...@netprof.us> > wrote:

  

Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="100%" height="100%"
enabled="false" creationComplete="init()" >

 


Still causes the init() to fire...  Is this a bug?

 

sj



From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Alex Harui
Sent: Tuesday, September 01, 2009 1:49 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] RE: creationcomplete firing when a component is
disabled

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

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

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

 

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Scott
Sent: Tuesday, September 01, 2009 11:01 AM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] creationcomplete firing when a component is
disabled

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  Scott

 

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

believed to be clean. 




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com <mailto:fotis.chatzini...@gmail.com> , 




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

believed to be clean. 


Re: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Fotis Chatzinikos
No, you misunderstood. Alex meant that you need to call init when you
'manually' enable the canvas.

Ie:

you have a button where you do:

buttonClick(..)
{
myCanvas.enabled = true ;
//Here is the place to put init()
}




On Tue, Sep 1, 2009 at 9:01 PM, Scott  wrote:

>
>
>  Makes sense, but I tried that already…
>
>
>
> http://www.adobe.com/2006/mxml"; width="100%"
> height="100%" enabled="false" creationComplete="init()" >
>
>
>
>
> Still causes the init() to fire…  Is this a bug?
>
>
>
> sj
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Alex Harui
> *Sent:* Tuesday, September 01, 2009 1:49 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] RE: creationcomplete firing when a component is
> disabled
>
>
>
>
>
> Disabling is about interactivity, not creation, which is why
> creationComplete fires.
>
>
>
> Somewhere you probably have code that sets enabled=true, and that code can
> call init().
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. 
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Scott
> *Sent:* Tuesday, September 01, 2009 11:01 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] creationcomplete firing when a component is
> disabled
>
>
>
>
>
> I’ve got a troubling issue…
>
>
>
> On my main page I have a tabNavigator that has several different pages for
> my app.  This navigator is disabled until the user logs in.  However, even
> though the navigator is disabled; it still fires off the creationcomplete
> which is giving me grief because the data connection hasn’t been built yet.
>
>
>
> Falling short of creating a custom event, is there a way to fire off the
> init() function when the component is enabled instead of when it’s
> creationComplete?
>
>
>
>  Thanks
>
>   Scott
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* , and is
> believed to be clean.
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com,


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
That's in the parent component...

 



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

 

  

I think you misunderstood. Where is the code that sets enable=true on
the tabnavigator?

 

Alex Harui

Flex SDK Developer

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

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

 

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

 

  

Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml"; width="100%"
height="100%" enabled="false" creationComplete="init()" >

 
&n bsp;   &nb! sp;

Still causes the init() to fire...  Is this a bug?

 

sj



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

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

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

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

 

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

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  Scott


-- 
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. 


RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Alex Harui
I think you misunderstood. Where is the code that sets enable=true on the 
tabnavigator?

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

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


Makes sense, but I tried that already...

http://www.adobe.com/2006/mxml"; width="100%" height="100%" 
enabled="false" creationComplete="init()" >

  
&nb! sp;
Still causes the init() to fire...  Is this a bug?

sj

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


Disabling is about interactivity, not creation, which is why creationComplete 
fires.

Somewhere you probably have code that sets enabled=true, and that code can call 
init().

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

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


I've got a troubling issue...

On my main page I have a tabNavigator that has several different pages for my 
app.  This navigator is disabled until the user logs in.  However, even though 
the navigator is disabled; it still fires off the creationcomplete which is 
giving me grief because the data connection hasn't been built yet.

Falling short of creating a custom event, is there a way to fire off the init() 
function when the component is enabled instead of when it's creationComplete?

 Thanks
  Scott

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



RE: [flexcoders] RE: creationcomplete firing when a component is disabled

2009-09-01 Thread Scott
Makes sense, but I tried that already...

 

http://www.adobe.com/2006/mxml"; width="100%"
height="100%" enabled="false" creationComplete="init()" >

 


Still causes the init() to fire...  Is this a bug?

 

sj



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

 

  

Disabling is about interactivity, not creation, which is why
creationComplete fires.

 

Somewhere you probably have code that sets enabled=true, and that code
can call init().

 

Alex Harui

Flex SDK Developer

Adobe Systems Inc.  

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

 

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

 

  

I've got a troubling issue...

 

On my main page I have a tabNavigator that has several different pages
for my app.  This navigator is disabled until the user logs in.
However, even though the navigator is disabled; it still fires off the
creationcomplete which is giving me grief because the data connection
hasn't been built yet.

 

Falling short of creating a custom event, is there a way to fire off the
init() function when the component is enabled instead of when it's
creationComplete?

 

 Thanks

  Scott




-- 
This message has been scanned for viruses and 
dangerous content by MailScanner  , and is

believed to be clean.