A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: The mysterious "loadmovie" command

  1. #1
    the alpha and the omega
    Join Date
    Mar 2006
    Location
    Behind You, USA
    Posts
    10

    The mysterious "loadmovie" command

    I've been attempting to design an entire site using just flash. And, to ease loading, I was planning on setting up subsequent pages using the "loadmovie" command. However, for some reason it's not working, and I think it's because I don't totally "get" how the command works.

    I have navigation buttons on my main .swf. Then, when each respective button is pushed, I want it to load another .swf on to the main flash movie. However, as of right now, when the buttons are pushed, nothing happens. I'm a real beginner to actionscripting, so please don't laugh at the simplicity of the code I am using to try do this. For each button, I have something like this:

    /////////////////////
    on (release) {
    _root.contents.loadMovie("about.swf");
    }
    ////////////////////In that little snippet, "about.swf" is the movie I want to stick on top of the main page. So, In my understanding of loadmovie, "about.swf" should come on top of the main flash movie and perserve the background below it, right? If so, what am I doing wrong?

    Any help would be appreciated. Thanks for helping out yet another n00b!

  2. #2
    5+5=55 Schfifty Five's Avatar
    Join Date
    Jun 2006
    Posts
    698
    this.createEmptyMovieClip("loader", 888);
    loadMovie("about.swf", loader);

    Try that.

  3. #3
    the alpha and the omega
    Join Date
    Mar 2006
    Location
    Behind You, USA
    Posts
    10
    You're a genius! Thanks so much. THANK YOU!

    But, uh, why does it work? What's the deal with that crazy 888? Some type of secret code only flashers know about?

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    888 is the level it loaded to. It could be from 1 to 16000.

    The drawback is anything loaded to a level will always be on top of anything else in the layers of a movie.

    Your code would work, but you need an empty movie clip on stage, on a layer, and give it an instance name of contents, then the button code.

    on (release) {
    _root.contents.loadMovie("about.swf");
    }

    To get things above or below something else on a layer, just drag the layer up or down in the stack.
    Last edited by Ask The Geezer; 06-21-2006 at 10:55 PM.

  5. #5
    Senior Member
    Join Date
    Aug 2002
    Location
    Colorado
    Posts
    161
    A.T. Geezer,
    I think this coding was a very valuable piece of the puzzle for my own web site, when I want to call various streaming videos to play. Am I right?

    If I were to have dozens of streaming videos in my categories lists and a viewer spotted one category that they wanted to review, then I would need buttons that took the viewer from the general index to that category and then to another list. And then finally to this code to trigger the movie to play.

    Am I thinking right on this?
    Dave S.
    Creating, the ultimate passion
    www.dittomark.com

  6. #6
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Yes, if each category is in a separate swf movie. loadMovie is for loading external swf's, so everything doesn't have to be built into one movie, which would take forever to load. Each external movie can have it's own preloader built into it also.

  7. #7
    the alpha and the omega
    Join Date
    Mar 2006
    Location
    Behind You, USA
    Posts
    10
    Very helpful. Thanks.

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