在 Flash 中,当 e4x 语句存储在字符串中时,我将如何运行该语句? [英] In Flash, how would I run an e4x statement when that statement is stored in a String?

查看:16
本文介绍了在 Flash 中,当 e4x 语句存储在字符串中时,我将如何运行该语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这样的事情:

var xmlStatement:String = "xmlObject.node[3].@thisValue";

我必须使用什么神秘函数才能执行 xmlStatement 并从该 xmlObject 中获取 thisValue?喜欢....

What mystery function do I have to use so that I can execute xmlStatement and get thisValue from that xmlObject? Like....

var attribute:String = mysteryFunction(xmlStatement);

附言我知道 eval() 适用于 actionscript2,我需要 as3 解决方案.:)

P.S. I know eval() works for actionscript2, I need the as3 solution. :)

推荐答案

不幸的是,这在 ActionScript 3 中是不可能的.不过这可能是一个解决方案:http://blog.betabong.com/2008/09/23/e4x-string-parser/

Unfortunately this is not possible in ActionScript 3. This however might be a solution: http://blog.betabong.com/2008/09/23/e4x-string-parser/

这篇关于在 Flash 中,当 e4x 语句存储在字符串中时,我将如何运行该语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