How to load image asset into UIcomponent?
i have png image in assets layer of uicomponent, how dynamic load in configui function? in fact how flash components loads assets?
if use code below, see image when run (swf) file. not see in live preview and, without try block, when component (swc) inserted fla file throws error.
try {
var dragicon = this.loaderinfo.applicationdomain.getdefinition("dragiconpng");
var dicombmp:bitmap = new bitmap(new dragicon());
dicombmp.x = -dicombmp.width/2;
dicombmp.y = -dicombmp.height/2;
addchild(dicombmp);
} catch (e:error) {
trace("error in getdefinition: "+e.message);
}
a component pre-compiled movieclip needed assets should compiled movieclip
what trying do?
More discussions in ActionScript 3
adobe
Comments
Post a Comment