Skip to main content
Participating Frequently
June 3, 2008
Question

layer adding

  • June 3, 2008
  • 6 replies
  • 523 views
Hi
i am creating an application in which user can add a new layer ,move it ,make up/down, and change its position also.I have to implement all layer functions.How can i add new layer when user click on layer add button/tab .Can some one help me
Thanks in Advance
shobha
This topic has been closed for replies.

6 replies

shobha1Author
Participating Frequently
June 25, 2008
"Could you please tell me how can i give the name of adding layer."
no not this.

I want a layer table just like flash layer window .
whenever user add a layer, a layer increase in "layer table " with default name Layer1,Layer2 ... User can change layer name bye clicking on it .
Could you please give me any idea how can it possible

Thanks in advance
shobha
Inspiring
June 13, 2008
"Could you please tell me how can i give the name of adding layer."

do you mean...

var testLayer = addChild(mc_1,N);
//remember doing this testLayer will be local to either the function or object where it is defined.
testLayer.name = "thisIsMyTestLayer";

trace(thisIsMyTestLayer); // this will come back undefined.
trace(testLayer.name); // this will come back "thisIsMyTestLayer"

does that answer your question?
shobha1Author
Participating Frequently
June 9, 2008
Hi

Thanks its really helpful
You mean to say that, at the time of adding an object i must defined like this
addChildAt(mc_1,N)
N is changing depth of the object and all layer architecture will be depend on N's value which will changeable

I will try it

Could you please tell me how can i give the name of adding layer.

Thanks in advance
shobha
Inspiring
June 4, 2008
objects are placed (in AS3) on layers - a property called "index"

var mc_1:Sprite = new Sprite();
var mc_2:Sprite = new Sprite();
addChild(mc_1);
addChild(mc_2);

mc_2 will be 1 level (index level) above mc_1, thus it will be on top. So you should handle it like that...

now whatever you put in mc_1 (programatically) will be on the bottom layer, and whatever you put in mc_2 will be on top. Then just scale it up to handle N layers instead of just 2.

in AS2, you would use "swapDepths()" to move one MC to another, but now its an index property change. I can't remember the exact method, but its in the help files (look for index or "addChildAt")

So Object depth is related to it all- and you can use buttons from the component library, you'll just have to do the architecture yourself.
shobha1Author
Participating Frequently
June 4, 2008
hi
you mean to say i have to code, there are nothing in AS3 library.The Object Depth concept is not related to it ? could you please give any idea to build layer functionality.

thanks in advance
shobha
Inspiring
June 3, 2008
This is all doable, but it won't be connected to the Flash Drawing API layer tool (on the timeline). You'll need to code the layers to have all this behavior, and build the buttons yourself. That means you'll be building it all from scratch using AS3 - is this what you're planning on doing?