A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: loadMovieNum and goto frame or label madness!!!

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    22

    loadMovieNum and goto frame or label madness!!!

    After searching the forums to find my solution I am confused and will ask for help

    I have a flash file that has a button. This button has script:

    code:
    on (release) {
    _root.nav.gotoAndPlay(32);
    loadMovieNum("flashx.swf", 1);
    }



    So as you can see the button is in a MC that is instanced "nav" that is on the main timeline and when pressed will jump to frame 32 in the "nav" timeline. Then it will call up "flashx.swf" and put it on level 1.

    Now in "flashx.swf" I have multiple buttons. The buttons have script as well:

    code:
    on(release) {
    loadMovieNum("gallery.swf", 1);
    }



    Each button calls up "gallery.swf" and replaces "flashx.swf".

    So far everything works. The part that isn't is this:

    Each button in "flashx.swf" will have to goto a certain frame in "gallery.swf". I have been unsuccesful at achieving this I even tried giving the frames in "gallery.swf" that I want to goto a frame label.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    http://www.flashkit.com/board/showt...threadid=571499

    This is one of the topics I looked at and I can't figure it out. Where would each script go in? This is the confusing part.

    Thanks

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Attach both flashx and gallery .flas zipped up and in a MX only format, not MX2004.

    You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.

  5. #5
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    Thank you for offering to look at them. I had to remove the graphics for security reasons. I'm sure you would unserstand. It should give you an idea
    Attached Files Attached Files

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    May I ask why you would be loading your gallery.swf on level 0, thus clearing out your main movie? Is it just because of the link I posted that suggested loading on level 0?

    Another question, what about returning to the flashx.swf to possibly make another selection, did you have some idea how you would do it from the gallery.swf?

  7. #7
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    Good Morning!

    Flashx is being loaded from another Flash file which works fine when loading it into level1 (disregard the level0). When one of the buttons in Flashx is pressed it loads Gallery into level 1 and this works fine as well.

    After relaxing from work last evening I was able to focus more and found something that worked on the forums (some of your handy work).

    I put this script on one of the buttons in Flashx:

    code:
    on(release) {
    _global.whereToGo = 1;
    loadMovieNum("3D Gallery.swf", 1);
    }



    I then put this script on the first frame of Gallery:

    code:
    stop();
    this.onEnterFrame = function(){
    if(_global.whereToGo != undefined){
    gotoAndPlay(_global.whereToGo);
    delete this.onEnterFrame;
    }
    };



    When I played it from the main flash file (the one that flashx and gallery are called into) it works great!

    What do you think? Any ways to improve it?

    As for the question of how to get back from gallery to flashx I made a back button in the main flash file and had it call back flashx when I wanted to get out of gallery and back to flashx. Hope this makes. Sense.

    Thank You so much
    Last edited by Ingsoc75; 01-18-2005 at 11:07 AM.

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I worked on a slightly different version, loading gallery on level 2 (with a back button to go back to level1 - flashx), and included a preloader if the gallery contains heavy pictures and/or other stuff... But basically what you have posted above should work, at least when gallery is fully loaded. Might not work on the first click, if it's not fully loaded, but that's another story.

  9. #9
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    I've been meaning to ask you about that. In some of your posts you comment how it is important to make sure that the .swf file is fully loaded. I am assuming you mean that when you can see it then it's fully loaded? I'm not making this for the web but for a CD. Does it make a difference?

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This would really only be a problem online... On a CD, you can't use a preloader anyways. Note that if your using a projector file, it will freeze until everything is loaded into ram...

  11. #11
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    Thanks for your help. May I see the file that you worked on?

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I'd have to complete it, and clean it up... And you probably don't need the preloader bit... So can't really do that until tonight at least. You'd also have to PM an e-mail or enable your PMs (private messages), so that I can send you a link...
    I'm no longer publicly posting links to my personal web spaces or attaching extensive actionscripts on these forums. Sort of like your pictures... I'm sure you'll understand!

  13. #13
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    Sure I unserstand You may email it to me on here when you are ready and again thank you so much for the effort.

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