Macromedia Flash Server - resizing movie clip on stage with stage.onResize

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > May 2005 > resizing movie clip on stage with stage.onResize





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

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

2005-05-23, 8:45 pm

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

daz lee

2005-05-23, 8:45 pm

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_Krakowsky@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:flashcomm-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

daz lee

2005-05-23, 8:45 pm

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_Krakowsky@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<mailto:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm@chattyfig.f=
igleaf.com>> ; =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com<mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.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

Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@publi

2005-05-23, 8:45 pm

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.gmane.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/9ZfFG6BLHNm@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

Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@publi

2005-05-23, 8:45 pm

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.gmane.org>


To
FlashComm Mailing List <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.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.gmane.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/9ZfFG6BLHNm@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

daz lee

2005-05-23, 8:45 pm

lmao you still want my reply? lol nm
----- Original Message -----=20
From: =
Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Krakowsky@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:flashcomm-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_Krakowsky@MaxwellTrain.=
com>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 04:07 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



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

cc
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=
,=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-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-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



To
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto: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=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_Krakowsky@MaxwellTrain.=
com><
=
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Krakowsky@Maxwel=
lTrain.com>>=20
To: FlashComm Mailing =
List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm@chattyfig.f=
igleaf.com>> ;=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com><
=
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto: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

daz lee

2005-05-23, 8:45 pm

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_Krakowsky@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:flashcomm-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-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>>=20
Sent by: =
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com>
05/23/2005 03:55 PM
Please respond to
FlashComm Mailing List =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>>=



To
"FlashComm Mailing List" =
<flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto: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=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_Krakowsky@MaxwellTrain.=
com><
=
mailto:Brandon_Krakowsky-A5pIpylr7pFSljaRc5+PrA@public.gmane.org<mailto:Brandon_Krakowsky@Maxwel=
lTrain.com>>=20
To: FlashComm Mailing =
List<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD1Awfrwidz33g@public.gmane.org=
gleaf.com>>=20
Cc: 'FlashComm Mailing =
List'<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm@chattyfig.f=
igleaf.com>> ;=20
=
flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-bounces@chattyfi=
g.figleaf.com><
=
mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto: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

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com