eval was gone long back, I mean it was there but most of people stopped using, at least I did after Flash 5 was released. I could use [] or dot (.) to reference things...Much cleaner approach, though eval was little faster...But code clarity matters.
Folks who were not using eval(..) would be
I have a question that's almost related.In AS3, how can I instantiate a class, com.foo.MyClass, using the string com.foo.MyClass? The reason I ask is that I'd like to load an XML file and use it to dynamically create components at runtime. Something like this:
components component
getClassByBame will return the Class, then
you can use new on it. Make sure you have any class that youd want to
instantiate linked in by having a typed variable for it though
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Bray
I am not using Flex, I am mostly curious what I would have to do to my existing Flash actionscript code when AS3 is out for Flash.Gordon Smith [EMAIL PROTECTED] wrote:Whoa not only is there no eval(), there's no _target, no _level0, and no _global! Plus, you
Whoa not only is there no eval(),
there's no _target, no _level0, and no _global! Plus, you should almost always
use Sprite instead of MovieClip.
So what are you really trying to do? Are
you using Flex or just pure AS3? Where are you getting a string like sprite1.sprite2.sprite3
5 matches
Mail list logo