ActionScript 3.0 :: Stage Resize Cleaning The Objects?
May 11, 2009
I got on stage a bunch of squares (sprites), so when the browser change size, I need to re-draw this squares and re-calculate max numbers of that can fit on the page, and so on..., my issue is I call three functions in the resizeListener
clearPage();
setupPage();
drawSquares();
[code].....
View 5 Replies
Similar Posts:
Mar 2, 2005
I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when I click a button, I would like the stage to be cleared, then another frame with another isometric code and another array to load. The problem I am facing now is that the items positioned from the smiley are still on the stage if the next array is smaller than the previous one. Any way I could clear the stage before going on the next frame? Currently, I tried unloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
trace(n);
n--;
unloadMovieNum(n);
if ( n<=0){
nextFrame();
} else { stop(); }
}
What happens is that it clears the stage, but doesn't load anything in the following frame.
View 8 Replies
Oct 19, 2011
I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.
View 1 Replies
Jul 29, 2009
if you have object inside of object inside of object ... etcwhen you want to completely remove it is it enough to just say:removeChild(topObject);or you need to go inside and start cleaning from there?
View 3 Replies
Jun 26, 2011
I'm a relatively experienced programmer, but I'm completely new to as3my question is how can I remove one object and subsequently all it's child objects and their listeners?I need to remove all objects from a certain object called "world". My objects are all on top of this "world" object. the game has a level object which is on top of this "world" object and it produces enemies among other things on an enter frame event.To remove this from the stage I call the world.destroy() method from the main timeline.
Code:
// * Destroy the world
public function destroy()
[code].....
View 5 Replies
Mar 2, 2005
I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when i click a button, i would like the stage to be cleared, then another frame with another isometric code and another array to load.The problem i am facing now is that the items positionned from the smiley are still on the stage if the next array is smaller than the previous one.Currenlty, i triedunloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
[code].....
View 8 Replies
Dec 23, 2009
I have an object inside my flash file and i want to lock the object on 0 x-axis 0 y-axis but when i re-size my SWF file my object's location changed to another location how can i fix that?
View 1 Replies
Feb 27, 2006
i saw a thread while ago .. that always position a movieclip in the middle of the stage even if the stage or window resize any1 can point me to it
View 3 Replies
May 10, 2008
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.
Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;
[Code].....
View 1 Replies
Sep 9, 2009
I've got a large bitmap (1920 x1306) that my client wants as a bg image, scaled to the swf size on load (930 x 575); but that can "grow" up to its original size if/when a user expands the browser window. All the rest of clips in the display list are to remain in place (except for a copyright clip, which they want to always be 14 pix above the bottom of the browser frame. I've tried loading the bitmap dynamically at full size and then using scaleX,scaleY to set it's initial smaller (930x575) size, and I've tried just setting the height/width of the dynamically loaded image using the math of scaleX,ScaleY just in case the scaleX "transformed" the bitmap so that it couldn't return to its original size. Both make the bitmap the right size. But the resize function below did nothing to it, (or the copyright.y.) THEN I tried just putting the bitmap into the display list (both sizing methods work here, too). But even as an original member of the compiled display list, the resize event is still not reaching the target. Everything I've seen on the web says this should work - but...no luck.
Here's the AS3 code in the 1st frame of my swf:
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
[Code]......
View 1 Replies
Jan 18, 2010
All I want is to create a line (which is part of a rectangle) with a certain height (60), which I can then resize to another height. This works if I do it by hand (or mouse ), but if I use AS3, the line (or whatever object I'm using) is too small. Not only that, but the bigger the enlargment, the bigger the difference! I have attached an .fla file that contains two examples:On the right a rectangle that is being created with AS3, on the left two lines, one is just a Drawing Object, the other one a copy of that and made into a MovieClip symbolach example will be enlarged (by 200px) and in each one you can see that this results in a gap between the end of the line and the control object (red). Also, I measured the length of the line and it is indeed to short.
View 1 Replies
Jul 24, 2010
I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names likeblueRod_mc, etc.I place them around with time-line code like
blueRod_mc.x = 300.0;I have now created an Actionscript class called Problem.I build a new object from Problem which I have called Riddle.But when I put blueRod_mc.x = 300.0 in a method (of Problem),I get the message that blueRod is not accessible.So I triedstage.blueRod_mc.x = 300.0;That did not work either.
View 9 Replies
May 6, 2009
How do I start to program with 3 objects on my page:
"logo_mc", "menu_mc" and "container_mc".
I'd like to put them on correct order when the stages grow (it depends of wich user's screen).
But how does it work? With 3 objects, I mean resize logo, the container and the menu..
View 1 Replies
Jan 21, 2012
I am new in flash so this question can sound stupid
I am about to create my first drawing in the adobe flash of some creature.
The problem is CAN i resize it when the flash is running (in runtime) by the end user.
Example: I want to increase the height of the creature.
View 1 Replies
Jan 14, 2010
I have is as I add objects from other classes to the stage, is there a way to automatically add them to the resize event I have on the main stage to keep them in position in my fluid flash layout? Currently I am declaring all the variables in the project at the top of my primary class, adding them to the stage in the opening function, and then finally adding them to the resize event.
View 0 Replies
Feb 16, 2011
IE 8 Flash CS4 v10 Windows XP Home SP3 (NOTE: The word "Resize" refers to an HTML change of the movie size; it does not refer to a Window resize)
Objective: Display a transparent 800x600 flash movie in IE, stretching movie to 100% width and height of webpage but keeping the objects within the movie from getting re-scaled. Objects are re-positioned at runtime via ActionScript with values meant to be relative to stage dimensions.
Problem: The movie resize is messing up the object re-positioning. The movie is indeed stretching to 100% of the width & height of the browser window's client area, but the objects are repositioned relative to something else (perhaps screen dimensions, but not sure). Result: Objects which were programatically positioned relative to original stage size are spaced way too far apart in IE, in some cases off the screen entirely, though they were not like this in the Flash editor.Question(s): Why are objects which were positioned within the original stage dimensions being kicked off the browser screen while the movie itself remains entirely on-screen even after resize? What dimensions/values are guiding the automatic post-resize repositioning of the objects? (These proportions appear to be different from the change in proportions of the movie itself.)
View 1 Replies
Jan 19, 2011
How would I place objects in flash, moving and resizing them, etc. and then export coordinates/rotation to a text file or something like that?
View 1 Replies
Jan 30, 2010
I have been looking for a tutorial or thread to help me figure this out. I am trying to make a site that when the browser is resized the objects in the site either resize or keep their position and stay visible. The link below is an example of exactly how I want this to work.[URL]...
Im working in AS2, and Im not sure if this can be done in flash alone or needs to be done in html or a combination of both.
View 1 Replies
Jan 5, 2009
if i wanted to modify the xy size properties of several pieces of media through a looping function and an incrementing variable how could i do it? resize multi objects through loop & incrementing variable
View 1 Replies
Jun 20, 2010
I have two problems. 1) the page still will not resize properly until the window is resized. I assume I have the code wrong somehow.
2) I changed the height of my menu object to stage.stageHeight, but its now coming up squished and only about 30% of the actual height of the stage. I am not sure what I did as it seemed to be working before, but I cant seem to fix it.
Code:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, stageresizeListener);
[Code]...
View 6 Replies
Nov 18, 2009
Is it possible to resize everything on the stage in one (or a few) step? I know scaling the movie has the same result, but when working in Flash it's a lot easier when you see the actual size.
View 1 Replies
Aug 14, 2008
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 pageAnd 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:
[code].....
View 9 Replies
May 15, 2009
They show their work as the page�s background which can be resize with the browser window, but their navigation always stays the same.I know how to achieve the resizing effect, but it resizes the whole stage including navigation.
View 2 Replies
Jun 8, 2009
I've created a map with the 50 states. I then hardcoded this so that when you hover over them the alpha is set to .5, and if you click on when it's ChildIndex is set to -1 and it plays the animation of the state growing to full size. I know there is a better way to do this, rather than how I wrote each line of code for each of the fifty states...
I'm also trying to play an outro animation "down" after the state is clicked while it is enlarged from the "up" animation.I also tried to create a var state so that when you mouse off of a state the state is no longer highlighted, but I ended up doing a work around using currentframe=.
Code:
//import flash.events.MouseEvent;
var small:int = 1;
var big:int = 2;[code]....
View 6 Replies
Jan 31, 2010
The stage is set to 955x465 at 1st frame but once load external movie clip in 2nd frame the stage is set to 955x855 size, is it possible to do it?
View 1 Replies
Feb 6, 2010
I created a game but I made the game a little too big. It would be alot of hard work to shrink all the objects in the game and resize the stage using the properties. I notice that in debug mode the whole screen can shrink when you adjust the window. Is there some code I can use to this on it's own? and will it be costly on performance ?
View 2 Replies
Jul 9, 2009
i am trying to build a resize with stage image gallery. It is working except for when you first open the swf the image has it's original size, and it only adjusts to the stage when the stage resizes.s the script:
ActionScript Code:
Stage.addListener(this)
this.onResize=function(){
[code]......
View 0 Replies
Jul 13, 2009
have a Movieclip where i have duplicated a clip that loads external swf. My cuestion is how can i make this movieclip resize it self and it's content on stage resize.
View 2 Replies
Jun 7, 2010
I have a movieclip that i want to resize to fit the stage and center it with a button click. Then resize back to it's original size and place with a second button.[code]...
View 6 Replies
Dec 3, 2010
I'm trying to resize my stage using this code but I can get it work correctly. (I'm using FLASH CS4)
ActionScript Code:
var Stage_height = flash.system.Capabilities.screenResolutionY;
var Stage_width = flash.system.Capabilities.screenResolutionX;
[SWF(width=Stage_width, height=Stage_height)]
When I launch it I get this ERROR Could not parse 'Stage_height' as a number for height. And the same for the width.
I tried to set them as Number variables but that didn't work either.
View 7 Replies