We help IT Professionals succeed at work.
Get Started

Centering Flash movies and full screen

kwood79
kwood79 asked
on
420 Views
Last Modified: 2013-11-11
Hello and thanks in advance for any help you can provide. I'm an AS novice and usually can find what I need on the web and am able to hack code enough to accomplish my objective. But I'm stuck on my current problem. Here is what I'm trying to accomplish...

I have two movie clips in my Flash file. One called "mc_bg" and one called "tempMC". tempMC sits on the layer above mc_bg.

When published, I want tempMC to center in the browser and remain centered (no scale - stay at 100%) when the browser is resized. However, I want mc_bg to remain centered, but I do want it to scale or go full screen in the background. Basically stretch proportionately, edge-to-edge in the browser.

I am able to accomplish what I want with tempMC, but not with mc_bg. These are my publish settings when creating my HTML file and my AS code is below.

Dimensions: Percent. Width 100% x Height 100%
Scale: No Scale
Flash alignment: Horizontal: Left   Vertical: Top
tempMC._x = Stage.width / 2;
tempMC._y = Stage.height / 2;

mc_bg._x = Stage.height / 2;
mc_bg._y = Stage.height / 2;



var stageL:Object = new Object();
stageL.onResize = function() {
	tempMC._x = Stage.width / 2;
	tempMC._y = Stage.height / 2;
	mc_bg._x = Stage.height / 2;
	mc_bg._y = Stage.height / 2;
}

Stage.addListener(stageL);

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE