获取滚动窗格的子元素
我有一个 ScrollPane 组件要暂存,我将它作为新的 MovieClip 实例的源。如何访问滚动窗格内的影片剪辑?
这是我到目前为止所拥有的,但它返回 null:
var regForm = new RegistrationForm();
regForm.name = "rForm";
regFormSP.source = regForm;
var form = Object(regFormSP.content).getChildByName("rForm");
trace(form) // returns null
UPDATE
如果我列出对象,我得到
_level0.regFormSP.instance20.rForm
There is an object "instance20" as a Parent to rForm...为什么呢?
I have a ScrollPane component to stage and I give it as source a new MovieClip instance. How can I access the movieclip inside scrollpane?
This is what I have so far but it returns null:
var regForm = new RegistrationForm();
regForm.name = "rForm";
regFormSP.source = regForm;
var form = Object(regFormSP.content).getChildByName("rForm");
trace(form) // returns null
UPDATE
If I list objects I get
_level0.regFormSP.instance20.rForm
There is an object "instance20" as a parent to rForm...Why is that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实例 20
可能是 Flash 遮罩和滚动的滚动窗格内的未命名容器。根据文档,ScrollPane.content 是对您使用 ScrollPane.source 分配的显示对象的引用。鉴于此,regFormSP.content
应该是您的表单,而不是其子表单。http://livedocs.adobe.com/flash/9.0 /ActionScriptLangRefV3/fl/containers/ScrollPane.html#content
instance 20
is probably an unnamed container inside the scroll pane that Flash masks and scrolls. According to the docs, ScrollPane.content is a reference to the display object you assign using ScrollPane.source. Given that,regFormSP.content
should be your form, and not child thereof.http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/containers/ScrollPane.html#content