Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Flash "dynamic" Background Resizing



Hello-

I'm dying to figure out how www.dunun.com pulled off that slick background effect - it resizes to accomodate the Height and Width of the browser window, but keeps all the elements the same size. So slick! I want to do the same thing... Any ideas?

Thanks in advance!



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-02-01


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Resizing Tiled Background In Flash 8
Hello,

I've checked out this tutorial, and it's great:

http://www.kirupa.com/developer/flas...und_flash8.htm

But, is there a way, to make the background scale, when you resize the movie. I made this AS code:


Code:
import flash.display.BitmapData;
var tile:BitmapData = BitmapData.loadBitmap("pattern");
this.beginBitmapFill(tile);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill();
//-----------------------
sizeListener = new Object();
sizeListener.onResize = function() {
var tile:BitmapData = BitmapData.loadBitmap("pattern");
this.beginBitmapFill(tile);
this.lineTo(Stage.width, 0);
this.lineTo(Stage.width, Stage.height);
this.lineTo(0, Stage.height);
this.lineTo(0, 0);
this.endFill();
};
Stage.addListener(sizeListener);
But it doesn't work... I'm confused, what should I do?..

[MX] Resizing Onlny Background Of Your Flash Movie
Hi all,

I have been searching for quite a while on this issue and cannot find the answer. I am after resizing only parts of my flash movie to the web browser and am having difficulties getting the particular solution.

An tutorial site:http://www.tutorio.com/tutorial/liquid-flash-layout
explains that you need to use a couple of lines to turn off scaling , then add a listener to see if the browser is resizing the movie.

What i am struggling with is how to apply the resizing to only a layer - and maintain the rest, so that my JPEGS do not become crap!

Thanks in advance,
James

Resizing Background At Flash Full Page
Hey guys.

So here is my problem.
I have full page flash web site with background sized at 1000px*900px.
The thing I want is that when users browser is bigger than 1000*900, background image would start resizing.

I saw sites like this out there, but I can't find them at the moment.

Hope you understand what I mean. Thanks for all the help.

Regards,
CoreySteel

Background Resizing
Hi, i need to resize the background of my .swf, i'm trying to do this but always resizing the entire swf !!. I want all my .swf centered in X & Y and NO scaling, but the background "stretch" to fill the window, just like the ATT .jpg

In the .jpg the orange zone is my main movie, and the gray zone is the background, both are my .swf


PD: I'm working on MX2004 & AS1 (i know)

Background Resizing
If I am loading in backgrounds to the stage at a size of 1280x1024 - is there a way to make the background resize itself too 1024x768 if the resolution is changed or the user is using that resolution (not worried about 800x600...)?

I know about stage listeners ect but I can't seem to figure out how it would be done.

thanks for any help, cheers

Background Resizing
i found a script that resizes background images and it works fine in flash 7.when i try to publish it flash 8 it does not work.can someone please help me with this issue.thank you very much.

Resizing A .jpg For A Background
I have a photo and would like to use it for my background. Except that everytime I use Fireworks.... modify/canvas/image size. the image is distorted from being increased.  Is there a way to increase it but not lose resolution?

Thank You

Tony

Background Resizing
Can anyone link me to a tutorial or tell me what this is referred to as.. I want my website to have the abillity for the background to be resizable. you know like if some one stretched the window bigger you would see more of the background.. lette me know if I need to explain it better. Thanks in advance guys.

Dynamic Resizing Flash Movie
Anyone have any idea how Media Division ( http://www.media-division.com )got their flash file to resize itself, as the user changes the size of their browser window? I was trying to do that trick aaaaages ago....gave up out of frustration.

Dynamic Resizing Of A Flash Movie?
I know this is a bit of a long shot, but I need a direction to go in.

I want to be able to dynamically resize a Flash movie window. Let's say the main Flash movie is 500x500, but is dynamically able to increase to 700x500. The additional 200 pixels of width would appear on the right side of the original 500x500. The additional width could simply be part of the Flash movie that is set off the stage, but perhaps using Javascript and CSS, the object/embed window could be widened.

A little background...

I have a multiplayer Flash game with built-in chat. For some players, chat is the main reason they play the game. The problem is, the chat window is only about 8 lines tall. I would like to have a button to make the chat taller. I envision a button that will cause the Flash movie window to WIDEN, showing a full-height chat window to the right of the
main game. The chat window would ideally reside in the same Flash movie, but I could perhaps create a second Flash movie that is just the full-height chat window, and then using ExternalInterface, tell it what the new chat messages are. The existence of the full-height chat window could be toggled on and off... and of course it needs to work in both major browsers.

Any suggestions?
THANKS VERY MUCH!

Resizing Dynamic Images (Flash 8)
I have searched forever trying to find out how to do this. All the tutorials or answers I find aren't quite what Im looking for so I figure it would just be best for me to try posting.

What I want to do is load an image dynamically into a movie clip either created physically inserting it onto the stage or using .createEmptyMovieclip(). After the image has been loaded I want to be able resize the movieclip with the image inside of it, or somehow get the .height and .width of the image or the movieclip with the image in it and then have it resize keeping its proper dimensions.

Ex:
I have an image that is say, 800x600. I want to be able to load that image in dynamically into 2 seperate movieclips (one being a main display, and one a smaller thumbnail). This way I don't have to have resize all the images into the main display size, and thumbnail size. I can just use the image and do all the work with actionscript.

I have tried using code similar to this:

_root.createEmptyMovieClip("load_pic", this.getNextHighestDepth);
_root.createEmptyMovieClip("load_thumb", this.getNextHighestDepth);

load_pic.loadMovie("my_pic.jpg");
load_thumb.loadMovie("my_pic.jpg");

load_pic.onLoad = function(success);
if(success){
this._x = this._x/2; //Hoping this would reduce the _x by half
this._y = this._y/2; //Same a above
};
};

load_thumbs.onLoad = function(success);
if(success){
this._x = this._x/6; //Hoping this would reduce the _x by half
this._y = this._y/6; //Same a above
};
};

Can this be done? Is this not the right way to do it? What would a better way to do this be? Or is the only way to have seperate folders with seperate images/sizes for thumbnails, etc.

Resizing Background To Fit Browser Like...
Beck.com.

I'm currently using the following actionscript and it works well....
__________________________________________________ ________
Stage.scaleMode = "noScale";
Stage.align = "LT";
bg.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
Stage.addListener(bg);

bg._x = bg._y = 0;
bg.onResize();



content.onResize = function() {
this._x = (Stage.width - this._width) / 2;
this._y = (Stage.height - this._height) / 2;
};
Stage.addListener(content);

content.onResize();
__________________________________________________ _____
but when the viewer resizes the browser window, everything goes haywire, losing its place.

Help, please!

Automatically Resizing Background
How would I set the background to resize and fill the entire browser automatically with whatever the users browser size is?

Also to center the website within that browser?

Auto-resizing Background
Dear Forums:

I'm attempting to build a Flash website. I've seen a technique where a background is automatically scaled and loaded, while a main website area remains the same size throughout the resizing.

More specifically, I have a background image that's 1680 X 1050. I'd like to resize it automatically in the background under various resolutions, while a small 520 X 420 area of the flash website itself sits on top.

Any insight into this would be kindly appreciated!

Thank you very much.

Why Isnt My Background Resizing?
Can anyone tell me what it is im doing wrong here? Im trying to get my background to size to stay consistent with the stage no matter how wide the screen is. I want to know whats wrong with my code that this isnt happening all of a sudden because it worked in a previous project i was working on. Here is the code:

stop();
id1 = setInterval(preloader, 100);

function preloader()
{
var gbt = getBytesTotal();
if(gbt < 100)
return;
var gbl = getBytesLoaded();
if(gbl >= gbt)
{
clearInterval(id1);
initialize();
}
}



function initialize()
{
startingSizeX = Stage.width; // get these values before setting noScale
startingSizeY = Stage.height;
Stage.scaleMode = "noScale"; // prevent menus from resizing
backdrop._width = Stage.width;
backdrop._height = Stage.height;


ContentoriginalX = 58;
ContentoriginalY = 158;


positionMenus(); // adjust menu position

// watch for resizing. When it occurs, resize the background picture
// to match the stage size.
// All the other objects remain the same size but we reposition
// the objects by the amount needed.
listener = new Object();
listener.onResize = function ()
{
// keep the background picture the same size as the stage
backdrop._width = Stage.width;
backdrop._height = Stage.height;
positionMenus(); // reposition the menus as needed
};
Stage.addListener(listener);
}

