1 Reply Latest reply on Jul 29, 2012 9:56 PM by Flex harUI

    Why a DisplayObject loaded using SWFLoader gets huge and wrong width / height values ?

    julien.63

      Hi,

      Like I said in the title, I'm loading a swf using a SWFLoader:

       

      <mx:SWFLoader source="images/mcplan.swf" id="planLoader" 
                                                scaleContent="true" 
                                                autoLoad="true" 
                                                width="740" height="614" y="0" x="20"
                                                addedToStage="planLoader_addedToStageHandler(event)" />
      
      

       

      Then, in the event handler, I fetch an object in the displayList :

       

      protected function planLoader_addedToStageHandler(event:Event):void
      {
      ...
             var plan:DisplayObject = Helper.getChildByNameRecursiv("mcplan", planLoader.content as DisplayObjectContainer);
      ...
      }
      

       

      But at that moment, the "plan" object width and height values are respectively 5.20751715E7 and 1.95268428E7. It looks ok on the screen. But if I try to change it (for fullscreen for instance) then it just doesn't work because the size of my screen is ridiculously small compare to those values...

       

      I can't understand how I could get the real values for that.

       

      Any suggestion?