Re: [Flashcoders] external jpg resize script

2005-12-07 Thread Ramon Tayag
Hi,

You can resize the stage real time?  I wasn't aware of that.  If you
mean you want to resize the picture when it loads to whatever the
stage is, use MovieClipLoader.

Read up on it, and pay particular attention to onLoadInit - that's
where you put your resize code.

Mon

On 12/7/05, Brumm, Mike [EMAIL PROTECTED] wrote:
 Hello,



 I'm probably missing something very simple here. I would like to load an
 external jpg into a movieclip. When the user resizes the stage, the width
 and height of the jpg match that of the stage. The below script does not
 seem to be working. I can't seem to figure out what's missing. Any ideas?



 Thanks in advance,

 Mike





 //SET STAGE PROPERTIES

 Stage.showMenu = false;

 Stage.scaleMode = noScale;

 Stage.align = LT;



 //RESIZE EXTERNAL JPG

 var tmp:MovieClip;

 tmp = this.createEmptyMovieClip(bgExpand_mc, 1);

 tmp.loadMovie(images/background/bg_image1.jpg);



 tmp.onResize = function(){

 this._width = Stage.width;

 this._height = Stage.height;

 }



 Stage.addListener(tmp);







 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
Ramon Miguel M. Tayag
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] external jpg resize script

2005-12-07 Thread Timothee


 tmp.loadMovie(images/background/bg_image1.jpg);
 tmp.onResize = function() {
 this._width = Stage.width;
 this._height = Stage.height;
 }
 Stage.addListener(tmp);

The onResize handler will be destroyed when the image is done loading.
There are several ways to achieve what you want, here are some:
- assign the resize handler after the jpg has been successfully loaded (use
a Loader class)
- create your movieclip and another nested inside. Load your image in the
nested clip and add the resize handler on the outer clip
- use an external controller for the resizing.

Tim

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] external jpg resize script

2005-12-07 Thread GregoryN
Hello Mike,

You should use another object (Object) as listener.
Just replace your code with the following:

//SET STAGE PROPERTIES
Stage.showMenu = false;
Stage.scaleMode = noScale;
Stage.align = LT;

//RESIZE EXTERNAL JPG
var tmp:MovieClip;
tmp = this.createEmptyMovieClip(bgExpand_mc, 1);
tmp.loadMovie(img4test/r02.jpg);

var tmp1:Object = new Object();
tmp1.onResize = function(){
_root.tmp._width = Stage.width;
   _root.tmp._height = Stage.height;
};

Stage.addListener(tmp1);



//  It will work ;-).



-- 
Best regards,
 GregoryN

http://GOusable.com
Flash components development.
Usability services.

 Date: Tue, 6 Dec 2005 12:09:34 -0600
 From: Brumm, Mike [EMAIL PROTECTED]
 Subject: [Flashcoders] external jpg resize script
 To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
 Message-ID: [EMAIL PROTECTED]
 Content-Type: text/plain;   charset=US-ASCII
 
 Hello,
 
  
 
 I'm probably missing something very simple here. I would like to load an
 external jpg into a movieclip. When the user resizes the stage, the width
 and height of the jpg match that of the stage. The below script does not
 seem to be working. I can't seem to figure out what's missing. Any ideas?
 
  
 
 Thanks in advance,
 
 Mike
 
  
 
  
 
 //SET STAGE PROPERTIES
 
 Stage.showMenu = false;
 
 Stage.scaleMode = noScale;
 
 Stage.align = LT;
 
  
 
 //RESIZE EXTERNAL JPG
 
 var tmp:MovieClip;
 
 tmp = this.createEmptyMovieClip(bgExpand_mc, 1);
 
 tmp.loadMovie(images/background/bg_image1.jpg);
 
  
 
 tmp.onResize = function(){
 
 this._width = Stage.width;
 
 this._height = Stage.height;
 
 }   
 
  
 
 Stage.addListener(tmp);
 
  
 
  
 
  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] external jpg resize script

2005-12-06 Thread Brumm, Mike
Hello,

 

I'm probably missing something very simple here. I would like to load an
external jpg into a movieclip. When the user resizes the stage, the width
and height of the jpg match that of the stage. The below script does not
seem to be working. I can't seem to figure out what's missing. Any ideas?

 

Thanks in advance,

Mike

 

 

//SET STAGE PROPERTIES

Stage.showMenu = false;

Stage.scaleMode = noScale;

Stage.align = LT;

 

//RESIZE EXTERNAL JPG

var tmp:MovieClip;

tmp = this.createEmptyMovieClip(bgExpand_mc, 1);

tmp.loadMovie(images/background/bg_image1.jpg);

 

tmp.onResize = function(){

this._width = Stage.width;

this._height = Stage.height;

}   

 

Stage.addListener(tmp);

 

 

 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders