On Stage Resize, Resize Multiple Copies Of An Object Help
Hey everyone, I'm having some troubles figuring out the code for this. I have 12 button objects that are being created evenly across the stage, and I would like to have them resize on a stage resize event. Here is my code so far: Code: //-------------------------------------- // CONSTRUCTOR //-------------------------------------- public function BasicFullScreen(){ initVideo(); createButtons(); stage.addEventListener(Event.RESIZE, resizeHandler); } //Create Buttons private function createButtons():void{ for(i==0;i<12;i++){ //trace(i); button = new MovieClip(); button.graphics.beginFill(000000); button.graphics.drawRect(0,0,(stage.stageWidth/30),(stage.stageHeight)); button.graphics.endFill(); button.x = (stage.stageWidth/12)*i+(stage.stageWidth/40); button.y = 0; button.alpha = .5; addChild(button); } } private function resizeHandler(event:Event):void { //What to put in here? } I'm not sure what to put in the resizeHandler function to resize all the button objects. Thanks for any help, Matt
KirupaForum > Flash > ActionScript 3.0
Posted on: 10-08-2008, 09:12 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Object Outside Of Stage Show On Window Resize
How do I only export the shown area of a .swf. I have a pop up menu that is outside of the active stage, but is shown when the HTML window is resized. Is there a param I can throw in the HTML page?
Align Object During Stage Resize And Fullscreen
If my movie clip in which I am loading external swf alings itself on stage like this:
Code:
swfLoader = new Loader();
var swfRequest:URLRequest = new URLRequest(url);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadComplete);
swfLoader.load(swfRequest);
function LoadComplete(e:Event):void {
swf_mc.addChild(swfLoader);
swf_mc.x = Math.floor((stage.stageWidth / 2) - (swfLoader.content.width/2));
swf_mc.y = Math.floor((stage.stageHeight / 2) - (swfLoader.content.height/2));
}
how can I pass these values in these 2 functions:
Code:
stage.addEventListener(Event.RESIZE , resizing );
function resizing(e:Event = null):void {
}
stage.addEventListener(Event.FULLSCREEN, handleFullScreen);
function handleFullScreen(e:FullScreenEvent):void {
if (e.fullScreen) {
} else {
}
}
Because swfLoader.content.width and swfLoader.content.height wont be accesible outside 'LoadComplete' function, so I really dont know how to handle that, please help!
How Can You Resize A Stage And Have Flash Resize The Objects As Well?
Is there any way you can resize your stage in Flash and either have it keep the objects all cenetered or have it compensate for the objects and adjust them accordingly?
This tends to be a problem when I start a new file and then forget I want the stage to be much bigger.
Any help is appreciated...
Resize Movieclip BG Per Stage Resize
I'd like to have a movieclip that scales in the background per the resize of the browser. I'd also like to have menu 200 pixels to the left of the stage width. How would I set it up in AS3? Thanks
Resize Mc On Stage Resize
Hi,
I'd like to resize a movie clip via a percentage of the available screen size, so that when the stage is scaled, the movie clip responds accordingly. - Any help greatly appreciated.
Ben
Unhappy Adjusting Columns And Rows On Stage Resize, According To Stage.width.
Hey fello flashers,
what i'm trying to achieve can be seen here, at the FWA's website.
When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.
if anyone has encounted this problem before or can help, then pls do i'm a little confounded on this one.
thanks
cam
Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;
function init():Void {
enableButtons(numberOfGalleries);
resizeStage();
}
function enableButtons(numberOfGalleries:Number):Void {
currentRow = 0;
currentColumn = 0;
for (i=0; i<numberOfGalleries; i++) {
tracker = i;
thumbsDisplayer = this.createEmptyMovieClip("thumbsDisplayer_mc", this.getNextHighestDepth());
currentThumbnail = thumbsDisplayer.attachMovie("thumbnail holder", "thumbnail"+(tracker+1), thumbsDisplayer.getNextHighestDepth());
currentThumbnail._x = currentColumn*thumbMarginX;
currentThumbnail._y = currentRow*thumbMarginY;
currentColumn++;
if (currentThumbnail._x>(Stage.width-(currentThumbnail._width + thumbMarginX))) {
currentRow++;
currentColumn = 0;
}
}
}
function resizeStage() {
var myListener:Object = new Object();
myListener.onResize = function(e:Object):Void {
//
}
Stage.addListener(myListener);
}
init();
Resize Flash Movie, Make HTML Page Also Resize?
Hi All Flashkitters
I'm trying to do something that I believe is probably pretty simple and I'm guessing it involves some Javascript along with the Actionscript.
It's like on Fantasy Interactive's website, when you click on different sections of the site, the Flash container movie resizes, and makes the HTML page also resize vertically, to be able to scroll the content. Does anyone know how to acheive this? Its a handy function, I'd love to master it. It opens a big door for building flash sites that can hold real content.
So, anyone can point me in the right direction, I am greatful to.
Resize Stage
HI,
I hope somebody can help me, i am creating a cd-rom where you can load stuff via getUrl,this whole thing is fullscreen, by using the getUrl i would like to rescale my windoe to a small one.
I have seen that feature on one cd, when you open stuff from outside the movie rescaled and had a button to return to your last point.
Does anyone know how to do this?
thanks in advance
Stage Resize
hi.
i am trying to set my content to the center.. works great but mucks up when i resize the window. any ideas why?
Stage.align = "TL";
Stage.scaleMode = "noScale";
stageListener = new Object();
stageListener.onResize = function() {
posContent();
}
Stage.addListener(stageListener);
posContent = function() {
main_mc._x = Math.round((Stage.width/2)-(main_mc._width/2))
main_mc._y = Math.round((Stage.height/2)-(main_mc._height/2))
}
stageListener.onResize();
cheers,
Gareth
Stage Resize
Hi,
i am trying to scale a background image to the size of the browser window. heres my code. for some reason it does not fill the entire stage, any ideas?
Stage.scaleMode = "noScale";
Stage.align = "TL";
background_mc._width =Stage.width
background_mc._height =Stage.height
background_mc.onResize = function() {
background_mc._width = Stage.width
background_mc._height = Stage.height
}
Stage.addListener(background_mc);
cheers,
G
I Need To Resize The Stage
my movie is alot smaller than the stage, so i get so much blank extra space. and i was wondering how to make it smaller so it would fit size of what i need.
im sure it can be done..and it probably simple too.
If someone can help me...im sure i can help them with something else
(not flash related) lol
thankx
Stage Resize
I have an xml slideshow which loads images into a movie container which displays full window...or fullscreen which is what this is designed for.
When I load an image which is larger than the stage, the image goes off the screen. However, when I grab the corner of the Flash Window and do any kind of a resize, the image then goes full window and I see all the image.
Is there a way using actionscript to make the same kind of call(s) that occurs when I manually resize the screen... not necessarily to resize the screen, but to get the container to refresh so that the larger image will resize to the size of the stage/window.
BTW, _root.refresh() does not work and neither does mc2.refresh().
Thanks.
L.
Stage Resize
I'm trying to create a Stage listener that when I resize the browser it executes a function to center all the objects. I've got a document class called TopLevel, and then I got a StageEvent Class that handles the stage Events.
TopLevel
Quote:
package com{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.filters.GlowFilter;
import com.event.StageEvent;
public class TopLevel extends MovieClip {
public static var stage:Stage;
public static var rootisplayObject;
public var stageAlign:StageAlign;
public var stageScaleMode:StageScaleMode;
public var stageEvent:StageEvent = new StageEvent();
public function TopLevel() {
TopLevel.stage = this.stage;
TopLevel.root = this;
TopLevel.stage.align = StageAlign.TOP_LEFT;
TopLevel.stage.scaleMode = StageScaleMode.NO_SCALE;
stageEvent.XWidth = stage.stageWidth;
stageEvent.YHeight = stage.stageHeight;
TopLevel.stage.addEventListener(Event.RESIZE, stageEvent.stageResize);
}
}
}
StageEvent
Quote:
package com.event{
import flash.display.Sprite;
import flash.events.Event;
public class StageEvent extends Sprite {
private var xWidth:Number = 0;
private var yHeight:Number = 0;
public function StageEvent() {
}
public function get XWidth():Number {
return xWidth;
}
public function set XWidth(value:Number):void {
xWidth = value;
}
public function get YHeight():Number {
return yHeight;
}
public function set YHeight(value:Number):void {
yHeight = value;
}
private function stageResize():void {
trace("Working");
}
}
}
Where do I add a eventlistener to listen to the stage, and then pass it to the stageEvent Class.
[F8] Resize Stage EXCEPT FOR 1
I have a flash portfolio site which resizes with the browser, which works fine. HOWEVER, there's one container clip loading external SWFs containing FLVs. I don't want the FLVs to resize with the stage, but instead always retain the 400x300px dimensions the FLVs were created with. So essentially, I want the portfolio to resize to the browser with the exception of the container clip.
My 400x300 FLVs are loaded into 640x410 SWFs which are loaded into the 640x410 Container clip called big_placeholder_mc.
I've tried using onResize and manually setting the width and height of the container clip like so:
var myListener:Object = new Object();
myListener.onResize = function () {
big_placeholder_mc.width = 640;
big_placeholder_mc.height = 410;
}
Stage.addListener(myListener);
But this doesn't keep the container clip (and child FLVs) from resizing with the stage.
Any help would be appreciated!
Stage Resize
I am trying to make a flash movie stay proportionate to the stage when resize and I am using this code.
Code:
Stage.scaleMode = "noScale";
Stage.align = "TL";
// Placement Function
w = tl._width/2;
h = tl._height/2;
Stage.addListener(this);
this.onResize = function() {
tl._x = bl._x = w;
tl._y = tr._y = h;
tr._x = br._x = Stage.width - w;
bl._y = br._y = Stage.height - h;
};
My problem is it waits to see when the user changes the window size to resize to the window when you first enter the page and load the movie.
How can I make it so it automatically resizes when the movie starts?
Help With If's For Stage Resize
can anyone identify why this is not working? i don't receive any type of error when i test it out.
Code:
Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "TL";
#include "lmc_tween.as"
var stageResizeTween:String = "easeOutElastic";
var stageResizeTweenSpeed:Number = 1.5;
var TopTween:Number = Stage.height /2-300;
var LeftTween:Number = Stage.width /2-350;
var align:Object = new Object();
align.onResize = function()
{
if (work == y>500) {
work.tween("_x", LeftTween, stageResizeTweenSpeed, stageResizeTween);
work.tween("_y", TopTween, stageResizeTweenSpeed, stageResizeTween);
if (graf == y>500) {
graf.tween("_x", LeftTween, stageResizeTweenSpeed, stageResizeTween);
graf.tween("_y", TopTween, stageResizeTweenSpeed, stageResizeTween);
} else {
work.tween("_x", Stage.width / 2-110, stageResizeTweenSpeed, stageResizeTween);
work.tween("_y", Stage.height / 2, stageResizeTweenSpeed, stageResizeTween);
}
} else {
graf.tween("_x", Stage.width / 2+110, stageResizeTweenSpeed, stageResizeTween);
graf.tween("_y", Stage.height / 2, stageResizeTweenSpeed, stageResizeTween);
}
}
Stage.addListener(align);
align.onResize();
Stage Resize
Hello,
I have this film with a 800x600 stage size and a movieclip with the same size on the first frame of it, after the animation starts the mc width and height changes. on the first frame of the _root timline I ahve this:
Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
bg.onResize = function () {
if (Stage.height > 420) {
var w = Math.round((Stage.width * 100)/800);
var h = Math.round((Stage.height * 100)/600);
var factor:Number = Math.min(w, h);
if (factor < 50)
factor = 50;
bg._xscale = factor;
bg._yscale = factor;
bg._width += 3;
bg._y = Stage.height - bg._height;
}
}
Stage.addListener(bg);
My movieclip isn't resizing properly...
Any help?
MC Resize To Stage
I was wondering if someone can help out a newbie. How do you make a movieclip resize to the stage?
Thanks,
Jordan
Stage Resize
Hey all,
I have a little question about resizing the flash stage.
Is it possible to resize the stage size when you click on a button in your swf file?
If it is possible with which functions you could do this?
Many Thanks!
Stage Resize?
I waited a long time beforing posting this...b/c I was looking through results of my search.
Well...i give up
I'm taking a look at this script here!
I don't understand this line of code
ActionScript Code:
_root._xscale =_root._yscale = Math.min(Stage.width,Stage.height)/400*100
Math.min just returns the smallest number (either width or height).
Don't understand why this is done.
I don't have FLASH at work...so I'm searching and looking at things online.
What I want to do...
I'm trying to find out how to resize it...also, resize it in a smooth/easing motion.
ok...gotta go to lunch.
Will post again afterwards.
BTW: MM site seems to be f*** up. A lot of the links that return fromt he search is broken.
Resize The Stage
Ok, my bad first, I set up my stage size to 800x600, and when I set the full screen mode, 800x600 is a bit small, I want to scale up the stage size a bit bigger when it plays on the full screen mode...... is there a way to do it? I use load movie function to my project, if I resize the stage size on my index file (index.swf), will that affect to my other files?
Stage Resize?
I have a problem I need to solve urgently, I have website which will have different height depending
on what section you are in. And I want to use the browsers native scrollbar to scroll the website,
therefore I dont want to have a huge stage all the time. Does anyone know how to solve this?
Is it possible to resize the stage and update the browser so the scrollbar fits the height of the flashmovie?.
Resize Stage?
Hello,
I was wondering if it was possible to dynamicly resize the Stage with AS...
I've been looking around, the question has been asked but not answered..
TiA
Resize Stage
I've been working on a site for a while that is fixed height. It's pretty short but now the client wants to have 1 page that's very tall. Any advice how I should do this? It's all in one swf.
Any ideas would be appreciated. Thanks!
Resize Mc To Stage H/w
I've been working on my web site. Its 1024x768px and i run it fullscreen.
I come up with an idea and i added a 1024x768px to the top (new frame) as a intro like action.
When i try to resize it to stage it will really mess up my whole page
And also cause of resize my movieclip stretched and looking terrible
Code:
var xy:Tween = new Tween(asdasd, "_x", Strong.easeInOut, 0, -1024, 2, true);
Code:
asdasd._width=Stage.width;
asdasd_height=Stage.height;
Stage.scaleMode = "noScale"
var myListener:Object = new Object();
myListener.onResize = function () {
asdasd_width=Stage.width;
asdasd._height=Stage.height;
}
Stage.addListener(myListener);
I need a opinion to solve this little problem
Resize Stage?
Hello,
I was wondering if it was possible to dynamicly resize the Stage with AS...
I've been looking around, the question has been asked but not answered..
TiA
Stage Resize
hey guys,
im am doin a site at the moment which i would like to resize. I dont want to resize to infinity, i want a specific range. This is to accomodate for 800x600 and 1024x768, but any larger uses the 1024x768 size.
The site needs to be centered at all times, and scale between the two sizes. eg if someone was viewing at 900x650 or something, it would be scaled accordingly. Also i dont want to actually scale the elements. I just want to reveal more space around them.
I have attached a pdf with the layout im trying to accomplish.
www.sqosh.com.au/blaablaa69/layout.pdf
Any suggestions would help.
thanks
ps. ive got the min max width thing sorted, its just the conditions within!
eg.
function positionBlocks()
{
if (Stage.width > 800 & Stage.width < 1000) {
// blaa blaa
} else if (Stage.width >= 1000) {
resetBlocksWide();
} else if (Stage.width <= 800) {
resetBlocks();
}
}
Stage Resize
I was wondering can i somehow resize stage but dynamicly, let's say i load variable that says what's is the height. I found Stage.height but that is read only data. Can this be done somehow, but don't wan't to scale swf, just to change width or height to show or hide some part of swf.
Stage Resize
hey guys, i'm doing a full flash page website, so i have a few things some centered, some aligned to the right, etc....
I have this action that i use to make the stage think it is resizing so that everything pops into place.
ActionScript Code:
stageListener.onResize();
But sometimes a few things pop out of place, i don't really know why, and it doesn't go back where its suppose to unless i resize the window.
Do you guys know if there's an action out there that makes the stage think it is constantly resizing?
thanks y'all
Resize The Stage
Is there any way to succesfully resize the stage to fit something like 80% of the browsers width and all of it's height - and be able to dynamically change on a resize? I've tried the tutorial that Flash provides and it doesn't even work!
Thank you,
~Brendan
Dynamic Resize Issue: Resize From Corner, Not Center
Okay. So I just got this little slide show I'm doing to load the next image (i'm still working on making it loop, so if anyone wants to help me with that, too feel free!)
As each new picture is loaded in the slideshow, I have a border that automatically resizes to fit it. Right now it's resizing from the center, is there any way to make it expand out from the top right corner instead of the center (since the orientation of the pictures are different, it looks a bit unnatural for what I'm doing)
Here is the code for my actions layer and if anyone can take a look and tell me what I need to change/add to make this work, I appreciate it!!
Code:
#include "mc_tween2.as"
space = 10;
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round(photo_mc.getBytesTotal()/1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 6;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc.alphaTo (100, 0.5, "linear")
delete this.onEnterFrame;
}
}
};
image_mc.onLoad = setInterval( nextImage, 7*1000 )
;
-SD
SWF Resize On Browser Resize Causes Nav Buttons To No Longer Work.
Hello. I have a full browser width/height resizing swf. I can't figure out why, but the navigation rollover states no longer work after resizing the browser. My rollovers are handled by a button class linked to each nav button movie clip within the library. Other things of note. I am using the 3 frame AS3 preloading technique which holds all my assets in its own movie clip on frame 3.
My document class only really handles preloading. And a class for all my assets, acting as the "real" doc class is linked to that MC on frame 3.
Here is the URL to the problem:
http://spiritservices.mindgrabmedia.com/stmary/
Thanks in advance.
Resize Bg On Browser Resize While Maintaining Image Proporti
im using the following code to resize background images on browser resize:
Code:
var listener:Object = new Object()
bg_mc.width = Stage.width;
bg_mc.height = Stage.height;
listener.onResize = function(){
bg_mc.width = Stage.width;
bg_mc.height = Stage.height;
}
Stage.addListener(listener);
the problem i'm having is that my background image does not maintain proportion on resize. so, when i resize my browser to a width of 100px, the entire width of my background image is compressed into the 100px area.
is there some additional code i can add to the snippet above to maintain the proportions of my background image on resize?
thanks,
brandon
Stage Resize Problem
hello people,
i'm tying to make a flash website that's resolution independent.
i'm using the "align components set 2.0" and this code
Code:
_root.createEmptyMovieClip("barTop", 2);
with (_root.barTop){
beginFill (0x666666, 100);
moveTo (0, 0);
lineTo (0, 0);
lineTo (0, ((Stage.height +104)/100)*5);
lineTo (Stage.width +4, ((Stage.height +104)/100)*5);
lineTo (Stage.width +4, 0);
endFill();
}
_root.createEmptyMovieClip("bg", 3);
with (_root.bg){
beginFill (0xCCCCCC, 100);
moveTo (0, ((Stage.height +104)/100)*5);
lineTo (0, ((Stage.height +104)/100)*5);
lineTo (0, ((Stage.height +104)/100)*95);
lineTo (Stage.width +4, ((Stage.height +104)/100)*95);
lineTo (Stage.width +4, ((Stage.height +104)/100)*5);
endFill();
}
_root.createEmptyMovieClip("barBottom", 4);
with (_root.barBottom){
beginFill (0xFF6600, 100);
moveTo (0, ((Stage.height +104)/100)*95);
lineTo (0, ((Stage.height +104)/100)*95);
lineTo (0, ((Stage.height +104)/100)*100);
lineTo (Stage.width +4, ((Stage.height +104)/100)*100);
lineTo (Stage.width +4, ((Stage.height +104)/100)*95);
endFill();
}
for the background and borders.
but it doesn't seem to work because the stage doesn't seem to resize, for example from 500x500 pixels to the size the the browser has (700x550 pixels or what ever it may be). what do i have to change in the movie or code.
thanx in advance
grafx
Cut Out The Edge Of The Fla And Resize The Stage...?
i already hav my project done... but now i need to resize everything on the canvas
i made my fla in 800x500 ...
now i need to change it to 800x430... and i want the top bit and the bottom bit being cut out...
but after i resize the stage... the whole thing is not centralize on the canvas... can i change the canvas by setting central point
how can i do that?
Stage Class Resize
Hi all,
i have the folloing question...I want my swf being over all the area in my browser and I don't want it to be scaled.
So I set the Stage.scalemode to "noScale, set my swf 100% height and width in dreamweaver...then the stage stays 100% and the rest is also flash (in fact the place outside the stage)...so far so good?
Now i want some graphic stuff coming out of the browser borders to the center and elements that are placed on the edege of the border of my browser...thing is..i don't know how big the browser is and i want the elements to be replaced if the user should scale or maximaze his browser window...
Any ideas?
Greetings from Antwerp-Belgium
Resize The Stage Dynamically
Hi,
I have a Flash button that resizes dynamically depending on the length of text in a .txt file (thx wdhall) and was wondering if the Stage can be resized to fit around the button, dependant on how big the button is?
Basically, the button's size is determined by the length of text after it becomes a .swf. So scaling the .swf will not work as the button will also scale in proportion to the Stage.
Or can I just make the Stage transparent? (I know, a stupid question)
Many thanks again.
Stage Resize At Runtime
Hi,
I presume there is a way this can be done but I am not sure how. I have looked over the internet and still did not found an answer.
A simple link can help.
What I intend to do is resize the stage at runtime. I am building a recursive menu and I am reading the parameters from a XML file. What I need is to make the Stage width and height based on the values the user writes - meaning it has to be at runtime.
Any help from the flash community would be great!
Andrei Potorac
Stage, Browser Resize?
Hi i've set up a web page to display what i want to do...
http://www.designbykrust.com/asd.html
basically. i'm using the following script... it does everything i want it to do except allow the menu object to move with the browser window (it does move, but it just jumps after each time i resize the window). i also need it to stop when it gets to a certain point but i dont know how to script this. can you help?
Stage.align = "TL";
Stage.scaleMode = "noscale";
//
Menu.onEnterFrame = function() {
this._x = Math.round(Stage.width-400);
this._y = 25;
};
Stage.addListener(Menu);
cheers.
krustafarian@hotmail.com
Stage.resize Issue
Hey guys.. I want to have my navagation movieclip (or any movieclip for that matter) realign itself to 30 pixels from the bottom of the screen whenever the Stage changes size. So if the user stretches out his web browser, the navagation bar that I have created will always be 30 pixels from the bottom.
I'm using Flash 8, and the code that I have here does move the nav_mc on Stage resize, but it is never 30px from the bottom, instead it seems to go way up high if I squeeze the stage upwards, and way down low (past the viewable Stage) if I stretch the Stage tall.
Stage.scaleMode = "noScale";
var stageListener:Object = new Object();
stageListener.onResize = function() {
nav_mc._y = (Stage.height - 30);
};
Stage.addListener(stageListener);
Stage Resize On Browser
I have built my site to 800 x 600, which looks pretty good on monitors set at 1024 x 768 or better. There's still a few people out there with lower settings though. My goal is to have the site resize smaller if the browser window is smaller, but not increase in scale above the dimensions of the original size of 800 x 600.
I got a new book with my purchase of Flash 8. Gave me code to do just this. But as simple as it is, I can't get it to work. Thinking there's something I need to include in the html file maybe? I dunno, but here's what I'm working with in a test movie with a stage size of 550 x 400:
var Bozo:Object = new Object();
Bozo.onResize = function(){
if (Stage.height < 399 || Stage.width < 549){
Stage.align = "C";
_root._xscale = Math.min(Stage.width, Stage.height) / 550 * 100;
_root._yscale = Math.min(Stage.width, Stage.height) / 400 * 100;
}
};
Stage.addListener(Bozo);
any help on the matter would be greatly appreciated
[MX04] Resize Stage
Hi,
Let's imagine, that I finished project and it needs to be a little bit bigger. I would need increase exported projector from 320x240 to 410x360 (stage.size.150%) with Stage.scaleMode = "noScale";. Thanks for any ideas!
Positioning After Stage Resize
Hey there,
this might be a trivial question, but anyway: what´s the best way to get all my elements correctly positioned again after changing the stage´s size? I´d like to avoid having to reset each and every keyframe to its new x/y values manually if possible...
Thanks,
Toby
Resize Stage? Impossible Right?
Okay, I work for a car dealership and I'm doing some ads for them. The people we're advertising with said that we can do ads that expand outward if we want. I'm thinking, that's great and sounds fun, but how do we do that. So I build a test thinking they are going to handle the resize with some javascript or css; and guess what, they don't. So I call them and ask them how I need to send it to them to do it and the one guy there says,"I don't know, we just have this swf uploader thing that puts them in. I just need to locate the file and upload it." So, my question is, is there a way to resize the stage dimensions dynamically in flash? As far as I know you can't. And, since this is probably how it is, how might these other people have been doing it. What other programs can export as a swf that maybe have these capabilities. Or, is there some way I can trick it into happening? Use external scripts located on another server they don't know about? HOW can this be done. I know it's getting done because they've uploaded swf files to the server that apparently complete this task. Any suggestions?
[F8] Resize A Movieclip To Stage
Can someone point me to a tutorial that explains how to resize a movie clip to the full size of the stage? I have a presentation that plays fullscreen and I want the movie clip to play fullscreen too. Maybe theres an easier way.
Thanks!
Please Help With My Stage Resize Listener
I'm using the following script to adjust a video_container's size when the browser is stretched while at the same time retaining it's aspect ratio?
var initW:Number = presentation.video_container._width;
var initH:Number = presentation.video_container._height;
stageResizeListener.onResize = function() {
var targ:Number = Math.round((Stage.width*initH)/initW);
presentation.video_container._width = Stage.width;
presentation.video_container._height = targ;
};
I thought this would solve the problem but all that's happening is that is that it's adjusting to the width and not the height. Any help would be greatly appreciated
Stage Resize Set MovieClip X And Y
Can anyone tell me what I'm doing wrong here? This seems like it should be really simple. I have a movieclip on the stage with an instance name of bg, I want this clip to resize itself based on the stage width and remain locked on the 0,0 x,y.
Code:
function setUpStage(){
var SW:Number = stage.stageWidth;
var SH:Number = stage.stageHeight;
bg.width = SW;
bg.x = 0;
bg.y = 0;
}
setUpStage();
stage.addEventListener(Event.RESIZE, myResizeHandler);
function myResizeHandler(event:Event):void {
setUpStage();
}
The width of the bg click is resizing correctly but the x and y values are not staying locked in the upper left hand corner.
Thanks in advance.
Stage Resize Issue....
i was thinking about putting a tiled background into my movie so looked up some tutorials and had a go. i found this script which seems to work just fine:
PHP Code:
private var tile:Sprite = new Sprite();
function tileBG(event:Event=null):void {
tile.graphics.beginBitmapFill(new pattern(0, 0));
tile.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
tile.graphics.endFill();
addChildAt(tile, 0);
tileBG();
the "tileBG();" call was put inside an onEnterFrame function. i tried it and it worked just fine - resizes and everything. i then got a bit distracted by tv, tea, life etc etc and lefting the swf running. when i came back it was real slow. REAL slow.
not entirely sure why but figured it didnt like being called within the onEnterFrame function so changed to it an RESIZE event. Now it's gone strange. The box which is filled with the tile is suppose to go to the screen edge and bottom, but it doesnt - worked fine within the onEnterFrame call but not the RESIZE call - does anyone know why it would do this?
Stage Resize Question
New to AS3 so forgive my ignorance but I have a movieclip that I am trying to center on the stage. I use the following code:
Code:
backGround_mc.x = (stage.stageWidth/2)-(backGround_mc.width/2);
backGround_mc.y = (stage.stageHeight/2)-(backGround_mc.height/2);
It works perfect when I preview the SWF but when I publish it in different browsers the movieclip is never in the center. So what am I doing wrong? Thanks.
|