function positionMenus()
{
// how much difference is stage size now compared to the original size?
var diffSizeX = startingSizeX - Stage.width;
var diffSizeY = startingSizeY - Stage.height;

// add half the difference to the menu position
Content._x = ContentoriginalX + (diffSizeX / 2);
Content._y = ContentoriginalY + (diffSizeY / 2);

}

Any and all help is appreciated. Thanks

Resizing Background Grid
Size of grid in the background
I have an almost perfect swf for my needs; www.avgifter.com/forum/graftest2.asp.
My problem as a complete newbie on Flash is that I have no clue of how to change size of the grid in the background. I want the bars to reach higher in the diagram without just manipulate the values. The latter is done in the example.

What should I look for?

Resizing Background Grid
Size of grid in the background
I have an almost perfect swf for my needs; www.avgifter.com/forum/graftest2.asp.
My problem as a complete newbie on Flash is that I have no clue of how to change size of the grid in the background. I want the bars to reach higher in the diagram without just manipulate the values. The latter is done in the example.

What should I look for?

Image Resizing In Background
Hey,

I was looking for a way to resize an image in the background. I've completed a design, and because of some feedback they asked me to change a part of the layout. Because of that the background image has te resize with the browser so that the graphic beneath the navigation stays in the same place.

I'm hoping you'll understand what I mean, but if you don't, let me know, and I'll upload the design.

An example I found of a scaling background can be viewed at http://www.i-merge.net/


Thanks for the help!

Resizing Image Background
Hi all,

I'm looking for some help figuring out how to emulate the effect on http://www.nooflat.nu/ of the background resizing to accommodate the movie that is then dynamically imported.

I know how to dynamically resize the background, but I can't figure out how to put off importing the swf or image until the background is the correct size using Actionscript.

I'm really just looking for some guidance on this. Any suggestions, or suitable tutorials that anyone knows of.

Thanks!

Background Picture Resizing
If you go to THIS site you can see a nice background picture which resizes perfectly without loseing it's quality when you resize browser window. How is that done? I know you can tile your bitmap using BitmapData (where you just tile a bitmap sample accross the stage using onResize listener and Stage.width and Stage.height) but how do you dynamically resize background picture so perfectly without loosing it's quality? Can anyone provide a sample for this?

thanks

[Flash MX 2004] Script Dynamic Resizing
check http://www.evb.com

How do they do that? (I mean, the resizing with the square)

Cheers, Tim

That Fancy Dynamic Flash Movie Resizing...
People...has anyody got a cool solution?
I came up with (a long time ago) with the DOM based solution to dynamically control the movie's size...adjusting it by directly changing the OBJECT tag style attributes.
This worked fine on Windows Systems...but naturally didn't work on Mac+IE....

