Are you talking about the id="..." attribute on MXML tags? All it does
it autogenerate a public var in the class. For example, if you write
 
<mx:Button id="b"/>
 
in an MXML component then the autogenerated AS class has the instance
var
 
public var b:Button;
 
So if you plan on dynamically instantiating components instead of
statically declaring them with tags, you simply declare your own var as
above and then do
 
b = new Button();
 
The difference between this approach and AJAX is that AS3 gets its
performance gain over Javascript by having non-dynamic classes (where
all properties and methods are declared at compilation time) in addition
to to dynamic ones. Flex components are mostly non-dynamic for speed. So
you simply declare variables to be the "id's" of the components you're
going to create later.
 
- Gordon

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of thetexaspsycho2003
Sent: Thursday, March 01, 2007 1:12 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Dynamically creating item IDs



--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "thetexaspsycho2003"
<[EMAIL PROTECTED]> wrote:
>
> Is there a way to dynamically create an item's ID? For example pulling
> it in from a XML file?
>

I guess from the lack of replies there is no way of doing this. If so,
this is very disappointing. The ability to create IDs on-the-fly is
very helpful in other technologies, such as AJAX.



 

Reply via email to