?
Solved

Flexible sized Flash movie - with minimum dimensions

Posted on 2009-05-13
1
Medium Priority
?
252 Views
Last Modified: 2013-11-11
I've got a stretchable flash movie with 2 key elements... a signature running 100% width anchored to the bottom of the stage, and a tag line of fixed size, anchored to the top right corner of the stage.

I've got the following code which was written to make this all work attached below.

What I want to do is somehow set a minimum size, for the flash file, so that if the browser window shrinks any further, the top right tag line won't move any further to the left. At the same point the signature won't shrink anymore and won't move any further up (so if they keep shrinking the window, these elements effectively become partially off-stage)

Ideally it would be when it reaches 670 x 670 that elements stop resizing/moving

Hope that makes sense! sorry I can't post any screenshots because it's sensitive client work.

thanks,
TM
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
 
stage.addEventListener(Event.RESIZE, resizeListener);
 
var signatureSizeRatio:Number;
signatureSizeRatio = signature.width/signature.height;
 
function resizeListener(e:Event):void {
	resizeStageElements();
}
 
function resizeStageElements()
{
	trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
	welcomeText.x = stage.stageWidth - 406;
	gradientBG.width = stage.stageWidth;
	signature.y = stage.stageHeight - 30;
	signature.width = stage.stageWidth;
	signature.height = stage.stageWidth / signatureSizeRatio;
}
 
resizeStageElements();

Open in new window

0
Comment
Question by:ARMSTRONG_CRAVEN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
wal_toor earned 150 total points
ID: 24385773
Hellow armstrong,

What if you put an if statement in you resize function? Does this work for you?

greetz,
walter
function resizeStageElements()
{
	if(stage.stageWidth > 670 || stage.stageHeight > 670){
        trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
        welcomeText.x = stage.stageWidth - 406;
        gradientBG.width = stage.stageWidth;
        signature.y = stage.stageHeight - 30;
        signature.width = stage.stageWidth;
        signature.height = stage.stageWidth / signatureSizeRatio;
	}
}

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question