About one month after I found out this "really cool idea", someone told me that macromedia was publishing instructions on how to dynamically resize da movie...(I've never found such article...anyway).

I've now given a look at the MM site and they are using the iframe tag...which is not so widely supported..
It looks like it's working fine for my IE6 sp1 (plus on the next IE6 sp1b)...and on NN7.1.

BUT Netscape doesn't support the onResize event...so naturally Flash doesn't automatically get to trigger the Stage.onResize() event. (this means that for NN - and Opera - I have to manually reload the page - through JSP - and have the width-height variables be passed to Flash through the movie's url).

Is there any cooler and more compatible way of working this out?
I've never used the div tag, which I don't really know much about, a side from the fact that it's something very flexible.

Any suggestion greatly appreciated..

by the way, I'll might post a link for Apple users to test!

Resizing Background Based On Screen Res
Hello all,

Just registered after spending alot of time searching and lurking.

I have a problem that I have spent days trying to resolved and have not had much luck.

I am trying to accomplish something similar to the 2advanced website, the background image is edge to edge(without scroll bars) but the content is middle aligned and always stays the same size.

Thanks in advance for any help you all can provide.

AS3: Dynamically Resizing Background-picture
hi everybody.


I'm testing this idea of mine, but so far I've not been awarded succes.
so, here's what's my idea about:

I want to load a big background-picture into my Flash, and then I want it to be resized so it fits the screen-resolution that the user has on his/her browser.
see the example I've made so far, here:http://campjohn.dk/test/test100.html

it loads perfectly, and - from what I can see - keeps it's dimensions.
but it does not resize to the size of the browser as it should.
...if you go to the link, and then manually resize the browser-window, you'll get the resizing of the background-picture going on, though.

here's how it's all build:
I have a test100.fla with a test100.as Document Class

test100.as:

Code:
package {

import CustomBackgroundTest;

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;

public class test100 extends Sprite {

private var _customBackgroundTest:CustomBackgroundTest;

public function test100() {
init();
}

private function init():void {
stageInit();
customBackgroundTestInit();
firstResizing();
}

private function stageInit():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.BEST;
stage.frameRate = 30;
stage.showDefaultContextMenu = true;
stage.addEventListener(Event.RESIZE, onResize);
}

private function customBackgroundTestInit():void {
_customBackgroundTest = new CustomBackgroundTest(stage.stageWidth, stage.stageHeight);
addChild(_customBackgroundTest);
}

public function firstResizing():void {
_customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
}

public function onResize(event:Event):void {
_customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
}

}
}
see.. the init function calls a firstRezing-function which calls the same .onResize function as a manual resizing does.
so why does it only work when manually resizing the browser-window?

here's the customBackgroundTest.as:

Code:
package{

import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;

public class CustomBackgroundTest extends Sprite {
private var _loader:Loader;
private var _request:URLRequest;
private var _stageWidth:Number;
private var _stageHeight:Number;

public function CustomBackgroundTest(stageWidth:Number, stageHeight:Number) {
_stageWidth = stageWidth;
_stageHeight = stageHeight;

init();
}

private function init():void {
backgroundInit();
}

private function backgroundInit():void {
_loader = new Loader();
_request = new URLRequest("myBackground.jpg");
_loader.load(_request);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, setSize);

addChild(_loader);
}

private function setSize(e:Event):void {
_loader.width = 1600;
_loader.height = 1200;

_loader.removeEventListener(Event.COMPLETE, setSize);
}

public function onResize(stageWidth:Number, stageHeight:Number):void {
_stageWidth = stageWidth;
_stageHeight = stageHeight;

trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);

var ratio:Number = _loader.width / _loader.height;

if ((_stageWidth / ratio) >= _stageHeight) {
trace("_stageWidth / ratio");
trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
_loader.width = _stageWidth;
_loader.height = (_stageWidth / ratio);
trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height);
}
else {
trace("!_stageWidth / ratio");
trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
_loader.height = _stageHeight;
_loader.width = (_stageHeight * ratio);
trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height);
}

}

}
}
as you can see, there's lots of traces in .onResize function.
these I've used to trace, what is actually going on.

when the backgroundpicture is loaded at first the onResize-function traces this:
_stageWidth = 400 & _stageHeight = 300
_loader.width = 0 & _loader.height = 0

and when the .swf is manually resized this is what is traced out:
_stageWidth = 1087 & _stageHeight = 661
_loader.width = 1087 & _loader.height = 815.25

this might be the problem, but right now I'm too confused from looking at this over and over again... anyway, it seems strange, that the _loader.height which is set to the _stageHeight (which is 300) turns out to be 0!

all the files are downloadable here:http://campjohn.dk/test/resizing.zip
can anyone help me solve my problem?


thanks a lot
felisan

Dynamically Resizing Background Movie
Hi,

I run across this cool web site

http://www.hi-res.net/

I'd like to add that effect on my own page. Can anybody explain how you can insert a full-screen, scalable movie clip as the background, and put a static menu plus text on the foreground?

AS3: Dynamically Resizing Background-picture
hi everybody.


I'm testing this idea of mine, but so far I've not been awarded succes.
so, here's what's my idea about:

I want to load a big background-picture into my Flash, and then I want it to be resized so it fits the screen-resolution that the user has on his/her browser.


