I’m trying to create some buttons dynamically. When I test the code below, a white rectangle appears and the button loops its 2 squares.
import flash.display.MovieClip;
function createButton(event:Event) {
var classType:Class;
classType = getDefinitionByName("SingleButton") as Class;
obj_arr[totalObjects] = new classType();
addChild(obj_arr[totalObjects]);
// properties_txt.text = "Properties of " + event.target.selectedItem.label;
}
I’m using Flash Professional CC. How can I fix this?
Edit: I duplicated standart “Button” component in library named it “SingleButton”.