IT Community - Software Programming, Web Development and Technical Support

Stage and Background resize but other objects not to resize

This is a discussion on Stage and Background resize but other objects not to resize within the Flash Actionscript Programming forums, part of the Web Development category; Hi I'm simply looking to resize the stage but need to keep everything to scale. For example having the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-20-2007, 07:50 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 71
aramesh is on a distinguished road
Default Stage and Background resize but other objects not to resize

Hi

I'm simply looking to resize the stage but need to keep everything to scale. For example having the foreground at a fixed size but a background image to scale to the browser's height and width, keeping the image's dimensions intact (no 'stretchy-ness')

So the background image will take it's height and width from the available browser area and scale the image to fit accordingly.

-So if your browser window is long and thin the background image will be aligned top-left and canvas space will be visible on the side of the image. And like wise if the browser is tall space will be at the bottom. (ie: so i can fill those cinema displays!)

Can anyone point me in right direction?
<aramesh>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-22-2007, 10:33 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Stage and Background resize but other objects not to resize

Hi,
Use the following code to keep the foreground at fixed size and resize the background image. In this bgmc is a movieclip which holds an background image, and txt1 is the text box. Write the following codes in main time line. Embed the flash in html page and set its width and height to 100%. When we resize the html page the background image is set to the browser with height, and the text box is not scale and set on the left side of the stage(ie, on left side of the browser window).

Stage.scaleMode="noScale";
Stage.align="LT";

bgmc._width=Stage.width;
bgmc._height=Stage.height;
txt1._x=Stage.width-txt1._width;

var stageListener:Object=new Object();
Stage.addListener(stageListener);
stageListener.onResize=function(){
bgmc._width=Stage.width;
bgmc._height=Stage.height;
txt1._x=Stage.width-txt1._width;
}
Attached Files
File Type: zip StageResize.zip (37.7 KB, 2 views)
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...

Last edited by oxygen : 08-22-2007 at 10:37 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop Background Problem it.wily Operating Systems 13 01-10-2008 08:34 PM
How to resize a visitor's browser? jeyaprakash.c HTML, CSS and Javascript Coding Techniques 4 10-14-2007 09:20 PM
Info on background process in PHP sivaramakrishnan PHP Programming 4 08-14-2007 08:22 AM
Auto Resize Applications in J2ME ? itbarota J2ME 7 08-09-2007 12:06 AM
what is the latency of an instruction in a 5 stage machine? vadivelanvaidyanathan C and C++ Programming 0 07-16-2007 10:23 PM


All times are GMT -7. The time now is 02:07 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0