see the example I've made so far, here:

it loads perfectly, and - from what I can see - keeps it's dimensions.
but it does not resize to the size of the browser as it should.
...if you go to the link, and then manually resize the browser-window, you'll get the resizing of the background-picture going on, though.

here's how it's all build:
I have a test100.fla with a test100.as Document Class

test100.as:

Code:
package {

import CustomBackgroundTest;

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;

public class test100 extends Sprite {

private var _customBackgroundTest:CustomBackgroundTest;

public function test100() {
init();
}

private function init():void {
stageInit();
customBackgroundTestInit();
firstResizing();
}

private function stageInit():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.BEST;
stage.frameRate = 30;
stage.showDefaultContextMenu = true;
stage.addEventListener(Event.RESIZE, onResize);
}

private function customBackgroundTestInit():void {
_customBackgroundTest = new CustomBackgroundTest(stage.stageWidth, stage.stageHeight);
addChild(_customBackgroundTest);
}

public function firstResizing():void {
_customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
}

public function onResize(event:Event):void {
_customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
}

}
}
see.. the init function calls a firstRezing-function which calls the same .onResize function as a manual resizing does.
so why does it only work when manually resizing the browser-window?

here's the customBackgroundTest.as:

Code:
package{

import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;

public class CustomBackgroundTest extends Sprite {
private var _loader:Loader;
private var _request:URLRequest;
private var _stageWidth:Number;
private var _stageHeight:Number;

public function CustomBackgroundTest(stageWidth:Number, stageHeight:Number) {
_stageWidth = stageWidth;
_stageHeight = stageHeight;

init();
}

private function init():void {
backgroundInit();
}

private function backgroundInit():void {
_loader = new Loader();
_request = new URLRequest("myBackground.jpg");
_loader.load(_request);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, setSize);

addChild(_loader);
}

private function setSize(e:Event):void {
_loader.width = 1600;
_loader.height = 1200;

_loader.removeEventListener(Event.COMPLETE, setSize);
}

public function onResize(stageWidth:Number, stageHeight:Number):void {
_stageWidth = stageWidth;
_stageHeight = stageHeight;

trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);

var ratio:Number = _loader.width / _loader.height;

if ((_stageWidth / ratio) >= _stageHeight) {
trace("_stageWidth / ratio");
trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
_loader.width = _stageWidth;
_loader.height = (_stageWidth / ratio);
trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height);
}
else {
trace("!_stageWidth / ratio");
trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
_loader.height = _stageHeight;
_loader.width = (_stageHeight * ratio);
trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height);
}

}

}
}
as you can see, there's lots of traces in .onResize function.
these I've used to trace, what is actually going on.

when the backgroundpicture is loaded at first the onResize-function traces this:
_stageWidth = 400 & _stageHeight = 300
_loader.width = 0 & _loader.height = 0

and when the .swf is manually resized the is what is traced out:
_stageWidth = 1087 & _stageHeight = 661
_loader.width = 1087 & _loader.height = 815.25

this might be the problem, but right now I'm too confused from looking at this over and over again... anyway, it seems strange, that the _loader.height which is set to the _stageHeight (which is 300) turns out to be 0!



can anyone help me solve my problem?

all the files are downloadable here:


thanks a lot
felisan

AS3: Dynamically Resizing Background-picture
hi everybody.


I'm testing this idea of mine, but so far I've not been awarded succes.
so, here's what's my idea about:

I want to load a big background-picture into my Flash, and then I want it to be resized so it fits the screen-resolution that the user has on his/her browser.
see the example I've made so far, here:http://campjohn.dk/test/test100.html

it loads perfectly, and - from what I can see - keeps it's dimensions.
but it does not resize to the size of the browser as it should.
...if you go to the link, and then manually resize the browser-window, you'll get the resizing of the background-picture going on, though.

here's how it's all build:
I have a test100.fla with a test100.as Document Class

test100.as:
Code:

