Center Align Movie Clips?
Mar 15, 2009How to Center Align the movie clips you have in the library when you call them through actionscript?
View 1 RepliesHow to Center Align the movie clips you have in the library when you call them through actionscript?
View 1 RepliesIm having trouble centering my movie clips on the stage.
I have postioned movie clip holders on the stage and and coded them to be invisible (10 of them). If the images loaded are less than 10, the extra movie clip holders stay invisible and the loaded ones become visible.I am struggling to center the visible movie clip holders.[code]...
I'll start off by saying I'm using Flash 8, Actionscript 2.0, and exporting as FlashPlayer 6.I'm trying to do this long landscape with a movie clip labeled, "mainMovie", let's say it's approximately 3600 x 600, while the stage/document dimensions are 800 x 600 .I have script on it so that moving the cursor to the left or right edge of the stage, the entire movie clip shifts left or right and through the rest of the landscape, similar to the 360 vr tours you see for some real estate sites online.On the main stage, I have that movie clip called, "mainMovie". Inside "mainMovie", is another clip called, "singleStrip", and inside that clip, I have other smaller movie clips through the landscape which are labeled and consist of random stuff, like shapes and items and stuff.
Everything works fine. The extra step that I am attempting is that I want the user to be able to scroll through the clip, "click" on an item, and then that item zooms into the front center stage and plays a small animation about that item. These items that are found throughout the landscape are movie clips themselves with script on them to be recognized as buttons.My problem with that is even though the center of my stage would be x=400, y=300, since my mainMovie on the stage scrolls from left to right, when I put in code to tween the item to a center position, that position is only set to the inside of the movie clip and not the center of the stage. I need to center a movie clip within two other clips to the stage.An example of the path of any of those items would be sort of like,
[code]...
That didn't work. It shifted it to a different position, not being the center of the stage.At another point, I tried to fake it out, placing a movie clip of a red ball on the main timeline in the center of the stage, and changed my code to:
[code]...
This didn't work, either.I do have other code that affects the motion scroll of the mainMovie from left to right, but I don't think this is the problem, I could be wrong.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundImage="images/Login_01.jpg" verticalCenter="0"
horizontalCenter="0"
width="800" height="600" horizontalAlign="center" verticalAlign="middle" >
I need to align the background image in center, but its not working its going towards to left for different resolutions.
When I do Publish settings (HTML tab), I would like to set it the way that my swf would be floating in the middle of the screen.However, I always end up with my website being "stuck" on the left or right side of the screen.These are the settings I have done, which result in the site being placed on left side of the screen:
TEMPLATE: Flash Only
DIMENSIONS: Match Movie
PLAYBACK: none is checked
[code].....
I used the publish feature of flash but it does not seem to center the SWF in the browser. Why is there a centering feature on the publish settings under HTML tab if it does not center the SWF? It only works if you set Dimensions to Percent but that exposes the area beyond the stage and i don't want it to be seen. In addition that causes some movieclips to be improperly positioned. The Flash Alignment should have been disabled if the Dimensions is not set to Percent. Perhaps a simple script that centers my swf file in a browser..
View 3 Replieshow can align my website to the center.... When i publish my fls filem it was aligned to the left.. i want to make it aligned in the center...
View 5 Repliesi have an xml gallery which works but when i cycle through the jpgs and come accross one a different size it loads it from left align i want center align
ActionScript Code:
var xmlRequest: URLRequest = new URLRequest("imageData.xml");
var xmlLoader: URLLoader = new URLLoader(xmlRequest);
[Code]....
I am creating a website on Flash 8... how can I align my SWF on the center of the HTML (left, right, bottom, top) ? (actually I am using a HTML editor to publish my site, where I insert the swf).
View 12 Replieshow to align center to page ... ?
project e catalog
[URL]
I try to align center a sprite container in the center of the stage.
What can be the method to do it?[code]...
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]....
I have an actionscript that loads images for a slideshow. The images are different sizes and overlays in the slideshow top left justified. I would like to center the images. Below is the actionscript. What do I need to add to it and where?
[Code]....
I have a VBox inside which I have 4 HBoxes. The second level HBox is initially hidden.When I click the label, 'Show more Options', the second level HBox is displayed.Now I have the space occupied by the 'second level HBOx' empty and the 'search' button appaers below the space.My first question is, Is there a way to position the Search Button in such a way that, the space is not there and after the 'Show more Options' label is clicked, the 'Second Level HBox' appears?And the second question is, Can I position the Search Button at the center of the page. Is there any method to center the contents of a HBox of a VBox?This is my code:
<mx:Form x="47" y="219" width="80%" >
<mx:VBox id="searchBox" >
<mx:HBox id="searchTitle" width="100%" height="20" backgroundColor="#2680D5">
[code].....
I have searched the net, but all those tuts are for Flex 3.
What is the approcach in Flex 4.5 to align the mx:MenuBar items in middle of the bar ?
(usually they are on the far left side)
I have a function that I use to load images. I center align the images after loading by using loadClip() and attaching the function that centering to the onLoadInit event. The problem I'm having is that the centering stop working when I upload the flash movie to a webserver. I was also able to replicate this when I Test the movie and then go to View->Simulate Download.
Here is the function in question:
Code:
Select allfunction displayImage( img ) {
// trace('displayImage()');
// lets mave the container invisible before loading the clip
_root.mcLargePhoto.centerPhoto._alpha = 0;
_root.mcLargePhoto.createEmptyMovieClip("centerPhoto",this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
// trace('onLoadInit()');
[Code] .....
I have created this Flash site:
[URL]
Under "Gallery", each picture, is a movieclip, which loads a picture from my server.
But the pictures aligns to the top left corner of the MovieClip. How do i make them align to the center of the movieclip?
My code is as follows:
Code:
holder_mc.loadMovie("../Nordic/images/pic1.jpg");
how can i align an image to center in a flash frame with actionscript 2.0? i'm trying something like that but it doesn't work.
imageContainer._x = (-(imageContainer._width - Stage.width) / 2);
imageContainer._y = (Stage.height - imageContainer._height) ;
I have a .swf movie that I would like to center on a page....and also align it to the top of the page so there is no space whatsoever at the top of the page.
View 2 RepliesI hav a flash website that i want to align in the vertical center of my browser....
i used all possible combos of publish settings in flash cs4 but it dint publish my webpage in center ....
give me a html code i can put in my index.html so that my flash object aligns itself in center .
The code is in the first frame of the timeline. I want to center an externally loaded image, but I just can't make it work:
[Code].....
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 Replieshow to make bgImage align in the center on resize, instead of top left?
Code:
Stage.scaleMode = "noScale";
_global.imgConstantWidth = bgImage._width;
_global.imgConstantHeight = bgImage._height;
[Code].....
This seems like it should be part of the "Adding Thumbnails" - the large images are align to the left when they load. So when you have landscape and portrait orientation images, they should horizontally align to center, not to the left.
View 4 RepliesI have created a slideshow, in which image is loaded dynamically from a xml. the issue is the images gets aligned to left ,top position by default. i want it to center align.
View 7 RepliesI have created a slideshow, in which image is loaded dynamically from a xml. the issue is the images gets aligned to left ,top position by default. i want it to center align.
View 7 RepliesI'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.
I have loaded the images inside the movie clip, however, only one loader content aligns to the center,particularly the last one loaded in loop.How to align all loader content in a loop?other options with this kind of scenario.
CODE:
var posX=100;
var posY=150;
[code].....
I bought a file, its an image rotator and it has a following code. I was wondering how can I make this image rotator align to the center of my stage.
[Code]....
My flash movie is 1440x900 but the area where all the important stuff happens in within 1024x768, i am trying to keep the middle in the center regardless of browers size or aspect ratio.
I can center the page but it doesn't work as i need it to. If the browers is small (1024x768) the swf is justified against the left edge, but not keeping the middle in the middle of the brower.
[URL] is an example of exactly what i am trying to achieve.