ActionScript Linkage in a swc - linking to an existing class not working right
hi,
i have library item in fla uses actionscript linkage. i'm linking item existing class. when write path in class input window can click pencil icon , open class in flash profesional. export swc in swc folder. in flash builder class library item links wont recognize named display object instances in linked library item. , when compile , test swf , add class diplay list see nothing.
but if use actionscript linkage library item , set path field puts linkage class in default package, can create instances of linked library item.
so swc , flash builder working, not when link class existing class.
any suggestions?
cheers.
are using getdefinitionbyname() obtain reference object? if i've found if don't have reference object in main swf cannot find class either. ended having create fake reference each item wanted in main.as growing pain.
e.g.
package
{
import flash.display.sprite;
import flash.utils.getdefinitionbyname;
public class main extends sprite
{
public function main()
{
// useless swc references
_initreferences();
_loadalibraryitem();
}
private function _initreferences():void
{
var a:somelibraryid;
var b:someotherlibraryid;
var c:yougettheidea;
}
private function _loadalibraryitem():void
{
// class reference, init via class correct type (e.g. sprite)
var itemclass = getdefinitionbyname("somelibraryid") class;
var item:sprite = sprite(new itemclass());
addchild(item);
}
}
}
the general idea flash builder did not compile library items though had class name because there no references of them. once made reference in main swf access them in other class, not main.
this similar os codepage dictating font outlines embedded via flash pro (flash builder can around this) rather built-in font manager. tell arial embed korean , doesn't, latin. flash/builder makes decisions on own shouldn't, deciding library items don't exist unless make bunch of useless dead references compilers sake. feel c/obj-c .h file can predefine variables before define them.....
More discussions in ActionScript 3
adobe
Comments
Post a Comment