Make the class dynamic or use an object.

var o:Object = {};
for (var i:uint=0; i == 10; i++)
{
    var myVar_i:String = new String();
    o["myVar_" + i] = new String();
}

Or:

package
{
    dynamic public class Flexible
    {
        publid function Flexible()
        {
        }
    }
}

var a:Flexible = new Flexible();
a["cow" + i] = new String();


----- Original Message ----- 
From: "Artur Kordowski" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 26, 2006 10:24 AM
Subject: RE: [flexcoders] Create variables dynamic in Flex 2


But i dont want to use an array. I would like to create those vars on the
fly.

Artur

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Andrews
Sent: Wednesday, July 26, 2006 4:07 PM
To: [email protected]
Subject: Re: [flexcoders] Create variables dynamic in Flex 2


----- Original Message -----
From: "Paul Andrews" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 26, 2006 3:04 PM
Subject: Re: [flexcoders] Create variables dynamic in Flex 2


> ----- Original Message ----- 
> From: "Artur Kordowski" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Wednesday, July 26, 2006 2:58 PM
> Subject: [flexcoders] Create variables dynamic in Flex 2
>
>
>> How can I create in a loop variables dynamicly?
>> Like this:
>>
>> for (var i:uint=0; i == 10; i++)
>> {
>> var myVar_i:String = new String();
>> }
>>
>> Any idea?
>
> var myVar:Array = new Array();
> for (var i:uint=0; i == 10; i++)
> {
> myVar[i]  = new String();
> }
>
>
>
>
>>
>>
>> Artur
>>
>>
>>
>> --
>> Flexcoders Mailing List
>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/TktRrD/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to