Search code examples
swfloaderstageflex4

flex 4 swfloader: SWFLoader.content.stage.width and height returns the main stage width and height


When I load a flash application using SWFLoader, the Stage width and height of the loaded application becomes the stage of the main flex application. so if i created a game that uses stage width and height to calculate where to draw, it actually draws outside of the bounds of the loaded application stage because it gets the width and height of the entire screen. how can i resolve this issue?

thanks


Solution

  • This is a common mistake, Use stage.stageWidth and stage.stageHeight.