You need to roll it on your own. You could split the given path into
its parts and try to evaluate one piece after the other until you come
to the end.

public function eval( scope : Object, path : String ) : Object
{
       if( path == null ) return null;

       var result : Object = scope;
       var parts : Array = path.split('.');
       while( result != null && parts.length > 0 )
       {
             var part : String = parts.shift();
             result = result[ part ];
       }
       return result;
}

Untested code, but hopefully you get the point. Maybe you need to add
some exception handling, when you try to access non existing
properties.

Cheers,
Ralf.


On 10/11/06, pilby1 <[EMAIL PROTECTED]> wrote:
> Sorry if this had been covered before, but I searched the archives,
> even the Macromedia site, even just Google search, and I can't seem to
> find anything that addresses eval() other than it having been removed
> in Actionscript 3. Nothing seems to state what took its place, if any.
>
> If I wanted to replicate the feature of eval(), does anyone know how in
> Actionscript 3?
>
> Thanks.
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>


-- 
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to