Hello :)

In AS3 in your main class who extends the Sprite class... if you use the
flash.utils.describeType function you can see the Sprite class isn't
"dynamic" :

package
{
    import flash.utils.describeType;

    public class Test extends Sprite
    {
        public function Test()
        {
            trace( describeType( this ) ) ;
        }
   }
}

result in the output console :
<type name="vegas" base="flash.display::Sprite" isDynamic="false"
isFinal="false" isStatic="false">......

If the class isn't dynamic you can't use the dynamic keyword :

package
{
    import flash.utils.describeType;

    public dynamic class Test extends Sprite
    {
        public function Test()
        {
            for (var i:uint = 0 ; i<10 ; i++)
            {
                this["somevarname"+i] = i;
            }
            trace( this.somevarname2 ) ; // 2
        }
   }
}

EKA+ :)


2007/9/1, [p e r c e p t i c o n] <[EMAIL PROTECTED]>:
>
> greetings experts!
>
> way back in the days of as2 you could do something like this...
>
> this["somevarname"+someIndex] = new Something();
>
>
> ...and i'm wondering how you do something like this in as3....i've
> extended
> the sprite class and need to create items similar to this, but it won't
> let
> me
>
> cheers
>
> p
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to