package {   

   import CustomBackgroundTest;

   import flash.display.Sprite;
   import flash.display.StageAlign;
   import flash.display.StageQuality;
   import flash.display.StageScaleMode;
   import flash.events.Event;

   public class test100 extends Sprite {   

      private var _customBackgroundTest:CustomBackgroundTest;

      public function test100() {      
         init();
      }

      private function init():void {         
         stageInit();
         customBackgroundTestInit();
         firstResizing();
      }      

      private function stageInit():void {
         stage.scaleMode = StageScaleMode.NO_SCALE;
         stage.align = StageAlign.TOP_LEFT;
         stage.quality = StageQuality.BEST;
         stage.frameRate = 30;
         stage.showDefaultContextMenu = true;
         stage.addEventListener(Event.RESIZE, onResize);
      }

      private function customBackgroundTestInit():void {
         _customBackgroundTest = new CustomBackgroundTest(stage.stageWidth, stage.stageHeight);
         addChild(_customBackgroundTest);
      }

      public function firstResizing():void {
         _customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
      }      
      
      public function onResize(event:Event):void {
         _customBackgroundTest.onResize(stage.stageWidth, stage.stageHeight);
      }
      
   }
}


see.. the init function calls a firstRezing-function which calls the same .onResize function as a manual resizing does.
so why does it only work when manually resizing the browser-window?

here's the customBackgroundTest.as:
Code:

package{   
   
   import flash.display.Loader;
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.net.URLRequest;

   public class CustomBackgroundTest extends Sprite {
      private var _loader:Loader;
      private var _request:URLRequest;
      private var _stageWidth:Number;
      private var _stageHeight:Number;      

      public function CustomBackgroundTest(stageWidth:Number, stageHeight:Number) {
         _stageWidth = stageWidth;
         _stageHeight = stageHeight;

         init();      
      }

      private function init():void {
         backgroundInit();
      }

      private function backgroundInit():void {   
         _loader = new Loader();
         _request = new URLRequest("myBackground.jpg");
         _loader.load(_request);
         _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, setSize);

         addChild(_loader);
      }

      private function setSize(e:Event):void {
         _loader.width = 1600;
         _loader.height = 1200;
         
         _loader.removeEventListener(Event.COMPLETE, setSize);
      }

      public function onResize(stageWidth:Number, stageHeight:Number):void {
         _stageWidth = stageWidth;
         _stageHeight = stageHeight;
         
         trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);

         var ratio:Number = _loader.width / _loader.height;
         
         if  ((_stageWidth / ratio) >= _stageHeight) {
            trace("_stageWidth / ratio");
            trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
            _loader.width = _stageWidth;
            _loader.height = (_stageWidth / ratio);
            trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height); 
         }
         else {
            trace("!_stageWidth / ratio");
            trace("_stageWidth = "+_stageWidth+" & _stageHeight = "+_stageHeight);
            _loader.height = _stageHeight;
            _loader.width = (_stageHeight * ratio);
            trace("_loader.width = "+_loader.width+" & _loader.height = "+_loader.height); 
         }
         
      }
      
   }
}


as you can see, there's lots of traces in .onResize function.
these I've used to trace, what is actually going on.

when the backgroundpicture is loaded at first the onResize-function traces this:
_stageWidth = 400 & _stageHeight = 300
_loader.width = 0 & _loader.height = 0

and when the .swf is manually resized this is what is traced out:
_stageWidth = 1087 & _stageHeight = 661
_loader.width = 1087 & _loader.height = 815.25

this might be the problem, but right now I'm too confused from looking at this over and over again... anyway, it seems strange, that the _loader.height which is set to the _stageHeight (which is 300) turns out to be 0!

all the files are downloadable here:http://campjohn.dk/test/resizing.zip
can anyone help me solve my problem?


thanks a lot
felisan

Moving Or Resizing The Background Of A Scene
Is there a way to shift or move the background of a scene without moving the contents of it? So for example, let’s say I have an animated ball bouncing in the center of the screen, and I realize that I want to add something else to the animation (another ball perhaps) but I don’t have enough room to do this. If I just grab the ball and move it the animation will get messed up because the key frames are already set in place. In order for it to work right I’d have to grab every key frame and move them one at a time, which is basically like doing the animation all over again (especially if you have a complex animation with multiple layers and key frames). Resizing the background doesn’t always help either because by default flash always adds the new portions to right (if you add width) and the bottom (if you add height).

