从 FXG 获取子级
我已将 FXG 从 Adobe illustrator 中的 illustrator 导入到 flash builder 4.5 中,并设法将其放在舞台上,我面临的问题是访问 FXG 的子级。
基本 FXG 不起作用:
<?xml version="1.0" encoding="utf-8" ?>
<Graphic xmlns="http://ns.adobe.com/fxg/2008" xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:ai="http://ns.adobe.com/ai/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:flm="http://ns.adobe.com/flame/2008">
<Group id="subChild">
<Group id="subSubChild" />
</Group>
</Graphic>
然后我尝试像这样访问这些子项:
var fooObj:MyFxgObj = new MyFxgObj();
fooObj.getChildByName("subChild");
这会立即向我显示空错误。我在过去的两个小时左右搜索了谷歌,但没有结果,所以任何帮助将不胜感激。
I've imported an FXG from illustrator from Adobe illustrator into flash builder 4.5 and have managed to get it on the stage, the problem I'm facing is accessing the children of the FXG.
Basic FXG that won't work:
<?xml version="1.0" encoding="utf-8" ?>
<Graphic xmlns="http://ns.adobe.com/fxg/2008" xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:ai="http://ns.adobe.com/ai/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:flm="http://ns.adobe.com/flame/2008">
<Group id="subChild">
<Group id="subSubChild" />
</Group>
</Graphic>
I then try to access these children like so:
var fooObj:MyFxgObj = new MyFxgObj();
fooObj.getChildByName("subChild");
Which promptly greets me with a null error. I've searched google for the past 2 hours or so but to no avail, so any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
既然您说我的评论是您的解决方案,那么这里是一个正式的答案:
我认为访问 FXG 图形的子级是不可能的。我认为 FXG 资源存在于与 ActionScript 对象或本机 Flash 对象不同的级别。我将 FXG 文件视为单一资产;有点像 JPG 或 PNG 或嵌入式 SWF。
如果您需要访问子项,则应考虑使用 MXML 图形的方法。
Since you said my comment was your solution, here it is as a formal answer:
I didn't think accessing the children of an FXG graphic was possible. I think FXG assets exist at a different level than ActionScript objects or native flash objects. I view an FXG file as a single asset; kind of like a JPG or PNG or embedded SWF.
If you need to access the children, using MXML graphics is the approach you should consider.
可以访问 FXG 子项,并在 Adobe 文档中进行了解释使用FXG。
Accessing FXG children is possible and explained in the Adobe doc Using FXG.