A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [f8] depth control on movieclips

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Nottingham, England
    Posts
    263

    [f8] depth control on movieclips

    Hi,

    wondering if someone is able to confirm something for me...

    I've been playing with someone else's fla.file and been trying to teach myself about the throw mc option. Basically i've got 10 squares which load on to the main screen and you can throw them around - but they dont jump to the front...


    I've been trying to make this happen by adding this to the movieclip, but it's not working

    code:
    on (rollOver){
    mx.behaviors.DepthControl.bringToFront(this);



    I've had a look at the main "as" which came with the file and seen this

    code:
    for (var i = 0; i < kNbrBalls; ++i) {
    var mc = this.attachMovie("superball_mc", "mc"+i, 1+i);



    not sure what this is exactly but would i be right in thinking the reason why the movieclips aint jumping to the front when you click on them is because their not on the same level?


    any help very much appreciated, thanks

  2. #2
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Location
    Phoenix, AZ
    Posts
    427
    the swapDepths() mc method may help you out. It will take a clip and assign it to a new depth, and if there's something else already there, it will take that something else and put it where your clip used to be, i.e. it will swap the two items. If there isn't anything already there, it'll just move it your clip to the specified depth and be done. If you need to maintain the stack order of the items, try iterating through an array to swap everything down one depth.

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Nottingham, England
    Posts
    263
    thanks for that - no idea really what you said but gives me something to look into - swapdepths & arrays....



    i maybe some time

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Senior Member
    Join Date
    Jan 2007
    Location
    Nottingham, England
    Posts
    263
    thanks silentweed,

    not quite sure where to be attaching that though - i've done it to the mc and doesnt seem to do anything. I've had a practice at the overlay of mcs before and had some thing that seems to work - I've been trying to figure out if there's some way i can attach the 2 together...

    but that would involve me know what i'm doing.

    i've attached the 2 fla and i just want to point out the action scripting for the superballs one aint mine - i've been pulling someone else's work apart trying to figure out why it works...
    Last edited by inquizard; 09-09-2007 at 10:13 AM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center