A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: unload and loadMovie

  1. #1
    Senior Member
    Join Date
    Jan 2005
    Posts
    152

    unload and loadMovie

    This is probably pretty simple. I normally load in an external .swf file by creating an empty mc and loading the swf in with

    on(release) {
    loadMovie("sample.swf", "content ");
    }

    But this just loads the swf on top of the main stage. I want a completely new movie to load in as I am not using any of the same elements off the 'intro' screen.

    So I am guessing I have to unload a movie and then load in the movie. How is this done for each button on the main stage? Thanks in advance!!

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    what you can do is load into a _level..

    _level0 is the _root timeline...

    note: when loading something into _level0 you REPLACE the root timeline so you remove everything..

  3. #3
    Senior Member
    Join Date
    Jan 2005
    Posts
    152
    And how do I write that in the code? And then does this become the new _root?

  4. #4

  5. #5
    Senior Member
    Join Date
    Jan 2005
    Posts
    152
    But how do I write that in the code? I know this isn't correct,
    on(release) {
    loadMovie("sample.swf", _level0.content );
    }

  6. #6
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    hi..sorry..

    if you want to load into a level you need to use loadMovieNum instead of just loadMoive.

    like this:
    code:

    loadMovieNum('whatever.swf', 0); // 0 being the _level you want to load into



    however...I keep seeing you put "content" as in _level0.content

    what is "content" if yoru trying to load into a target use use the example in the post above.

  7. #7
    Senior Member
    Join Date
    Jan 2005
    Posts
    152
    content is the blank mc...I no longer need this mc correct? Thanks for your help.

  8. #8
    Senior Member
    Join Date
    Jan 2005
    Posts
    152
    Wow, that was really EASY. Tx.

  9. #9
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I recommend you get in practice of using movieClips to load into..eithe ones made at authoring time..or created on the fly dynamically...

    then you dont have to worry about _levels at all..

  10. #10
    Junior Member
    Join Date
    Dec 2006
    Posts
    12
    thx whispers, worked for me too
    scratching my head on that one

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