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
Solved

Flexible sized Flash movie - with minimum dimensions

Posted on 2009-05-13
1
249 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
1 Comment
 
LVL 8

Accepted Solution

by:
wal_toor earned 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

856 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