A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: loading a scene from a rollout

  1. #1
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83

    loading a scene from a rollout

    Hello,

    I have a question regarding rollout buttons. I had gotten some code help a couple of weeks ago to make a menu rollout work. It is a Movie Clip and when the items inside that menu were clicked an image would load from an external movie. I am now trying to use that in a different setting, the difference being that now, I'd like to have the menu items go to and play a scene in the same movie. I have tried doing this and it simply will not work. The menu rolls out but the buttons do not load the scene. Is this because you cannot control the main movie timeline in a MC? And if so, is there a way around this or should I be setting up my rollout button differently from the beginning?

    thanks...

  2. #2
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    I'm not sure I fully understand what you're after but hope this helps anyway. Try posting your .fla up if this doesn't help.

    If you want to control the main timeline from within a movieclip you will need to use something along the lines of:
    Code:
    on (press) {
    _root.gotoAndPlay(frame number on root or frame label);
    }
    If you want to play a different scene on the root timeline, you need to put a frame label in the first frame of that scene, and use the code above but using the frame label, e.g.:
    Code:
    on (press) {
    _root.gotoAndPlay("frame label");
    }

  3. #3
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83

    fla

    I tried adding your code to the second of the rollout buttons but I couldn't make it work I think I may have missed something along the way...I am going to attach my fla, if you could help me out, that would be fantastic.

  4. #4
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    ok, if you attach your .fla, I will have a look and see if I can help.

  5. #5
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    Here goes...

  6. #6
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83

    ?? attachment

    I attached the file using the attach button provided below....but it doesn't appear to be there. Did I do it wrong?

  7. #7
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    That should be right, try posting it up again, can't think why it wouldn't work??

  8. #8
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    I'm going to try again on Safari, I have had trouble with certain things on IE (I'm on a Mac)

  9. #9
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    Well, that didn't seem to work either!

  10. #10
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    you can try emailing it to me if you like, at [EDIT]File received, email address removed[/EDIT]

    I'll remove my mail address from here once I receive it.

    I hope after all this I can actually help, lol !
    Last edited by Cass101; 02-19-2005 at 02:04 PM.

  11. #11
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    Alright, how about this..

    http://www.angelapetardi.com/newsite/indexangpet.html


    When you rollover the gallery button the first button under it is coded:

    on (release) {
    loadMovieNum("angelapetardi_city2002.swf", 0);
    }

    This works but I would like to have it so that tbe gallery does not have to load everytime someone goes back and forth...

    The second button under gallery, I have coded:

    on (press) {
    _root.gotoAndPlay("city2002,start2002");
    }

    I tried it out without the scene (city2002) originally but that didn't do it either.

    I hope this makes sense.

    Thanks.

  12. #12
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    sorry, but I'm a little confused, at the moment, the code for the second button reads:
    Code:
    on (press) {
    _root.gotoAndPlay("start2002");
    }
    and that takes you to the scene city2002 and the first frame in that scene, named start2002.

    Is this correct? If so, it worked fine for me, and took me to the page shown in the attached image below.

    If it's not correct, where is it supposed to go?
    Attached Images Attached Images

  13. #13
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    I'm sorry, I'm not explaining myself well. I have only created the city2002 scene at the moment. So I have been using that as the test scene for both those buttons...the one that reads cityscapes 2003, is the one that has the code that you sent me on it. The one titled cityscapes2002 is the one that I had coded originally to load the scene externally.

    I got your email address after I had posted my last reply and then I attached and sent you the zipped fla to that address.

  14. #14
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    it's ok, I think i'm probably just getting confused!

    The code that I posted up in my last reply seems to work fine for going to another scene. Basically flash doesn't like targeting different scenes from inside an mc, so you have to target frame labels instead.

    Is the code working for you, and how you wanted it to? Only, from what I understood of your original question, it seems to work fine.

    sorry for the confusion!

  15. #15
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    Hello again,

    I erased the code on the buttons and started again and I think that it is all working...one of the things that I didn't get was that I thought you would have to indicate somewhere what scene to go to to find the label in the code. Does _root cover the maintime line of all the scenes in your movie?

    I have re-posted the functioning swf at the same link.

  16. #16
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83

    Thanks so much

    I think that everything is working ok. Thanks very much for your patience and your help. I really appreciate it. I have found Flashkit such an incredilble resource. It along with people like you have helped me so much along the way. I'm just starting my foray into learning more code, it's a little scary at times!!

    Thanks again.

  17. #17
    Senior Member Cass101's Avatar
    Join Date
    Dec 2004
    Posts
    131
    Originally posted by Golnessa
    Does _root cover the maintime line of all the scenes in your movie?
    All the scenes are contained on root, but for some reason the _root.gotoAndPlay("Scene", frame); code doesn't work from inside another movieclip. This is why the frame labels are used. That way flash will go straight to the scene in which the label is contained.

    It can be confusing at times, which is why I tend not to use scenes where possible.

    Only too glad to help, sorry for all the confusion!

  18. #18
    Member
    Join Date
    Feb 2001
    Location
    Toronto Ontario
    Posts
    83
    If you do not use scenes...how do you have it? As one big scene with labels marking the beginnings of each section?

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