Actionscript 3.0 :: Centering Mc On Browser Resize?
Mar 24, 2011
I am working on a flash website which needs to be fluid layout. The background image is resizingperfectly fine when the browser is re-sized.I have also managed to make the logo centre on re-size. My problem is with the two other movie clips which both have other mc inside.My content is residing inside a movie clip called "content_mc" inside the content_mc I have other movie clips with AS. I have tried using the same line of AS I used to centre the logo on "x" but the content disappears of the screen on run time!I thought maybe I am doing something wrong in the math. Note my content_mc it is positioned at x= -1620 and y= 270 W= 900 H= 7412. Here is the AS I use to resize the bg img and to centre the logo_mc
Code: Select all// background image resize..//
function init()
{
[code]....
View 9 Replies
Similar Posts:
Nov 19, 2010
I want to center a big movieclip (1400 px wide) on my stage on stage resize. This big movieclip moves to the right on certain events so I can't use code like this:
currentPage.x = ((stage.stageWidth/2) - (currentPage.width/2))
Is there a way to maybe use its offset from 0 (the left side of the stage 'viewport') and use that offset in centering? The movieclip only changes in x.
View 2 Replies
Jul 7, 2011
I'm having a bit of a problem here. As per the title, my flash swf file works fine when tested from the IDE, but when I publish it and open it through the browser, the stage doesn't seem to resize along with the window.I post below a bare-bones example. The "back" movie clip should resize, only it remains at the starting dimensions
Code:
import flash.events.Event;
import flash.display.MovieClip;
[code].....
View 9 Replies
Feb 22, 2010
- How can I center my main SWF inside the browser without stretching the the swf? I just want it to be center both horizontal and vertical when you resize the browser.
- I found some tutorials but it is only referring to just ONE movieclip. What if I want to center the whole stage? Is there any other way to call the stage that has content in it?
View 1 Replies
Jul 8, 2004
I'm trying to center an swf in a browser without using table width and height 100% and the most promising way i've found so far is to set
Stage.scaleMode = "noscale";
in the first frame and then set the width and height of the object tag in the html to 100%. However, i'm having trouble getting this to work with the doctype in some newer browsers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
[Code]....
View 3 Replies
Feb 22, 2010
I have some questions about centerting your SWF inside a browser using actionscript 3.0.
- How can I center my main SWF inside the browser without stretching the the swf? I just want it to be center both horizontal and vertical when you resize the browser.
- I found some tutorials but it is only referring to just ONE movieclip. What if I want to center the whole stage? Is there any other way to call the stage that has content in it?
View 4 Replies
Jul 8, 2004
I'm trying to center an swf in a browser without using table width and height 100% and the most promising way i've found so far is to set Stage.scaleMode = "noscale";in the first frame and then set the width and height of the object tag in the html to 100%. However, i'm having trouble getting this to work with the doctype in some newer browsers.[code]
View 3 Replies
Jun 2, 2009
how to horizontally and vertically center a browser pop-up window in Flash? Below is the code tied to my Flash button:
on (release) { getURL("javascript:openNewWindow('http://www.blahblahblah.com','thewin','height=300,width=400,toolbar=no ,location=no,menubar=no,status=no,scrollbars=yes') ");}
[Code].....
View 13 Replies
Sep 18, 2009
I've just finished building a website with a fluid layout. When I tried it in the browser, it's not centered. I tried adding <center> </center> tags to the body of the HTML page but this didn't work... so how can I fix it?
View 7 Replies
Dec 17, 2007
I'm having a hard time setting up my website page to center (vertical and horizontal) my flash movie in a browser. I was finally able to get it to fit screen no matter what resolution, but it looks more to me like it's aligning itself top/left.
[Code]....
View 1 Replies
Sep 18, 2009
I've just finished building a website with a fluid layout. When I tried it in the browser, it's not centered. I tried adding <center> </center> tags to the body of the HTML page but this didn't work.
View 1 Replies
Mar 30, 2011
I have a 2037px wide flash movie that I purposely made that wide so that it would take up just about any screen.
What I'm trying to do is simply center it and basically hide the overflow on smaller screens when the movie appears on the end user's monitor. I can't get it to center, however, as it always just wants to align to the left. I don't want to use the 100% feature because that distorts the movie.
I've tried using the "overflow: hidden; text-align: center;" CSS feature, to no avail. Is there a way in CSS to make this work? Do I need to use javascript or something? If so, which script do I use?
View 1 Replies
Dec 25, 2002
how i canter my website like lostinbeta.com, beck.com etc. Right now whatever i do, dreamweaver positions my flash site in the top left corner of the browser, save the small border on the top and left,
View 3 Replies
Sep 28, 2010
I have a datagrid that occupies 100% of browser screen. I want the grid to automatically resize when the browser is resized to small or full screen.
View 1 Replies
Jul 22, 2011
I have a Flash page that is a bit off center on smaller resolution screens. If the site was centered, and the sides were cut off, then all would be well. But the site starts in the top-left corner, so some content is clipped. I know the problem can be solved in JavaScript, but I'm wondering if there is a more elegant, possibly CSS-way,
View 2 Replies
Dec 3, 2006
i'm going by the tutorial "mastering Full Browser Flash" at [URL]
and i'm having trouble getting my mc to center in the stage and browser.here is the code i have on frame1:
Code:
Stage.scaleMode = "noScale";
stageListener = new Object();
stageListener.onResize = function() {
[Code]...
View 6 Replies
Mar 4, 2007
I seen alot in many sites. Full screen flash site with objects in the site centering or their predestined position as browser scales.
View 3 Replies
Mar 29, 2007
I have a script on my first frame to have a full browser tiled background. I also have a script to preload my file. My problem is they don't seem to be working well together. The preloader works but the full browser script doesn't center my file until I resize the browser and then it snaps to the center.
View 2 Replies
Jan 10, 2010
I have a full flash website built using Flash (of course). So I publish it using flash itself. But I am having a difficult time aligning it in center with its original dimension. I dun want my swf stretch out or scale at all. I want to display it without scaling and also in the center of the browser window.
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP;
I did try these and also tried changing my publish settings but didn't work.
View 7 Replies
Dec 10, 2006
having some problems with having my mc's always center in t5he middle of the browser window even when it resizes??
Cheers all,
basically the code i'm using is this:
_root.abc.Stage.width/2;
[code].....
View 1 Replies
Sep 10, 2009
I have a scalable flash for the most part the site works okay. The problem I am NOW having is I can't get my external .swf files to load in the center of the site based not on the flash stage height and width but the browser / screen resolution height and width... This is what I have so far and it is not working for me..
// detects width of end users browser
var resX:int=flash.system.Capabilities.screenResolutionX;
trace(resX);
[code]....
View 8 Replies
Oct 30, 2009
I have this flash website where i use Stage.scaleMode to dynamically resize the swf depending on the browser size. (i use A.script 2.0). So the width takes the whole screen and the height is scaled in proportion. My design is in a landscape format. It works fine, except that i need the swf to also be vertically centered in the browser Window. (explanantion - on certain screens, example a 19 inch PC monitor which is quite "squared", my flash movie expands the whole way across the width, and the height in proportion, but as my design is in landscape, i have a big empty space in the browser below the swf.)
This is how it is: This is how it should be:
Here is the code:
stop();
Stage.scaleMode = "noScale"
Stage.align = "TL";
[Code].....
View 1 Replies
Jun 10, 2011
We have recently made a new Flash website for our company (URL...). The Flash module itself is 800 pixels tall. We have CSS that centers a div horizontally and vertically that's wrapped around the Flash module (you can see the source of URL...) and when someone is on a browser on a netbook or a smaller laptop (sub 15-inch, generally), they don't have enough vertical resolution (after the real estate used by the Windows start bar and browser toolbars) to see the entire site.Whether you view the html page I've made (again, at URL...) or you view the Flash module itself (URL...) the top of the Flash module clips off the top of the browser. (To see the problem if you don't have a small laptop, just don't maximize your browser window and shrink it's vertical height.)I understand why my CSS is behaving the way it is, due to the nature of the negative top margin, but is there any way to solve this issue?
View 1 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 6, 2009
how to create this:[URL].. the site will resize itself no matter how you resize your browser.
View 2 Replies
Feb 12, 2010
I am trying to achieve the resizing effect as seen on [URL]There is no distortion no matter what direction the browser window is resized.
View 1 Replies
Dec 23, 2010
I got my external swf to center...However, when I resize my browser the external swf dissapears off the screen (I can still hear it's music though) Anybody have any suggestions? Heres my class code:
[Code]...
View 3 Replies
Jul 16, 2011
I am creating a site and I want a small swf slideshow background to be loaded into the main site SWF and be able to be resized to fill the browser. But as I bring in other swf files they are able to retain their size, not be resized in the browser. And I want the main site to stay in the center of the browser.
View 5 Replies
Jul 29, 2011
I'm trying to run my swf by going directly to it on my serer eg(www.example.com/mySWF.swf), later I will embed it using HTML or PHP, however Im wondering why it keeps getting resized to the window size, I want it to stay the size of the swf. In the publish settings I set dimension to Match Movie, and I set scale to No Scale in the HTML tab of publish settings, am I doing something wrong or can you not have it stay its original size without emedding it into html?
View 5 Replies
Aug 17, 2011
I'm pretty new to Flash but working it out. Just one question: how does one make it so the Flash animation automatically resizes depending on the resolution of the user's screen? I made a site with a Flash video that looks perfect on my screen, but when my friend with a different resolution goes to it, evertyhing is out of whack..
View 3 Replies