Flash :: Stage Resizing And Getting The Right Variable?
Jan 20, 2011
In my Flash Application (AS3), I want to get the stage size and use that so my objects (which the user controls) can't go outside of the screen. However, when I use:stage.stageWidth;stage.stageHeight;The values I get aren't actually what I want. They give me the stage size, but if I resize the window, the numbers change as well. Now, in a html page, I don't think that will matter, because the user can't resize it... however, I'd like for it to be more solid than relying on the window size.stage.width;stage.height;However, those gave me "801" and "601", one greater than my actual stage size. Those values did not change when I resized the window, but they were one greater.
View 1 Replies
Similar Posts:
Nov 4, 2010
im trying to keep a object in a certain position in the screen, without resizing it too (with the stage)
function Resize(e:Event = null):void
{
if ((stage.stageWidth)/(stage.stageHeight) > fundos.width/fundos.height)
{
[Code]....
my stage is resizing all ok (keeping the aspect ratio) and im trying to add a nav img that would stay in the same position as i resize the browser screen
View 3 Replies
Mar 31, 2011
I've got an animation in Flash that's made of a number of large images - too large it turns out - flash keeps crashing and running out of memory.
I'd like to scale these down to 50% but maintain their on-stage size in Flash (or at least keep the positioned the same). I've scaled them down on disk, but this scales them in flash too (so messes up their relationships).
View 1 Replies
Nov 10, 2010
My main swf is 960x600 and loads full screen. it is a projector or swf, local. I have the code on frame 1 to ensure full screen and show all:
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.displayState = StageDisplayState.FULL_SCREEN;
Then I load an external swf into a mc, and it goes full screen as expected. BUT the main swf that loaded that external one, at the time of load, suddenly gets scaled back down to its normal size: 960x600, on the top left corner of the Player Window (or the full screen), so somehow at 0,0. Whn I unload the external swf, I can put the code stage.scaleMode = StageScaleMode.SHOW_ALL; to get it back to where it was. But unfortunately I have some buttons from the Main swf that are supposed to be on top of the loaded one, and should stay where they are. But now they all move because of this scaling down.
the mc that is being used as a container for the loaded external swf is an empty mc located at 0,0. The external swf has the same size as the main one: 960x600
I searched and tried things but could not get it to stay in show-all mode when loading this external swf...
View 0 Replies
Apr 5, 2011
im loading photos of different aspect ratios with a loader onto a child holder frame_mc. I wanted to know what AS3 commands do i need to work on to get the frame_mc to resize to the new childs dimensions and centerize itself on the main stage? (as in event listeners, functions, vars etc)
View 3 Replies
Nov 17, 2009
I'm going nuts trying to figure this out. I built an animation project at 630 pixels wide. Turns out the project needs to be 430 pixels wide. In CS3, using the classic tweens, I would simply resize the stage, Onion All, then resize everything on the stage at once. But with the new tween structure, it looks like I can't do a mass resize like that. Anything that's been tweened using the motion editor does not resize.
I know I can just create a new movie clip, paste all frames into it and then resize the MC, but I have some JPEGs of signatures that pixellate when they are resized that way. So, can you onion skin the new tweens? Is there a workaround?
View 1 Replies
Aug 6, 2009
I am new to Actionscript 3 and i am making a basic flash site using CS4 and AS3.I need to have an image as my background that resizes whenever the window/browser is resized and that works perfectly. I also need to import another SWF to the stage as this contains the main body of the site, this SWF needs to be centered at all times on the stage even on a resize.I have pasted some code below as what i have working at the moment is the SWF gets imported, the background does scale and resize etc but the movieclip won't center when first launched and i just can't figure it out.[code]
View 2 Replies
Nov 5, 2009
I have this code that works great to center a background image and even other MC's on the stage. However, I am looking to tweak this code slightly and I just can't figure out how.Instead of the button1MC being center, I need to define it's coordinates on the stage to line up at the bottom or even the left side or something...I'm creating a nav bar of MC's that need to have fixed coordinates on the stage and resize when the window is resized.Lastly I need to fix a .min for the stage so that the MC's on the stage stop repositioning when the stage/window get resized too small, like below 500x500 or something. know this is simple, but I can't figure out where to add the stage min parameters or even how to properly adjust the button1MC's
function init()
{
stage.align=StageAlign.TOP_LEFT;
[code].....
View 14 Replies
Apr 20, 2011
Resizing the stage seems to expand to the right and down. There a way to re size from the bottom to up?
View 1 Replies
Sep 17, 2009
My AS2 flash file is loading in preferences from a .txt file. Is it possible to redefine the stage of the swf with this method? In other words, if someone wanted a swf with different dimensions is it possible to load those in via a txt file and resize dynamically instead of having to re-publish the swf with the new dimensions?
View 3 Replies
Jun 12, 2010
The problem is, it wasn't tested well, and the stage is too big - on low resolutions or on small screen you have to scroll in order to see the lower/upper sections.I know how to resize it with HTML, but I just want to know if there's a way to scale the entire stage and all of the contained items from within flash?
View 4 Replies
Mar 18, 2010
I have all my content inside a movieclip called 'allmenu' but im only resizing it to fit the stage with a timer hehe , is there any way it could be resized before you see it on the stage, because right now you get this glitchy resizing moment on every page.
PHP Code:
import flash.display.Stage;
import flash.display.StageAlign;
[code].....
View 2 Replies
Aug 5, 2009
I'm currently trying to have a swf file to show up on an HTML page when the page initially loads. When the user clicks the close button (on the swf file), the swf disappears and the rest of the content on the HTML page shifts up. Similar idea to how CNN occassionally have their "breaking news" banner on their homepage. In order to do this, I thought of the idea of creating a 1x1 pixel main swf file containing a MovieClipLoader function to load the "content" onto the swf file.
As the user clicks on the close button, it will unload the external swf, returning back to the 1x1 main swf. However, how do I get the 1x1 main swf file to resize to the size of the external swf? and to do the reverse when the user clicks the close button? So far I have the MovieClipLoader function working, but not the resizing.
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip("test.swf", "container");
View 2 Replies
May 15, 2010
i am making flash website in AS3 and i have i problem with resizing.I tryed a houndrit codes, classes, examples, tutorials bud nothing worked correctly.In main timeline a have two movieclips first is as a background and second as wholesite. I dont want to resize Background. I want to resize WholeSite movie clip only. It will resize to browser resolution. But width and height stay constrain - width go resizing with height. Here is my FLA: http:[url]....and here is test of that site: http:[url]....
View 3 Replies
Dec 14, 2009
I have done resizing and liquid flash sites in AS2 before. I have recently started to learn AS3. I have a project where I need to scale an image proportionately when the user resizes the stage. This is what I have so far. I kinda just stole my AS2 code and tried changing it a bit.
//Include tween actions
import caurina.transitions.Tweener;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
[Code] .....
View 1 Replies
Jan 3, 2007
I have a banner that is 468x60 pixels and I need to rezize it to 728x90 - this includes scaling all of the content over the timelines proportionally.
View 6 Replies
Feb 6, 2009
This code works. It puts my external image on the stage:
Code:
var pngurl:URLRequest=new URLRequest("image.png");
var pngloader:Loader=new Loader();
pngloader.load(pngurl);
this.addChild(pngloader);
This code works to, but not completely. It stores the same image inside of a movie clip that I've named "panel". However, the image is bigger than "panel":
Code:
var pngurl:URLRequest=new URLRequest("image.png");
var pngloader:Loader=new Loader();
pngloader.load(pngurl);
panel.addChild(pngloader); //panel is the name of my movieclip
I almost fixed my problem by changing my code. My image is smaller than "panel" now, but its width and height should be the same as "panel":
[Code] .....
(Original image size= 350width and 250height) (Panel size=100width and 100height)
View 3 Replies
Jun 16, 2009
I am uploading different size of images dynamically but at the same time I want the stage to be resized accordingly to image's height and width.
View 11 Replies
Feb 14, 2011
When I create a little .swf file with actionscript it will run correctly in whatever stage size I choose for the document. However, I want the display to update when I change the window size that the .swf is running in as it is running. It does some resizing as I drag the corner of the .swf window, but not correctly. I actually put the statement:
graphics.drawRect(0,0,stage.stageWidth, stage.stageHeight);into the code, and it is not drawing the origin at the corner of the window (among other problems). Is this a bug in Flash, and/or is there some way around this When I put the window back to its original size, it displays correctly, and this is happening for all stage sizes and aspect ratio
View 2 Replies
Aug 6, 2010
I was wondering if there is a way to auto resize the swf to fit a dynamic text field. I am doing a site and have text coming in from XML. some of the pages have a couple paragraphs where as some are much longer so when it is published the pages that have more text gets cut off.
View 4 Replies
Apr 27, 2009
I have an MC which is sized as follows:[code]This is fine until the stage size is altered....as the MC stays the same size unless the page is reloaded.How can I set the size of the MC so it resizes as the stage size is altered?
View 3 Replies
Feb 14, 2010
i have read your tutorial on the problem when resizing the browser. i found it really simple. but the example was limited to two objects on the stage. i have been working on a flash website and there are numerous objects on the stage already. since this is my first project i did not take into account the occasion when the browser will be resized. is there any way around this or do i have to specify each and every single object on stage to accommodate the resizing of the browser?
View 2 Replies
May 27, 2011
I have an air window that opens up and loads an swf half-size (my swf stage is 1280x720, but the 'preview' is 640x360). Right now, the user can import any-size image. From here the user has the ability to alter their image (elements on the stage, the positioning and scaling of the imported image, etc.). I know that there is a way to "screengrab" the stage and save that out to the user's hard drive (I got that working). Is there anyway to do this same thing, but at the full size of the stage. Meaning, the screengrab is only half-size, but is there anyway to perform similar stuff without screengrabbing,
View 2 Replies
Jun 25, 2010
'i am doing a game for children where users can drag and drop resize and scale movie clips on stage! The drag and drop is not an issue...however im not quite sure how to do all the rest... is there a way or a tutorial to do this?
View 1 Replies
Jun 25, 2010
'i am doing a game for children where users can drag and drop resize and scale movie clips on stage!
The drag and drop is not an issue...however im not quite sure how to do all the rest.
View 3 Replies
Feb 23, 2011
i am looking for class or something to proportional outside scaling of stage and all included objects (internal or external).I know SWFfit and LiquidStage. I have got many problems with integrating SFWfit to my code (resizing is not affected to included objects). LiquidStage seems to be ok but it`s not freeware . I am looking for free possibilities to do it.I am trying to connect that with GAIA framework.
View 3 Replies
Jun 25, 2010
'i am doing a game for children where users can drag and drop resize and scale movie clips on stage!
The drag and drop is not an issue...however im not quite sure how to do all the rest..
View 1 Replies
Apr 19, 2006
I posted this in the Flash MX2004 forum, but I hope I have better luck here.[URL] In that website, how do they keep some of the movieclip items locked on the edge of the screen? When you resize your screen, the items on the edges are the ones that moves correspondingly. And the fillers are near the middle part. Someone mentioned about adding a listener and act to a onResize command?
View 3 Replies
Jun 28, 2010
Full-screen flash site has stagAlign.TOP_LEFT, works fine, yet when I add a new MC to the center of the stage and resize it (TweenMax scaleX, scaleY) it hits the top and left corner and is pushed from that point. How do I go about allowing the new MC to extend the stage align. Resize MC with disregard for the stage's top left corner. I can center and resize the new MC fine but it will always hit the top left, and I would like it to extend the visible stage.
View 1 Replies
May 7, 2011
I have edited the pageflip script and file to suit what I need to do and my issue is not related to the usual addition of pages or content etc... but is to do with publishing the file. I have increased the sizes of the page from what they are in the original file and this is where the issue lies because when I come to publish the file as an exe the content no longer seems to fit the window when published and you have to expand the viewer. The instructions for quite a lot of the pageflip is there and pretty easy to decipher however outputting/publishing the file seems to be unclear.
Can somone please point me in the right direction for resizing the stage or changing the settings so that the published file shows all the content without the need to resize the window?
View 1 Replies