Re: [flexcoders] Flex4: getChildById or getElementById

2010-01-15 Thread Ondina F
So obvious and
simple! Thank you!! 
[Shame on me: my
first posting in here looks like spam. Once
again, I'm sorry.]
Ondina





From: Gordon Smith 
To: "flexcoders@yahoogroups.com" 
Sent: Fri, January 15, 2010 8:00:33 AM
Subject: RE: [flexcoders] Flex4: getChildById or getElementById

   
You can write code like
 
if ("mycomponent" in this)
{
this["mycomponent"].doSomething( )
}
 
to avoid an FTE with mycomponent does not exist.
 
Gordon Smith
Adobe Flex SDK Team
 
From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Ondina F
Sent: Thursday, January 14, 2010 3:02 AM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Flex4: getChildById or getElementById
 
  
Hi,
Oftentimes I
need to check if a component( for example a  TextInput) exists before
populating it with data. 
The
getChildByName( )is the only method I know of, that can do this.
I wish there was
a getChildById( ) as well, so I wouldn’t have to set the name for all my
components( could be hundreds )in addition to their id.
[
If the
component( myComponent ) doesn’t exist:
this[“myComponent”]
throws the RE ReferenceError: Error #1069
and 
this.contains( myComponent)
doesn’t compile of course
1120: Access of
undefined property myComponentId.
]
I know,
Christmas time is over, no more gifts for us from Adobe:)
Should I put it on
my next flex-xmas list?
Or do you guys
know about other ways of checking the existence of components? Any input would
be much appreciated.
Cheers,
Ondina
P.S. My message
didn’t show up on the mailing list after tryingto create a new topic on the
Yahoo Groups. I must have done something wrong. Sorry for any inconvenience I
might have caused.
 
 


  

RE: [flexcoders] Flex4: getChildById or getElementById

2010-01-14 Thread Gordon Smith
You can write code like

if ("mycomponent" in this)
{
this["mycomponent"].doSomething()
}

to avoid an FTE with mycomponent does not exist.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Ondina F
Sent: Thursday, January 14, 2010 3:02 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex4: getChildById or getElementById


Hi,
Oftentimes I need to check if a component( for example a  TextInput) exists 
before populating it with data.
The getChildByName()is the only method I know of, that can do this.
I wish there was a getChildById() as well, so I wouldn’t have to set the name 
for all my components( could be hundreds )in addition to their id.
[
If the component( myComponent ) doesn’t exist:
this[“myComponent”] throws the RE ReferenceError: Error #1069
and
this.contains(myComponent) doesn’t compile of course
1120: Access of undefined property myComponentId.
]
I know, Christmas time is over, no more gifts for us from Adobe:)
Should I put it on my next flex-xmas list?
Or do you guys know about other ways of checking the existence of components? 
Any input would be much appreciated.
Cheers,
Ondina
P.S. My message didn’t show up on the mailing list after trying to create a new 
topic on the Yahoo Groups. I must have done something wrong. Sorry for any 
inconvenience I might have caused.




[flexcoders] Flex4: getChildById or getElementById

2010-01-14 Thread ondina_fd
Hi,
Oftentimes I need to check if a component( for example a TextInput) exists 
before populating it with data. 
The getChildByName()is the only method I know of that can do this.
I wish there was a getChildById() as well, so I wouldn't have to set the name 
for all my components( could be hundreds )in addition to their id.
[
If the component( myComponentId ) doesn't exist:
this["myComponentId"] throws the RE ReferenceError: Error #1069
and 
this.contains(myComponentId) doesn't compile of course
1120: Access of undefined property myComponentId.   
]
I know, Christmas time is over, no more gifts for us from Adobe:)
Should I put it on my next flex-xmas list?
Or do you guys know about other ways of checking the existence of components? 
Cheers,
Ondina

P.S. My message didn't show up the first time. Hopefully it won't appear   
twice! If so I'm really sorry. 



[flexcoders] Flex4: getChildById or getElementById

2010-01-14 Thread Ondina F
Hi,
Oftentimes I
need to check if a component( for example a  TextInput) exists before 
populating it with data. 
The getChildByName()is
the only method I know of, that can do this.
I wish there was
a getChildById() as well, so I wouldn’t have to set the name for all my
components( could be hundreds )in addition to their id.
[
If the
component( myComponent ) doesn’t exist:
this[“myComponent”]
throws the RE ReferenceError: Error #1069
and 
this.contains(myComponent)
doesn’t compile of course
1120: Access of
undefined property myComponentId.
]
I know,
Christmas time is over, no more gifts for us from Adobe:)
Should I put it
on my next flex-xmas list?
Or do you guys
know about other ways of checking the existence of components? Any input would
be much appreciated.
Cheers,

Ondina
P.S. My message
didn’t show up on the mailing
list after tryingto create
a new topic on the Yahoo Groups. I must have done something wrong. Sorry for
any inconvenience I might have caused.


  

[flexcoders] Flex4: getChildById or getElementById

2010-01-14 Thread ondina_fd
Hi,
Oftentimes I need to check if a component( for example a  TextInput) exists 
before populating it with data. 
The getChildByName()is the only method I know of that can do this.
I wish there was a getChildById() as well, so I wouldn't have to set the name 
for all my components( could be hundreds )in addition to their id.
[
If the component( myComponentId ) doesn't exist:
this["myComponentId"] throws the RE ReferenceError: Error #1069
and 
this.contains(myComponentId) doesn't compile of course
1120: Access of undefined property myComponentId.   
]
I know, Christmas time is over, no more gifts for us from Adobe:)
Should I put it on my next flex-xmas list?
Or do you guys know about other ways of checking the existence of components? 
Cheers,
Ondina