儿童影片剪辑不根据父影片剪辑显示其宽度和高度
我在 flash 中放置了 3 个名为 mcParent、mcChild1、mcChild2 的影片剪辑和 1 个文本框。孩子是父母影片剪辑的孩子。 child1 和 child2 的大小均为 300,而父 movieclip 的大小为 600px,文本框放置在 child2 movieclip 内。我已经使闪光灯根据屏幕区域自动调整大小。一切正常,但调整大小后,它会调整父项、所有子项和文本框的大小,这是正确的。问题在于 mcChild2 上文本框的正确放置。我发现调整大小后,mcParent 宽度和缩放比例都会发生变化,但子剪辑即使拉伸也不会改变其大小,但尺寸不会更新,因此我无法获取放置文本框的确切位置。
任何帮助我们在调整大小后获得子剪辑的确切大小将不胜感激。
谢谢。
I have placed 3 movieclips named mcParent, mcChild1, mcChild2 and 1 textbox in flash. child are childrens of parent movie clip. child1 and child2 both are of sizes 300 whereas parent movieclip is 600px, textbox is placed inside child2 movie clip . I have made the flash to auto resize according to the screen area. Everything works well, but after resize it resizes parent and all childrens and textbox which is correct. The problem is with the correct placement of textbox on mcChild2. I have seen that after resize, mcParent width and scalex both changes but the child clips doesn't changed its sizes even they are stretched but there sizes are not updated due to which I am unable to get the exact location of where to place the textbox.
Any help would be appreciated to get the exact size of the child clips after resize.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,您必须使用父影片剪辑的大小。
另一个不太干净的替代方案是在父级内部放置一个小(1x1 方形)影片剪辑,作为文本字段应放置位置的指示符。然后,在调整舞台大小时,您必须使用
localToGlobal
来了解尺寸更改后该小 mc 的位置。使用该信息来定位文本字段。You have to use the size of the parent movieclip in this case.
Another not-so-clean alternative is to put a small (1x1 square) movieclip inside the parent, as an indicator to where the textfield should be placed. Then, on stage resize you'll have to use
localToGlobal
to know the location of that small mc after the dimensions changed. Use that info to position the textfield.