Embed a dynamic swf background (Please kindly help! Please.....)

Hi Everyone,

I am a newbie in Flash and I am trying very hard to learn how to make things work. I hope you guys will give me a hand as I have been struggling with the codes for a few days and nights and still couldn’t figure it out. Your help is much much appreciated!

Here’s the case:

I have a main FLA which is a flip book (the one like you click or drag the corner and will flip the page to the next one). And I have a swf background (a dynamic swf with floating bubbles which will move following your cursors).

I tried to embed the swf background in a container and then put it to my main Flash file (the flip book). It works fine but once I click the Full Screen button, the main contain (i.e. the flip book) is still aligned to the Top Left corner.

I tried many times by changing the codes such as removing the line “stage.align = “TL”” but it still doesn’t work.

Could somebody help me out with that?

I am trying to complete 4 tasks:

  1. To align the main content (flip book) to the center of the screen no matter in “Normal” or “Full Screen” modes

  2. To add the swf dynamic background to the back but still the flipbook will be aligned in the center without any changes (no matter “Normal” or “Full Screen” modes)

  3. Add a button to toggle Full Screen mode but the flip book will be kept in the absolute center of the screen

  4. Right click the flash and will show a pop-up menu. If I click “designed by:”, the whole screen will turn black (both “Normal” and “Full Screen” modes)

I try to list out the codes I have:

Toggle Full Screen


Stage.scaleMode="noScale";
bg_mc.loadMovie("background.swf");
 
//Stage.align = "TL";
 
function toggleFullScreen(){
//if normal size, go to fullscreen, else go to normal size
  if(Stage["displayState"]=="normal"){
    Stage["displayState"]="fullScreen";
  }else{
    Stage["displayState"]="normal";
  }
}
//Create a listener for each time the Stage is resized
var resizeListener:Object = new Object();
//Called each time the stage is resized
resizeListener.onResize = function () {
  //Move the button to the center of the screen
  toggleFullScreenButton._x=Stage.width/2;
  toggleFullScreenButton._y=Stage.height/2;
  bg_mc._x=Stage.width/2;
  bg_mc._y=Stage.height/2;
}
//Add the listener to Stage
Stage.addListener(resizeListener);
 

Here is the first few lines of codes of the floating bubble swf background:


Stage.scaleMode = "NoScale";
//Stage.align = "TL";
//
#include "animFunctions.as"
//
grad._x = 0;
grad._y = 0;
grad._width = Stage.width;
grad._height = Stage.height;
//
var stageListener:Object = new Object ();
stageListener.onResize = function () {
 grad._x = 0;
 grad._y = 0;
 grad._width = Stage.width;
 grad._height = Stage.height;
};
Stage.addListener (stageListener);
//-------------------------------------------------------------------------------------------------------
//define number of layer.
var layer = 10;
//number of items in a layer
var items = 25;
//create the bg that holds the layers
this.createEmptyMovieClip ("bgHolder",this.getNextHighestDepth ());
//this function will update the layers current position
 

I am not sure if the codes in the SWF crash with those in my main FLA (Flip book). like the x and y width and coordinates…I really don’t know…:hair:

I can upload all FLA and AS files for you guys to review. Please kindly let me know who can help me out and I will send you the links. Thanks a lot!!!

Much Much appreciate your help!!