I thought this would be straight forward but I'm having trouble repositioning my content.
I have a button instance named rollOne
, When I roll over the button I want to load an swf object but not on top of the button so I want to find out what the button's width is so I can reposition the dynamically loaded content. I thought rollOne.width
would return the width, but it only returns 0
the same goes for height.
Any suggestions would be much appreciated.
rollOne.addEventListener(MouseEvent.MOUSE_OVER, fetchQty);
function fetchQty(event:MouseEvent):void
{
myContainer.x = (rollOne.x + rollOne.width);
myContainer.y = (rollOne.y + rollOne.height);
var img1Request:URLRequest = new URLRequest("8032697883620.swf");
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myContainer.addChild(img1Loader);
trace(rollOne.width);
}