If there’s not a way to move the background, is there a way to specify which direction flash will add the new pixels to when resizing the document?

Any help will be appreciated. I can’t tell you how many times I've run into this problem.

[Flash MX 2004] Script Dynamic Resizing Part 2
Hi again

How do you do to make the buttons folow when frame is resizing. And how do you add shadow pictures to frame that folow the resizing.

Use the file work whit.

//Moahawk [swe]

Like this page.

http://www.twinphotographie.com/


Filesource: DallasNYC

Resizing Background With Fixed Sized Layers?
Hey Everyone

I'm using a random background script that scales the image to fit the browser resolution no matter what size using percent, but I'd like everything else to not scale, any ideas? e.g. crashshop.com

Scalable/Tileable Background When Resizing Window
Hi, I've seen quite a few websites programmed in a way that when you resize the window, the main section of the site is centred while the background scales or tiles itself. Is this a tricky thing to do? Have a look at what I'm trying to do here please:

http://www.heiseman.com/temp/demo.html

I'd like for the background to tile itself and a black vignette to scale itself as the window is resized.

Any help would be great!

Thank you.

Resizing Background Image While Maintaining Content Dimensions
I'm trying to build a site that loads in different background images that will fill the browser and resize accordingly. Added to this I want the main content/navigation to position with resize but NOT scale.

Something like http://www.finish.tv/

I've tried using Stage.scaleMode but I can't get the background and the content to behave differently - ie Background scaling and content keeping the same size.

I have been looking for an answer to this for ages and any help would be appreciated.

thanks

Flash Dynamic Site With .Net Background
Hi all,
I am currently working in a Flash site for learning Arabic kids through fun, songs, cartoon and FLV video and testing its speed and its user friendly. I hope if you can visit it and tell me your comments, the link is here:

http://www.graphicmania.net/

I am sorry at the site is only in Arabic, but we plan to add an English version in a next stage.

Rafiq

Dynamic Rescaling Of The Flash Background?
I have stumbled upon a site that has a borderless bitmap background scaling up and down dynamically with some Flash objects placed on top of it that remain unscaled - regardless of how big the background is.

http://www.grafia.fr/

Is it a giant jpeg and scaling happens in html or is it a Flash object controlled by a sript? Or two Flash objects? It's a completely different experience that something like this (http://www.2advanced.com/) which is just a Flash object centered in html.

I would appreciate any tips.

Auto-resizing Flash File When Resizing Windows, HOW?
Hello everyone,

I have been to one web site tonight at my friend's house and I have forgotten whats the web site address. But this thing amazed me and stupid me doesnt know how to do.

