Skip navigation
mdnavaz
Currently Being Moderated

Specifying external SWF width & height problem?

May 3, 2012 12:06 AM

Hi,

 

The following code is cute:

 

var Xpos:Number = 0;
var Ypos:Number = 0;

var SWF:MovieClip;

var loader:Loader = new Loader();

loader.x = Xpos;
loader.y = Ypos;

 

var newSWFRequest:URLRequest = new URLRequest("HandBook.swf");
loader.load(newSWFRequest);

BookHolder.addChild(loader);

 

The problem comes only when I add the following 2 lines at the bottom of the code:

The "HandBook.swf" external file doesn't load andy no any error as well. Where I did the mistake?

 

loader.width = 600;
loader.height= 400;

 

(Note: Actual "HandBook.swf" file width & heigt is 1000 x 700)

Please help me.

 
Replies
  • Currently Being Moderated
    May 3, 2012 4:10 AM   in reply to mdnavaz

    When you are trying to load anything through the loader, it doesn't allow to specify its height and width. If you specify those, object doesn't displayed on the stage. I dont know the exact reason. But I experienced it many times. Instead fo loading swf, load swc file of that component and pass height and width as you want.

     
    |
    Mark as:
  • Currently Being Moderated
    May 3, 2012 4:55 AM   in reply to mdnavaz

    YOu need to wait until the file is loaded until you can adjust width/height values.  I do believe you could adjust the scaleX and scaleY properties of the loader ahead of time though..

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points