A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: playing another mc from another mc

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    22
    Hi all,

    Got the following problem:

    I have one MC loading at frame 1. Within that Mc is a button to an MC at frame 5.

    when I hit that button it just reloads the same MC and does not jump to that Mc at frame 5.

    Mc's are all named in instances and also named at the frame label so I can target them.

    Any clue what is going on here? Thank you.

    Sincerely,
    Nitai

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Posts
    181
    when you load the mc on the main stage, do it in a empty mc
    (name = a)
    in a (I suppose) you're loading another mc, load it also in empty mc (name = b)
    now
    on the main scene
    put the following action
    on release(){
    _root.a.b.Gotoandplay("thelabel");
    }

  3. #3
    Junior Member
    Join Date
    May 2001
    Posts
    22
    It is not working, but that is propably me.

    On the main.swf I have a MC with an instance name of "menu" on frame 1. Just one layer under that I have an MC called products at frame 5. Within the MC "menu" I have a button which should go to the MC "products".

    The MC "menu" has a frame label of "main" and the products MC is called "products".

    Is this correct?

    _root.products.gotoandplay("products")

    Sincerely,
    Nitai

  4. #4
    Senior Member
    Join Date
    Dec 2000
    Posts
    181
    yeah
    i think that kinda stuff should work
    (now i get the problem!)

  5. #5
    Junior Member
    Join Date
    May 2001
    Posts
    22
    Damn.....it doesnt work.

    Slap me if I am wrong.

    I have the MC (instance label "products") in one layer (frame label: P)

    On one layer I have another MC with a button and the script:

    on release
    _root.products.gotoandplay("p")

    Shouldnt this work? Up to now nothing works:-((

    Sincerely,
    Nitai

  6. #6
    Senior Member
    Join Date
    Dec 2000
    Posts
    181
    didn't make any spelling / synstax mistakes?
    or maybe i'm wrong

  7. #7
    Junior Member
    Join Date
    May 2001
    Posts
    22
    Double checked it all.

    I just renamed it to pro and p to make sure. Nothing is working.

    Do you mind if I send you the file to have a look at it. I am totally messed up if I dont get this to work:-(

    Sincerely,
    Nitai

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi...hope you don't mind if I butt in, but it sounds like your problem could be this....

    I assume on the layer with "menu" there are no frames after frame 1 and all blank frames on the other layer until you reach "products" on frame 5...??

    If so, the problem is this, you can't tell a mc to do anything until the playhead reaches the frame it is on...

    So, first you need to send the playhead to frame 5 where "products" is, then you can tell it to do something...

    Probably the easiest way to do this is to put on your button:

    on (release) {
    _root.gotoAndStop("p");
    }

    If "p" is the label on frame 5... and then put a frame action on frame 5 like this:

    _root.products.gotoAndPlay("label");

    This is providing "products" is the instance name of your mc on frame 5 and "label" would be a label on its timeline that you want it to go to...

    Something like that...I hope you get the point...

    Hope this helps...

    -pigghost-

  9. #9
    Junior Member
    Join Date
    May 2001
    Posts
    22

    THATS IT

    Wow, thats it. It works.

    I honestly dont understand the concept of it yet, but I made it work. Thanks a bunch. I will continue from here on.

    Learning by doing and asking.-)

    Sincerely,
    Nitai

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