I've never written flash before but I'm trying to work through something and I'm stuck, it's either possible or not possible.
I want to create buttons on the fly, which are created from an xml file on the server (actually a php script which generates the xml).
The following code is running, but I need to put the button onto the scene which is where I'm stumped.
Code:
// create the buttons in the panel
for (loop = 0; loop < ids.length; loop++)
{
buttons[loop] = new Button();
buttons[loop]._x = loop * (170 + 10);
buttons[loop]._y = 0;
buttons[loop]._name = "DSymbol " + loop;
buttons[loop]._url = "screenshots.php?id=" + ids[loop];
panel.addButton(buttons[loop]);
}
Does the code look like it should work, panel is the scene as far as I can tell - is there anything else I might need to do.
Another way I thought was is it possible to copy a button in the script, so if I defined a default button then replicated it for each new button, then set the _x value which would be the same thing as far as I can tell.
Any ideas, I can't create the buttons before hand and just set them as I need them as it's unknown how many screenshots I'll have
Social Networking Bookmarks