A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: gotoAndPlay to child MC?

  1. #1
    participant
    Join Date
    May 2006
    Posts
    172

    gotoAndPlay to child MC?

    I'm reorganizing my game but having trouble, (prob'ly with an obvious mistake):

    Before, this worked:

    h.gotoAndPlay("enemy7");

    but since then I put all the various enemies in a MC in h called "enemy" and tried this

    h.enemy.gotoAndPlay("enemy7");

    but it's doesn't work... What am I missing? THANKS!

  2. #2
    God yeps's Avatar
    Join Date
    Dec 2005
    Location
    :noitacoL
    Posts
    660
    sorry... i got confused... you made an mc and put it inside h?

    if you want h to go to the frame enemy7 then your code should be just as you had it before...
    Code:
    h.gotoAndPlay("enemy7");

    could you explaine it a bit more?

  3. #3
    Senior Member
    Join Date
    Feb 2004
    Posts
    312
    that should work just fine check if the frame's label are where they are suppost to be. check if the new mc enemy has an instance name as well

  4. #4
    participant
    Join Date
    May 2006
    Posts
    172
    Sorry I wasn't more clear.

    Before I had it organized like this inside "h" ( the hole the enemy lives in)

    enemy1 hidden, enemy1 attacking, enemy1 shot, enemy2 hidden, enemy2 attacking, enemy2 shot, etc...

    but it is obviously a waste / poorly organized, so I put all the enemies in an MC called "enemy" within "h," so now it's like this:

    enemy hidden, enemy attacking, enemy shot

    much better, but i can't get to the different frames inside "enemy"!

  5. #5
    participant
    Join Date
    May 2006
    Posts
    172
    *beating myself up Chris-Farley-style*

    Thanks, AluminX - I confused linkage with instance name!
    looks to be working now!

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