I have problem with setting width and height of a movieclip. What i do is create new movieclip add it to stage and then resize and reposition it.
public class mcMainContent extends MovieClip
{
var _myStage:Stage;
public function mcMainContent()
{
}
public function ResizeAndReposition(leftContent:MovieClip,rightContent:MovieClip,myStage:Stage)
{
_myStage = myStage;
x = leftContent.width + 10;
width = _myStage.stageWidth - leftContent.width - rightContent.width - 10;
trace("calculated width: " + (_myStage.stageWidth - leftContent.width - rightContent.width - 10) + ", width of element: " + width);
}
public function Resize()
{
}
public function Reposition()
{
}
}
I always get width of my movieclip to be 0 even if calculated value is always other number. I tried to call this function before I add movieclip to stage, after I add movieclip to stage but it's width is always 0. Thank you