You need to add the 'var' keyword for your iterator in the for loop. You
also need to change your comparison evaluator to '<' and not '>'. For your
second error, SimpleButton doesn't have a text property you can set. See:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Simp
leButton.html


for (var i:uint = 0; i < myArray.length; i++) {
        var myButtons:SimpleButton = new SimpleButton();
        addChild(myButtons);
}


David



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gustavo
Duenas
Sent: Monday, June 18, 2007 6:39 PM
To: Flashcoders mailing list
Subject: [Flashcoders] (no subject)

hi coder I had to fragment my thread , I'm trying to create a loop in  
a as project in flex, in order to set up some buttons, this is the  
code for the loop (which is not working and gave me errors  every single
time I run .


public function buttons():void{
                                //line 52// for (i=0; i>myArray.length;
i++){
                                        var myButtons:SimpleButton = new
SimpleButton();
                                        //line
54//myButtons.text(myArray[i]);
                                        addChild(myButtons);
                                }

and these are the errors:


1120: Access of undefined property i.   template1       template1.as    line
52      

1061: Call to a possibly undefined method text through a reference  
with static type flash.display:SimpleButton.    template1       template1.as

line 54 

If you have some ideas about how to do this simple thing , I'd  
appreciate any help.

Regards




Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to