访问 SWC 中的子元素
有谁知道是否可以访问 SWC 中的子元素?我创建了一些 MC,并且在其中一些 MC 内部有一些动态文本字段。我将内容导出到 SWC 并将其加载到我的 Flex 项目中。加载它或访问父元素没有问题,它们显示得很好。但我想访问 MC 中嵌套的文本字段并修改文本。当我调试应用程序时,我可以将文本字段视为子元素。它被输入为文本字段,实例名称与 Flash IDE 中的输入相同,但我无法访问它。当 Flex 编译时,它会抛出一个错误,指出它无法识别该方法。我尝试在时间轴上插入动作脚本,链接外部类,但无法访问任何内容。有谁知道有什么方法可以做到这一点?
Does anyone know if its possible to access children elements in a SWC? I have created some MC's and inside of some of these MC's I have some dynamic textFields. I export the content to a SWC and load it into my Flex project. No problem loading it or accessing the parent elements, they display fine. But I want to access the textfields nestes in the MC's and modify the text. When I debug the app, I can see the textfields as child elements. It's typed as a TextField and the Instance Name is the same as input in the Flash IDE but I cannot access it. When Flex compiles it throws an error saying it doesn't recognize the method. I've tried to insert actionscript on the timeline, linked external classes and nothing can be accessed. Does anyone know of a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
很难说,因为你没有显示失败的代码,但我怀疑你正在做:
而不是
It's hard to say since you're not showing your code that fails, but I suspect you're doing:
instead of
我刚刚也遇到了这个问题,我很好奇为什么你建议他不使用实例名称,因为 myTextField 显然是他正在使用的 TextField 的实例名称......
I just bumped into this as well, and am curious as to why you're suggesting he's NOT using the instance name since myTextField is obviously an instance name for the TextField he's using....