PDA

View Full Version : Having trouble with my buttons!


vicvicvic
07-31-2009, 03:45 PM
Hello,

I was wondering if you could tell me how I can make a function that imports a button onto the stage when another button is clicked. Both of these buttons are already in my library, and I've customised them to look like pictures.

I've added an event listener and written this function:



function BringButton (event:MouseEvent): void {

import fl.controls.Button;

var myButton:Button = new Button ();

addChild(myButton);
}


This doesn't work and I can't understand why.
Any suggestions anyone?
Thanks very much!