Jump to content
Search Community

It is always on Top. How to bring it to desired level?

learner_7n test
Moderator Tag

Recommended Posts

Hi,

 

The following code works fine but the .SWF stays always on Top of the other Layers. How can I bring it down as per my requirement (Say, I have 10 Layers and I want my this .SWF file to be on Layer 3 from the botton)? Please do help.

 

var mySwf1:SWFLoader = new SWFLoader("AnalogClock.swf", {width:225, height:225, container:this, onComplete:completeHandler1});
mySwf1.load();

function completeHandler1(event:LoaderEvent):void {
   TweenLite.to(event.target.content, 0,{alpha:0});
   TweenMax.fromTo(event.target.content, 2, {x:225, y:-500, width:225, height:225, alpha:.5}, {x:225, y:300, width:225, height:225, alpha:1, delay:1, ease:Strong.easeOut});
}

TweenLite.delayedCall(20, mySwf1.unload)

 

Please do help.

Link to comment
Share on other sites

Guest aezzell

Put an empty movie clip on the layer where you want the loaded SWF to appear, and set that as the container for the SWF.

 

//set up the holder
var swfHolder:MovieClip = this.mySWF_mc;

//create a LoaderMax named "mainQueue"
var queue:LoaderMax = new LoaderMax({name:"mainQueue"});

//load the SWF into its holder
queue.append( new SWFLoader(theSWF.swf, {name:"swf01"],container:swfHolder}) );

 

Hope this helps.

Link to comment
Share on other sites

Hi,

 

Thanks for the reply. I have tried the code and getting the following error:

 

1120: Access of undefined property WaterFall.

 

The following is the whole code is:

 

stop();

import com.greensock.*; 
import com.greensock.easing.*; 
import com.greensock.plugins.*; 
import com.greensock.events.LoaderEvent;

import com.greensock.loading.ImageLoader;
import com.greensock.loading.LoaderMax;
import com.greensock.loading.SWFLoader;
import com.greensock.loading.VideoLoader;
import com.greensock.loading.display.ContentDisplay;
import flash.display.MovieClip;


//set up the holder
var swfHolder:MovieClip = this.mySWF_mc;

//create a LoaderMax named "mainQueue"
var queue:LoaderMax = new LoaderMax({name:"mainQueue"});

//load the SWF into its holder
queue.append(new SWFLoader(WaterFall.swf, {name:"WaterFall",container:swfHolder}));

 

mySWF_mc is the layer (MovieClip) where I want to put my "WaterFall.swf" animation file.

 

Thanks.

Link to comment
Share on other sites

Hi,

 

I tried it. But getting the following error:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at Waterfall_fla::MainTimeline/init()

at Waterfall_fla::MainTimeline/frame1()

 

The code:

 

  //set up the holder
   var swfHolder:MovieClip = this.mySWF_mc;

   //create a LoaderMax named "mainQueue"
   var queue:LoaderMax = new LoaderMax({name:"mainQueue"});

   //load the SWF into its holder
queue.append(new SWFLoader("WaterFall.swf", {name:"WaterFall.swf",container:swfHolder}));
queue.load();

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...