  | | | eval a class name | eval a class name 2004-03-18 - By EECOLOR
Back If i remember correct, this should work too:
com.label.StandardLabel;
var str = "StandardLabel"; var n_txt = new com.label[str]();
U must use the class so it gets imported. When its imported it will be as an object in the _global scope.
Greetz Erik
At 18:02 17-3-2004, you wrote: >Does anyone know why this works when referencing a class: > >var n_txt = new com.label["StandardLabel"](); > >but this does not: > >var str = "StandardLabel"; >var n_txt = new com.label[str](); > >I found a few items in the archives relating to AS1, that suggest to use >eval, but I can't get that to work in AS2.
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:107261 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |