2 Replies Latest reply on May 7, 2012 10:51 PM by Manjith C.M.

    External swf size issue

    Manjith C.M. Level 1

      Hai....

       

      how get swf width and height using loader ,we are getting different values ....

       

       

       

      // Fla document size is 550 X 400,but we are getting 500 X 375...

       

       

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                           xmlns:s="library://ns.adobe.com/flex/spark"

                                                           xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="windowedapplication1_applicationCompleteHandler(event)">

       

                <fx:Script>

                          <![CDATA[

                                    import flash.display.*;

       

                                    import mx.events.FlexEvent;

       

                                    private var req:String="sample.swf"

                                    private var myLoader:Loader = new Loader();                  

                                    private var urls:URLRequest = new URLRequest(req);

       

                                    private function onloaded(e:Event):void{

       

       

       

                                              var mc:MovieClip=MovieClip(e.currentTarget.content);

       

                                              mc.stop();

       

                                              holder.addChild(myLoader);

       

                                              trace(myLoader.loaderInfo.width,myLoader.loaderInfo.height)

       

                                    }

       

       

                                    protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void

                                    {

                                              myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onloaded);

       

                                              myLoader.load(urls);

                                    }

       

                          ]]>

                </fx:Script>

       

       

                <fx:Declarations>

                          <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

                <mx:UIComponent id="holder"/>

                <!--<mx:SWFLoader source="swf/air_new.swf"/>-->

      </s:WindowedApplication>

       

       

       

      Thanks...