resizing movie clip on stage with stage.onResize
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Macromedia Flash Server > resizing movie clip on stage with stage.onResize




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    resizing movie clip on stage with stage.onResize  
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@publi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

To explain what I'm trying to do, I'll keep it simple.  I've got a
rectange on the stage with dimensions 720 by 540.  The height is 75% of
the width.

My movie is published at 100%.  I can easily size the rectangle to
Stage.width and Stage.height.  How can I resize the stage, but have the
rectangle maintain it's aspect ratio.  If I change the Stage.width, the
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
daz lee


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

I used something similar to this inside my AV component I built, pretty =
simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) {
;
if (newWidth<newHeight) {
var returnWidth =3D newWidth;
var returnHeight =3D newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight =3D newHeight;
var returnWidth =3D newHeight*(originalWidth/originalHeight);
}else{
var returnHeight =3D newHeight;
var returnWidth =3D newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com>=20
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>=20
Cc: 'FlashComm Mailing List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLH
Nm@public.gmane.org> ; =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>=20
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a=20
rectange on the stage with dimensions 720 by 540.  The height is 75% =
of=20
the width.

My movie is published at 100%.  I can easily size the rectangle to=20
Stage.width and Stage.height.  How can I resize the stage, but have =
the=20
rectangle maintain it's aspect ratio.  If I change the Stage.width, =
the=20
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
daz lee


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

sorry maybe I should clarify, the first two args are the aspect ratio, =
then you pass the maximum width it has and the maximum height it can =
have and it will fit it best as it can in the same aspect ratio=20

hope this helps
----- Original Message -----=20
From: daz lee<mailto:dazlee4-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>=20
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>=20
Sent: Monday, May 23, 2005 8:55 PM
Subject: Re: [FlashComm] resizing movie clip on stage with =
stage.onResize


I used something similar to this inside my AV component I built, =
pretty simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) =
{
if (newWidth<newHeight) {
var returnWidth =3D newWidth;
var returnHeight =3D newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight =3D newHeight;
var returnWidth =3D newHeight*(originalWidth/originalHeight);
}else{
var returnHeight =3D newHeight;
var returnWidth =3D newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com<mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:
Brandon_Krakowsky@Ma=
xwellTrain.com>>=20
To: FlashComm Mailing =
List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mail
to:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mai
lto:flashcomm@chattyfig.f=
igleaf.com>> ; =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com<mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@publ
ic.gmane.org<mailto:flash=
comm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=20
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with =
stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a=20
rectange on the stage with dimensions 720 by 540.  The height is 75% =
of=20
the width.

My movie is published at 100%.  I can easily size the rectangle to=20
Stage.width and Stage.height.  How can I resize the stage, but have =
the=20
rectangle maintain it's aspect ratio.  If I change the Stage.width, =
the=20
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/<http://www.figleaf.com<htt=
p://www.figleaf.com/>>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.figleaf.com/mailm=
an/listinfo/flashcomm<http://chattyfig.figleaf.com/mailman/listinfo/flash=
comm>>

=3D---------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D---------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@publi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

I'm not sure what any o these parameters are:
originalWidth, originalHeight, newWidth, newHeight

I'm resizing the rectangle with the following:

stageListener = new Object();
stageListener.onResize = function () {
//resize rectangle width according to Stage.width AND rectangle
height
//resize rectangle height according to Stage.height AND rectangle
width
}
Stage.addListener(stageListener);


It's almost like a loop.  I can't figure out how to do it both ways.  I
can figure out how to do ONLY the width or ONLY the height.

rectangle._width  = Stage.width;
rectangle._height = rectangle._width * .75;

But then how to calculate the rectangle._width if the Stage.height is
being affected?






"daz lee" <dazlee4-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Sent by: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gm
ane.org>


To
"FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.
gmane.org>
cc

Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I used something similar to this inside my AV component I built, pretty
simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) {
;
if (newWidth<newHeight) {
var returnWidth = newWidth;
var returnHeight = newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight = newHeight;
var returnWidth = newHeight*(originalWidth/originalHeight);
}else{
var returnHeight = newHeight;
var returnWidth = newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----
From: Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org>
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>
Cc: 'FlashComm Mailing List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLH
Nm@public.gmane.org> ;
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a
rectange on the stage with dimensions 720 by 540.  The height is 75% of
the width.

My movie is published at 100%.  I can easily size the rectangle to
Stage.width and Stage.height.  How can I resize the stage, but have the
rectangle maintain it's aspect ratio.  If I change the Stage.width, the
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com<
http://www.figleaf.com/>
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@publi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

Nevermind man.  You got it.  That worked!
Thanks again.

Big help!





Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org
Sent by: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
05/23/2005 04:07 PM
Please respond to
FlashComm Mailing List <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gm
ane.org>


To
FlashComm Mailing List <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gm
ane.org>
cc
"FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.
gmane.org>,
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I'm not sure what any o these parameters are:
originalWidth, originalHeight, newWidth, newHeight

I'm resizing the rectangle with the following:

stageListener = new Object();
stageListener.onResize = function () {
//resize rectangle width according to Stage.width AND rectangle
height
//resize rectangle height according to Stage.height AND rectangle
width
}
Stage.addListener(stageListener);


It's almost like a loop.  I can't figure out how to do it both ways.  I
can figure out how to do ONLY the width or ONLY the height.

rectangle._width  = Stage.width;
rectangle._height = rectangle._width * .75;

But then how to calculate the rectangle._width if the Stage.height is
being affected?






"daz lee" <dazlee4-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Sent by: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gm
ane.org>


To
"FlashComm Mailing List" <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.
gmane.org>
cc

Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I used something similar to this inside my AV component I built, pretty
simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) {
;
if (newWidth<newHeight) {
var returnWidth = newWidth;
var returnHeight = newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight = newHeight;
var returnWidth = newHeight*(originalWidth/originalHeight);
}else{
var returnHeight = newHeight;
var returnWidth = newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----
From: Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org>
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>
Cc: 'FlashComm Mailing List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLH
Nm@public.gmane.org> ;
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a
rectange on the stage with dimensions 720 by 540.  The height is 75% of
the width.

My movie is published at 100%.  I can easily size the rectangle to
Stage.width and Stage.height.  How can I resize the stage, but have the
rectangle maintain it's aspect ratio.  If I change the Stage.width, the
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com<
http://www.figleaf.com/>
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
daz lee


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

lmao you still want my reply? lol nm
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com>=20
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>=20
Cc: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org> ; =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>=20
Sent: Monday, May 23, 2005 9:10 PM
Subject: Re: [FlashComm] resizing movie clip on stage with =
stage.onResize


Nevermind man.  You got it.  That worked!
Thanks again.

Big help!





=
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 04:07 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



To
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=

cc
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=
,=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>
Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I'm not sure what any o these parameters are:
originalWidth, originalHeight, newWidth, newHeight

I'm resizing the rectangle with the following:

stageListener =3D new Object();=20
stageListener.onResize =3D function () {
//resize rectangle width according to Stage.width AND =
rectangle=20
height
//resize rectangle height according to Stage.height AND =
rectangle=20
width
}
Stage.addListener(stageListener);


It's almost like a loop.  I can't figure out how to do it both ways.  =
I=20
can figure out how to do ONLY the width or ONLY the height.

rectangle._width  =3D Stage.width;
rectangle._height =3D rectangle._width * .75;

But then how to calculate the rectangle._width if the Stage.height is=20
being affected?






"daz lee" <dazlee4-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org<mailto:dazlee4-Pk
bjNfxxIARBDgjK7y7TUQ@public.gmane.org>>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



To
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=

cc

Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I used something similar to this inside my AV component I built, =
pretty=20
simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) =
{
if (newWidth<newHeight) {
var returnWidth =3D newWidth;
var returnHeight =3D newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight =3D newHeight;
var returnWidth =3D newHeight*(originalWidth/originalHeight);
}else{
var returnHeight =3D newHeight;
var returnWidth =3D newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com><
=
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Bran
don_Krakowsky@Maxwel=
lTrain.com>>=20
To: FlashComm Mailing =
List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mail
to:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mai
lto:flashcomm@chattyfig.f=
igleaf.com>> ;=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com><
=
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<m
ailto:flashcomm-bounces@c=
hattyfig.figleaf.com>>=20
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with =
stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a=20
rectange on the stage with dimensions 720 by 540.  The height is 75% =
of=20
the width.

My movie is published at 100%.  I can easily size the rectangle to=20
Stage.width and Stage.height.  How can I resize the stage, but have =
the=20
rectangle maintain it's aspect ratio.  If I change the Stage.width, =
the=20
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/><
http://www.figleaf.com/<http://www.figleaf.com/>>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm><
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>>

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>


=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>


=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: resizing movie clip on stage with stage.onResize  
daz lee


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-05 01:45 AM

Ok well my function is more than you need, because when I wrote this I =
was building a Camera container that wrapped cameras, resized them, =
fitted them, best to rows etc it was not a happy calculation and by the =
end of it I chose a different way lol but never throw out an old fla if =
it works.

My function also finds the best fit, but if you just want to keep it in =
aspect, well it depends on which is your bigger side but assuming width =
is your biggest size try:

stageListener =3D new Object();=20
stageListener.onResize =3D function () {
var NewWidth =3D Stage.Width; =20
var OriginalWidth =3D 200;
var OriginalHeight =3D 100;

rectangle._width =3D NewWidth;
rectangle._height =3D newWidth*(originalHeight/originalWidth);

}

(I didn't write this reply for nothing, maybe you will understand it =
with this reply instead of just using the function :D)
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com>=20
To: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org>=20
Cc: FlashComm Mailing List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm
@public.gmane.org> ; =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>=20
Sent: Monday, May 23, 2005 9:07 PM
Subject: Re: [FlashComm] resizing movie clip on stage with =
stage.onResize


I'm not sure what any o these parameters are:
originalWidth, originalHeight, newWidth, newHeight

I'm resizing the rectangle with the following:

stageListener =3D new Object();=20
stageListener.onResize =3D function () {
//resize rectangle width according to Stage.width AND =
rectangle=20
height
//resize rectangle height according to Stage.height AND =
rectangle=20
width
}
Stage.addListener(stageListener);


It's almost like a loop.  I can't figure out how to do it both ways.  =
I=20
can figure out how to do ONLY the width or ONLY the height.

rectangle._width  =3D Stage.width;
rectangle._height =3D rectangle._width * .75;

But then how to calculate the rectangle._width if the Stage.height is=20
being affected?






"daz lee" <dazlee4-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org<mailto:dazlee4-Pk
bjNfxxIARBDgjK7y7TUQ@public.gmane.org>>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



To
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcom
m-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=

cc

Subject
Re: [FlashComm] resizing movie clip on stage with stage.onResize






I used something similar to this inside my AV component I built, =
pretty=20
simple:

function scaleSize(originalWidth, originalHeight, newWidth, newHeight) =
{
if (newWidth<newHeight) {
var returnWidth =3D newWidth;
var returnHeight =3D newWidth*(originalHeight/originalWidth);
} else if (newWidth>newHeight) {
var returnHeight =3D newHeight;
var returnWidth =3D newHeight*(originalWidth/originalHeight);
}else{
var returnHeight =3D newHeight;
var returnWidth =3D newWidth;
}
return {width:returnWidth, height:returnHeight};
}
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Kra
kowsky@MaxwellTrain.=
com><
=
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Bran
don_Krakowsky@Maxwel=
lTrain.com>>=20
To: FlashComm Mailing =
List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mail
to:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mai
lto:flashcomm@chattyfig.f=
igleaf.com>> ;=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:f
lashcomm-bounces@chattyfi=
g.figleaf.com><
=
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<m
ailto:flashcomm-bounces@c=
hattyfig.figleaf.com>>=20
Sent: Monday, May 23, 2005 8:54 PM
Subject: [FlashComm] resizing movie clip on stage with =
stage.onResize


To explain what I'm trying to do, I'll keep it simple.  I've got a=20
rectange on the stage with dimensions 720 by 540.  The height is 75% =
of=20
the width.

My movie is published at 100%.  I can easily size the rectangle to=20
Stage.width and Stage.height.  How can I resize the stage, but have =
the=20
rectangle maintain it's aspect ratio.  If I change the Stage.width, =
the=20
rectangle's height will be affected accordingly?

Know what I mean?

Thanks,
Brandon Lee

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/><
http://www.figleaf.com/<http://www.figleaf.com/>>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm><
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>>

=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>


=3D-----------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<http://chattyfig.=
figleaf.com/mailman/listinfo/flashcomm>

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:59 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register