Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adjust Layer Order with AS3

Engaged ,
Apr 27, 2014 Apr 27, 2014

I want to load an external SWF into my project. I do so by adding a Loader to the stage. It appears above everything, there are 16 layers in my FLA and I want to put it between the second and third to bottom layers. How would I do this? I looked up some things online but all of them are for change object order on the same layer, and they usually invole making 2 or three objects with AS3 then changing order on the same layer, still above objects that are actually on the stage in the FLA. I want to put the loaded SWF below ALREADY EXISTING OBJECTS that are on different layers.

My code:

var pageLoader:Loader = new Loader;

addChild(pageLoader);

pageLoader.x=98;

pageLoader.y=121;

//pageLoader.z <--- As far as I can tell this only works within one layer, it wont jump from layer to layer.

Some suggested loading my swf into an ampty movie clip, bt when I do that I lose interactivity for the swf, why is that and is there away around this?

My code:

var pageLoader:Loader = new Loader;

pageContainer.addChild(pageLoader);

//pageContainer is an empty movie clip

I want to load it directly to the stage and just change the layer(first method), but if this cannot be done then I need a way to get the swfs loaded into an empty movie clip and keep thier own interactive.

TOPICS
ActionScript
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 27, 2014 Apr 27, 2014

I dound out about addChildAt, which is different from addChild, becuase it has 2 parameters, the object name and its z-index. So I was able to do:

addChildAt(pageLoader,4);

Then I ran into the same issue with as the empty movie clip method, I lost interactivity. Then I noticed it has movieclips above it covering it because one of them is being used as a blend mode. So I realized the empty movie clip method wasnt working because there are movie clips above it. So I did mouseEnabled=false. And it wo

...
Translate
Engaged ,
Apr 27, 2014 Apr 27, 2014
LATEST

I dound out about addChildAt, which is different from addChild, becuase it has 2 parameters, the object name and its z-index. So I was able to do:

addChildAt(pageLoader,4);

Then I ran into the same issue with as the empty movie clip method, I lost interactivity. Then I noticed it has movieclips above it covering it because one of them is being used as a blend mode. So I realized the empty movie clip method wasnt working because there are movie clips above it. So I did mouseEnabled=false. And it works, so YAY!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines