ActionScript 3.0 :: Align Objects To Stage
Jun 25, 2010
I want to align objects to the stage, so that after the browser window is resized, the objects/MC's are still in the same places (top middle, right middle and so on...).[code]But this has to be loaded from an external .as file as far as i'm aware.I need the above code to work on frame one of the flash file. How can this be done? i'm sure it's something easy like replacing the "public" parts of the code... Also does the obj part of the code refer to the MC name?
View 9 Replies
Similar Posts:
Oct 22, 2007
I've been putting off asking this question and have tried to resolve it myself since it would seem to be so basic; however after much frustration , here goes:Can a display object (ie an instance of a class loaded from the library such as a filled rectangle {trying to keep this simple} be positioned on the main stage by using the following syntax:myrecTangle.stage.align = StageAlign.BOTTOM;I have created a fairly simple class to load objects to the stage by class type (recTangle) and name (myrecTangle) and all works fine up to the positioning. The objects are created and named properly and are placed on stage; however, they are all placed on stage at 0,0 stage coordinates. I can postion them anywhere using x. and .y values but when I use syntax similar to that above they are still positioned at 0,0. There are no errors thrown. I have also tried to create a sprite for each, load them into the sprite and addChild the sprite to the stage. They are still positioned on stage at 0,0. Is the stage.align/StageAlign syntax peculiar to absolute main stage positioning or am I allowed to use it also for object positioning.
View 1 Replies
Jun 18, 2009
When using the Align tool to align to objects to each other, but not the stage, how does Flash choose which item remains stationary and is aligned to?
View 1 Replies
Apr 23, 2010
I have a stage bigger than the size of a browser, and I have a camera to navigate around the area.Now when I click on a button, I will have something pop up blocking the whole browser, like a lightbox effect with another box on top of the blocker.The problem now is, when the blocker pops up, its position is not on the TOP LEFT corner of the browser. I've tried stage.align, but it would makes the camera or other object on stage position run.So is there any other way I could get the blocker to position according to the browser, not the stage?[code]
View 1 Replies
Oct 10, 2010
In Flash CS5, none of the align buttons work (in the align tab, in modify > align, or with ctrl + alt shortcuts). Right now I have to take the stage width and object width and put in the x and y coordinates manually to align objects.
View 2 Replies
Jun 4, 2010
Here I aligned Left Center...
How to generalise?
I have created three movieclips." image","crop","fixedPoint"
I am rotating the image 0,90,180,270,360..
image always align with fixed point.
ActionScript Code:
import flash.geom.Rectangle;
function alignObject()
{
[Code]....
View 4 Replies
Mar 7, 2010
for example the rotational points of clock arms that are not in the center or edge of the arms to get aligned to the center of the clock face?
View 2 Replies
Aug 17, 2006
How do I snap/align objects dynamically? For instance, if I have an image loading dynamically and a text box directly below, I want the text box to always touch the edges of the image loaded (regardless of the image's size).
View 3 Replies
Feb 16, 2008
I face a problem when aligning objects with different height in a Carousel animation. Each object is an image that loaded from xml file. The result is here: [URL] You see, the object with high height will overlap my reflection. I try to set the registration point but it's not working. how to align all the objects by bottom edge.
[Code]...
View 7 Replies
Aug 13, 2010
Does anyone know how to align objects (movieclips) to the stage, let's says I have a logo and menu positionned on left side and collection of pictures in middle of stage.
I want that after the browser window is resized, the objects are still in the same places but moves dynamically to left side without hiding to user view.
View 2 Replies
Mar 17, 2011
I have a pure code Actionscript 3 project in flash builder 4 and I want to align the stage. For now I have a sprite that I have set the x property to 10, but the sprites are in the middle of the screen. How to set these kind of properties in code? I suppose it's the stage object that needs to be set in some way.
View 1 Replies
Jan 19, 2005
Ive got my flash movie set to 100% width & height, while the stage is set to no scale. Is it possible for me to align an mc to the bottom regardless their window size?
Just to clarify if firefox is larger than the stage, can i align this mc ( like a footer ) to the bottom of the ussers screen.
View 3 Replies
Oct 11, 2010
I have created a working flash file virtual_cube.swf in which I use Stage.align for panning. When virtual_cube is loaded from another swf (whhich I have no control over) the use of Stage uses the loader swf.I know _lockroot is nice for when using _root, is there something similar for Stage? like _lockStage?
View 1 Replies
Jan 5, 2010
when my flash movie in full screen status i want to align stage center. (Vertically and horizontally) from this code i able to align stage horizontally center.
ActionScript Code:
Stage.align = "T";
but its not vertically align middle. its only aligned to top (Vertically) what is code/ property i should use to make it vertically middle.?
View 0 Replies
Sep 21, 2010
i want to show more than One image On stage Using Loader class and withOut Xml ..for these purpose i written code below but i suffer with Align these image .......in my stage i can view only single Image.
Code-----------
public class mydoc extends MovieClip
{
[code]......
View 4 Replies
Nov 6, 2011
if i have some mc objects on stage and they align lets say to the top side and bottom of the screen then if resized smaller than stageWidth 800 and stageHeight 550 they stay where there are and if the stage is resized bigger then they lock to the top side and bottom. Ive got so far with it and it works ok but if i try and resize the window randomly with the mouse ( like clicking the bottom right hand corner and squiggle the mouse around it acts weirdly.
View 3 Replies
Nov 16, 2005
Ok, not sure if this is just me, or if it is everyone - and i have looked for information on this a lot but cannot find anything on it.... I do a lot of 'aligning' in actionscript, and to align objects say to the bottom of your page you could do something simple like; my_mc._y = Stage.height - my_mc.height Which worked fine in Flash Mx2k4, but now in Flash 8 objects seem to align directly to the Stage and not the Page so to speak. Was wondering if anyone knew if this functionality had been changed in the new version of flash or if there was a new 'ammended' way of aligning objects on your page regardless of the 'Stage'.
View 9 Replies
Apr 29, 2007
I want flash banner to span acros the screen so I put width="100%" and Stage.scaleMode = "noScale"; ok. But, this way all its content is centered. I want it to stick on the left, and so I put this code in it:
Code:
onEnterFrame = function () {
_root._x = 0.5 * (750 /* original document width */ - Stage.width);
}
This works. But the way this thing works when I resize browser window is far, very far from smooth. I tried to change it to
Code:
onEnterFrame = function () {
var rx = 0.5 * (750 - Stage.width);
_root._x = rx + 0.1 /* or another number */ * (_root._x - rx);
}
I am wondering if there is some straightforward way to do this, like some hidden FLA setting, or some Stage/_root property, and if there is no, how the hell to script it?
View 1 Replies
May 20, 2009
I'm creationg a full screen projector presentation and i'm havin issues with the stage align on full screen. it opens in the middle of the stage and is chopping off the top of the large stage. does anyone know the as2 for Stage.align="T"; ?
View 1 Replies
Jul 8, 2009
I try to align center a sprite container in the center of the stage.
What can be the method to do it?[code]...
View 5 Replies
Mar 9, 2010
I've used the following code to create a textField and style it with a little CSS my problem is the textFeild is as wide as the stage and I want to center the text so its in the middle of the stage but when i use the css attribute textAlign the text is almost all the way to the right instead of centered
PHP Code:
var msg19:TextField = new TextField();
msg19.width = stage.stageWidth;
msg19.height = stage.stageHeight;
[code]....
View 2 Replies
Sep 28, 2010
How can do align movieclip to stage dynamically. If i use align panel, Movieclip perfectly aligned to stage. Here i have attached sample image.
For the Movieclip the registration point may be change.
View 4 Replies
Sep 25, 2009
The following code blocks create a movie clip 20px high and align it to the bottom of the stage (I add 100px to stageHeight because by default it traces 300 instead of 400). Regardless, both code blocks work when tested in Flash.In HTML however, only the first code block works.The second code block produces a blank HTML page. The second block is so that I can change the footer's height and still have it sit at the bottom of the stage...Considering "footerY" traces 380px, I have no idea how the two code blocks are so different that one HTML page makes the clip visible and the other doesn't.
Code:
var footerHeight:uint = 20;
// var footerY:uint = (stage.stageHeight + 100) - footerHeight;
// trace(footerY);
[code]....
View 5 Replies
Apr 7, 2009
I have these 2 lines of code from a tut, but it centers the container. I need it on the right of the screen.
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;
View 2 Replies
Dec 17, 2006
i have a little problem about a MC.
- I put it on the stage
- I put an action script in my MC wich look like this:
[Code]...
The MC dont move at all, and it isnt in the Bottom of my screen
View 5 Replies
Apr 15, 2011
[URl]..i wanna know how he did when resizing the browser all the child are still in there alignment?
i think its about no_scale in different child and stage.
View 2 Replies
Jul 9, 2010
How do you set stage.align to center (vertical and horizontal)? StageAlign only defines corners and edges, but I know that centered is possible because that's the default behavior?
View 4 Replies
Apr 6, 2006
Is there a way to say "only use the coords of the viewable area" when aligning a mc that is masking a really wide object? (I'm looping through XML and duplicating MC's inside a centered mc and under a mask.)
View 7 Replies
Oct 10, 2009
im using this code:
Code:
Stage.align = "BR";
var stageListener: Object = new Object();
stageListener.onResize = positionContent;
[Code]....
..to fix the position of my MC, but the parameter "BR" (and all others) aren't effecting. My mc always shows up in the bottom right corner.
View 3 Replies
May 1, 2010
I'm doing some tests and I'm trying to create a simple presentation. It's not something I'll be using online. I just want it to present some things at school. Since I don't know the resolution of the monitor at school, I wanted something I could max the window and rest with the content (stage) centered. At start, everything was working fine but sudenly the stage started to be aligned to top left when exported and windows maximized. Here's my code:
[code]....
The bkg.swf is an external background I'm using... it ajusts it's size to fill all the window automaticaly. When I first wrote this code, it was working fine. Than I added some objects and MC's to the stage and now whenever I export the file it's aligned to the top left of my window.
View 13 Replies