Results 1 to 7 of 7

Thread: is it possible to work with layers in actionscript?

  1. #1

    Afrostyle is it possible to work with layers in actionscript?

    Well, i was just browsing through the help file, and many functions seemed like they were replacement of layers, like say masking and such. But i was wondering is there any way to work with layers in actionscript, just actionscript?I mean, is it possible to create a instance of a mc, on a particular layer via actionscript?
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  2. Quote Originally Posted by bluemagica View Post
    Well, i was just browsing through the help file, and many functions seemed like they were replacement of layers, like say masking and such. But i was wondering is there any way to work with layers in actionscript, just actionscript?I mean, is it possible to create a instance of a mc, on a particular layer via actionscript?
    I'll help you in a moment, sorry for not responding to your pm..

  3. #3
    If you can, come on msn please, i have a few other quick qeries too!!!
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  4. #4
    You can manipulate the depth of movieclips with actionscript, but I don't think that is what you are looking for...I'm not sure about layers...

    if you wanted, just put an empty movie clip on each layer, name them layer1, layer 2, etc... that would work...
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  5. #5
    Layers are just an aid for old-school animators and only exist within the Flash authoring environment, the same as scenes. Once you publish your SWF all layer and scene information vanishes so you can't target it with actionscript.

    As therobot says, you can manipulate depths which are layers by another name.
    2006-11 GlosRFC - Searching 8,168,684,336 brain cells

  6. #6
    TheCanadian's Avatar
    10,297
    posts
    Noo doot aboot it, eh?
    AS2 also has levels (_level) which are kind of like layers, although they have nothing to do with the layers in the IDE. Frankly I've never had a use for them and I think they're mostly used for loading movies and variables. But again, there are other (and in my opinion, better) ways to do that.
    Proud Montanadian
    We tolerate living and breathing. And niches.

    Name Brand Watches

    Maybe getTimer() or TweenMax is the answer to your problem . . .

  7. #7
    The depth is really the same as layers. Layers only serve to organize and control the draw order to the screen. If you wanted to add something out of order in AS3, you could use addChildAt(index) where you would provide it the index of where you wanted the movie clip to go in the current container's list. All items from the index on are pushed back. You can also use the swapChildrenAt () method which has the syntax:

    Code:
    public function swapChildrenAt(index1:int, index2:int):void
    to reorder things on the fly so you don't have to removeChild and then add at the appropriate depth.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012