A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Quick LoadMovie question

  1. #1
    Member
    Join Date
    Jul 2000
    Location
    Ca.
    Posts
    70

    Quick LoadMovie question

    Hi y'all. I will make this quick since I know the answer is starring me right in the face, but I can't get it.

    1) I have a shell (main movie clip container). Within the shell is a holder called mtClip (how original eh?) that holds all the loaded movies. Ok.

    2) First, I load in my main.swf which has all my link buttons to the other movie clips. You click on them, it loads just fine...works great.

    3) Now here is the problem. Within each of the loaded clips I need a back button that goes back to the main.swf...no biggie, so I write this on the back button:

    on(release){
    _root.mtClip.loadMovie("main.swf");
    _root.img._visible = false;
    stopAllSounds();
    }

    Works great!!! BUT HOLD ON...I need it to go to a certain SCENE and FRAME in main.swf so it bypasses all the intro B.S. The scene I need it to go to is called "main" and the frame number is "1"...so I thought this would work:

    on(release){
    _root.mtClip.loadMovie("main.swf,main,1");
    _root.img._visible = false;
    stopAllSounds();
    }

    But...it does not. Please help me get it right. Thanks guys!

    peace out,
    daddy

  2. #2
    Senior Member da_hammer's Avatar
    Join Date
    Jul 2003
    Location
    Ritchie Street.
    Posts
    294
    _root.mtClip.loadMovie("main.swf,main,1"); /// this will not work.
    coz the .swf is the URL, next target will follow and end with method.
    -----------------------
    Why don't you just put a button in the loaded main.swf itself, then code:

    on(press){
    gotoAndPlay(frameNumber);
    }
    -----------------------------------
    you can control a loaded clip in a main movie when you use levels.
    say my main movie is hammer.swf ... in which i load loader.swf in a _level(10)

    now i can control the loaded movie from a simple button from my hammer.swf
    _level(10).gotoAndPlay(frameNumber);

  3. #3
    Member
    Join Date
    Jul 2000
    Location
    Ca.
    Posts
    70
    I really don't understand what you are saying. I am not that experienced with levels and all my buttons are coded already and working fine with the exception of the back button which is my only problem. I really don't want to have to recode all my buttons and everything again. Are you sure there is not a way to do it with my example above. I would think you could use the "loadmovie" function and specify the scene and frame???

    Thanks Again

    peace out,
    daddy

  4. #4
    Junior Member
    Join Date
    Feb 2005
    Location
    South Africa
    Posts
    6
    i also want to know whether its possible to jump to a certain scene after loading a movie into another level.. ex. i loaded a movie into the main movie using loadmovienum. then hitting the home button, unloadmovie, loadmovie. but now i want to hit the contact us button, unloadmovie, loadmovie... can i specify a certain scene to go to now?

  5. #5
    Junior Member
    Join Date
    Apr 2007
    Location
    Melbourne Australia
    Posts
    12
    yeah, use a variable, on the contact button, on release set variable whatever. then when you load the other movie, on the first frame, check the variable and make it go to the spacified scene - using the "if" statement.

    aslo use Relative paths instead of _root - eg. _this._parent etc..
    Last edited by mechanism; 04-24-2007 at 08:41 AM.

  6. #6
    Junior Member
    Join Date
    Apr 2007
    Location
    Melbourne Australia
    Posts
    12
    or you could set a variable at the first frame - var introPlayed = false;

    then at the end of the intro make the var introPlayed = true;

    then instead of pointing the _root to play frame 1, make it play frame 2 every time, and use:
    if(introPlayed == true){
    gotoAndplay("whatever_frame_is_after_the_intro");
    }

  7. #7
    Junior Member
    Join Date
    Feb 2005
    Location
    South Africa
    Posts
    6
    thanks! i'll try!

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