Where to start...

First a few obvious things, but general.

Flash 9 Beta??  I thought that timed out already. Besides it is a beta and
it had limited capabilities.

Copy and pasting code from Flash 9 to Flex is not a 1:1 conversion.

Lastly, you code actually worked. Looking at your FOR loop, I don't think it
would ever end. Your condition to end the loop is the length of the myArray.
But within the loop you are pushing more items into it. I would think that
causes an endless loop.

Next you show use that you have already set myArray with some items. I am
just a bit confused. Are you prebuilding the array or are you dynamically
building it? It would seem you are trying to do both.

Perhaps letting us know what error you are getting in Flex or what exactly
is going wrong other than they are just not appearing. Is you myArray
getting messed up? Are the Button objects not getting generated?

Charles P.


On 6/19/07, Gustavo Duenas <[EMAIL PROTECTED]> wrote:

Hi, I'm trying to create buttons using an array, it looks good in
Flash 9 beta but in flex, it seems trouble for me.

this is the code of the loop, the debugger doesn't  show me any error
or warning but I don't see my buttons
by the way I have a loader also with a big jpg as a background , this
one would probably  be the cause of my problem?.

Ok, folks this is the code.


public function buttons():void{
                                for (var i:uint=0; i<myArray.length; i++){
                                        var myButtons:Button = new
Button();
                                        addChild(myButtons);
                                        myButtons.x=100+i;
                                        myButtons.y=0;
trace(myArray);
myArray.push(myButtons+i);
                                }


the array is upper in a private var. that looks like this:

public var myArray:Array = new Array("who we are", "what we do",
"contact", "products");





Gustavo Duenas


P.d: sooner I'm gonna buy those flex books.

_______________________________________________
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