AFAIK, there is no other Button-type class aside from SimpleButton in AS3's libraries. You could extend SimpleButton and add in a TextField. Then create a wrapper method to set the text property on your extended button to set the text on the TextField within.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gustavo Duenas Sent: Monday, June 18, 2007 7:16 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] (no subject) any idea about how can I set the text in the button or is any other buttons component is AS3? Regards. Gustavo On Jun 18, 2007, at 7:04 PM, David Ngo wrote: > 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 > 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