getDefinitionByName() problem
Once I spotted getDefinitionByName function in flash.utils.* namespace I was very happy with idea to solve objects instancing on elegant and easy way. I’ve created XML decription format like this:
<ogroup typing=”ifs.ifs3D.Camera” arrayName=”camArray” >
<ent camPos=”200,200,800″ camTar=”0,0,0″ camRot=”0,0,0″ fov=”90″ focus=”100″ name=”maincam” />
</ogroup>
where <ogroup> with it’s <ent /> nodes describes objects and putting it to camArray:Array.
Here usage of getDefinitionByName() sounds great, because ifs.ifs3D.Camera is real classpath.
But
Problem is that both Flash and Flex compiler AI in this way can’t see that my code will use ifd.ifs3D.Camera class and in compile time it doesn’t put it in resulting bytecode. So I was getting error at runtime:
- Camera value is undefined
Solution is to somewhere in code use classpath that you’re going to call with getDefinitionByName(); in command like:
var proto_i3D:ifs.ifs3D.Camera;
or just
var proto_i3D:Camera;
So it’s imposable to create totally XML driven object instancing, but getDefinitionByName() is still usable to avoid big switch(xml.@objecttype) structure.
Usefull links:
http://www.as3guru.com/?p=5 - Here I found solution for this problem
July 15th, 2010 at 7:10 pm
< blockquote >< a href=”http://pillspot.org/”>Pillspot.org. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. Low price drugs. Buy pills online< /a >…
Buy:Female Cialis.Amoxicillin.Zocor.Nymphomax.Ventolin.Cozaar.Lipothin.Advair.Buspar.Seroquel.Lasix.Female Pink Viagra.Lipitor.Aricept.Acomplia.Prozac.Benicar.Zetia.Wellbutrin SR.SleepWell….
August 30th, 2010 at 5:01 pm
toshiba http://xtoshibauupvtj.AACEHARDWARE.INFO/tag/sony+m35+toshiba/ : sony…
toshiba…