Search code examples
flashactionscript-3parent

children movieclips doesn't show its width and height according to parent movieclip


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.


Solution

  • 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.