you know whenever you build a web site you usually build for certain resolution right (1024x768 or 800x600 etc.. when i visited this web site, whenever i resize the window (make the window bigger smaller etc) the flash movie will follow the window size (extact fit).

I really want to know how to do that...? Anyone please help?

Help would be fully appreciated.

Ella

Elastic CSS-like Background/containers For Dynamic Text Fields In Flash?
Elastic CSS-like background/containers for dynamic text fields in flash? Anyone ever pondered this one? In CSS it looks like this:


Code:
box {
background: url(img/div-bottom.gif) no-repeat bottom left;
}

.box h3 {
background: url(img/h3-bg.gif) no-repeat top left;
}
I'm trying to create a dynamic text field on top of a nifty rounded button that conforms to fit the amount of text entered short of creating a lengthy function.

Dynamic Resizing
i have a flash that shows up in a table cell and the table cell has vertcal and horizontal autostretch. How do i dynamically resize the flash so it fills up the entire cell (i mean determining a variable of cell dimensions and attributing that/those variable(s) to the flash movie)?

Can anybody help me?

Dynamic Resizing
salut mes amis

I have an MC that holds a dynaic txtfield, I load the MC into the main timeline when a certain function is called. The function loads the content for the txtfield. Here my question, can I have that txt field resize itself dynamicly according according to the ammount of txt that is loaded?

Right now I have a plain txtfield with a scrollbar, but I'd like the txtfield to just automatically take it's own size...

hope this was clear...

Dynamic Resizing
hi, hope someone can help, and i bet it is something simple, but i have very little hair left trying to get this right.

I want to create a bubble that pops up when you rollover something, this i have done, but the i need to be able to resize the bubble to accomodate dynamic text which can vary in size, any ideas on how to resize a movie clip in relation to the number of characters in a text field.

ta in advance

yam.

Resizing Dynamic MC
Hi all, have a question here, First off I am making a space invader type game here and to start out with I have an array of "baddies" contained inside an empty movieclip.
I started my actionscript with a createEmptyMovieClip called "box" then I filled "box" with an array of my "baddies" which is a movieclip that I reproduced using attach movie. everything is working great except for one little problem when the "box" is moving to the right of the screen and the "baddies" are removed from the right side the "box" seems to resizes itself and the "box" will slide to the right more up to the point where there is a "baddie" MC, the problem is it doesn't do this on the left side though and I believe this is related to the registartion point being in the top left corner. My question is there a way to get the "box" to resize itself dynamicly to fit whatever movieclips are left in the array. I figured if this can be done that the "box" can check itself when a "baddie" mc is removed.
I have attached my FLA in zipped format incase anyone wants to see what I am talking about

Dynamic Box Resizing
I was using this FLA as an example to do my own progress bar app.
http://www.flashkit.com/downloads/movies/zip/8327/Simple%20Progress%20Bar%20Preloader%20--%20Dynamic.zip

I created a new box -> movie object and naming the instance "bar"... the "setProperty("bar", _xscale, iBytes);"

This works for a one time deal, but when I try to loop as the FLA file does, nothing happens. Yet when I do the same thing with the movie clip in the FLA file, it works fine. What do I need to do to my movie clip object to make this work for me?

Dynamic Resizing
Hi All,

was wondering if anyone could help with dynamic resizing..ala..www.robertreich.de


thx,,

mucho

Dynamic Resizing
Anyone know how to make a container/Movie Clip dynamically resize such as the effect employed in this site (animations included):
http://www.melaniedunea.com/main.html

Furthermore, is it possible to have images load from an XML file and contain the information needed to have the container/Movie Clip resize accordingly.

Thanks in advance-

Busta

Dynamic Resizing
Hi All,

was wondering if anyone could help with dynamic resizing..ala..www.robertreich.de


thx,,

mucho

Dynamic Resizing
Anyone know how to make a container/Movie Clip dynamically resize such as the effect employed in this site (animations included):
http://www.melaniedunea.com/main.html

Furthermore, is it possible to have images load from an XML file and contain the information needed to have the container/Movie Clip resize accordingly.

Thanks in advance-

Busta

Dynamic Resizing
When you create a shape dynamically and try to scale it this weird thing happens where the shape always moves from its original coordinates. I would imagine it has something to do with it's registration point but since u cant dynamically change it's registration point (or can you?) is there a way around this?

Here's a small example in scalling a dynamic shape versus a shape from the library.

HELP - Resizing A Dynamic Text Box On The Fly?
I am duplicating MCs and positioning them horizontally across the screen. Each MC has a textfield within it that gets set to a different value each time a new MC is created. I'm having a problem with getting the MCs to be evenly spaced. Flash takes the total size of the textfield and uses it for the width of the movie as opposed to the actual length of the text within the field. Creating the illusion of uneven spacing. I tryed to set the textfield to extending but it doesn't extend on the fly.

any ideas?

thx,

Paul

Dynamic Resizing Of Buttons
Hey Guys,

Does anyone know what the code would look like for a script to perform:[ a button to resize itself according to the length of text in a dynamic text field the button is covering?]

If anyone can help . many thanks,

Dynamic Text Box Resizing
Is there any way to dynamically resize a text box based on what a user types. The point is to enable the user to type in a text box with a defined width but no defined height. The text box will be on a multicolored background so in order for the text to be visible, it needs to have the white background behind it that the text box provides.

The user could type anywhere from at least 5 to maybe 100 words and they all need to be visible (no scrolling). So a dynamically resizing text box based on the amount of words the user type would be Perfect for me.

Is there any Flash Guru out there who can help me out??

Copyright © 2005-08 www.BigResource.com, All rights reserved