A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: [RESOLVED] loadmovie?

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    57

    [RESOLVED] loadmovie?

    Very newb question here.

    I have movie 1 & movie 2. Movie 1 is the main movie. I want to have movie 2 play on the first frame of movie 1. Both are independently saved swfs. Would I use loadMovie here or something else? I cannot get the load movie to work right if so. Thanks for your help.

  2. #2
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Yes, loadMovie would be the way to go. How exactly are using it?

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    57
    Honestly I do not know the appropriate way to use it.

  4. #4
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Well first thing is when do you want it to load? Like after you hit a button or it just pops in whenever.

  5. #5
    Member
    Join Date
    Aug 2006
    Posts
    57
    Basically all I want it to do is load when the parent movie loads.

    Movie 1 loads and movie 2 loads and plays when movie one is complete.

  6. #6
    Member
    Join Date
    Aug 2006
    Posts
    57
    anyone know how to load a movie in another movie?

  7. #7
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Okay, on your first frame. You'd want to put this little piece of code there. You'll also need to create an empty movieclip an place it were ever you want it.

    empty_mc.loadMovie("movie2.swf");

  8. #8
    Member
    Join Date
    Aug 2006
    Posts
    57
    Thanks for the help.

    So the point of the empty_mc.loadMovie("movie2.swf"); is to load movie2.swf into the empty movie I create in frame 1?

    I'm trying to understand this as I go along. Does it matter what name I name the empty movie?

  9. #9
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Yep thats right. You want the empty clip as many frames as you want.

    Nope you can name it whatever you want. That was just an explain name you could use.

  10. #10
    Member
    Join Date
    Aug 2006
    Posts
    57
    So regardless of what you name the empty movie, the empty.mc.loadMovie command will load the movie in question into that empty movie? That's pretty cool.

    Is this an example of AS2? I'm still used to the AS1, tellTarget stuff hahaha. I guess I need to get a resource to learn AS2 before I start commiting this AS1 to memory.

    Any recommendations as to books which explains simply from the beginning how to use AS2 in flash?

  11. #11
    Member
    Join Date
    Aug 2006
    Posts
    57
    ok, I must be doing something wrong.

    I am starting on movie1 which is my parent movie...frame 1.

    On frame 1 I have the following:

    stop();
    empty.movie1.loadMovie("nih_intro.swf");

    nih_intro.swf is the one I want to play.

    Was I supposed to rename empty_mc.loadMovie to the name of my empty movie? If so I renamed it to empty.movie1.loadMovie.

    Regardless it did nothing when I previewed. I made sure the swf I want to call was in the root too.

  12. #12
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Okay, so you have a movie clip called "movie1" correct? What you want to do is make an empty clip and put it on the main timeline. Then you can call it whatever you want. Then just replace empty_mc in my code with the new name of your blank/empty movie clip.

  13. #13
    Member
    Join Date
    Aug 2006
    Posts
    57
    ok, I made a blank movie, dropped it in the first frame, changed the name and it does not pull from it. Does the swf have to be in the library or can it be pulled from an external source? like in the root of movie1?

  14. #14
    Member
    Join Date
    Aug 2006
    Posts
    57
    Posting my FLA and SWF I want to pull here. I started a fresh movie and tried this code and it did not work. Maybe seeing it will help.
    Attached Files Attached Files

  15. #15
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Yes the swf file should where the loaded swf is. I wasn't able to see the file. What version are you using? I'm using MX 2004. If your using 8 could you save it as an mx 2004 files. Thanks

  16. #16
    Member
    Join Date
    Aug 2006
    Posts
    57
    Yeah, I was using 8. Saved as MX & reposted the files.
    Attached Files Attached Files

  17. #17
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Alright, there was one little thing you were missing. Just click on your empty movieclip. And in the property Inspector at the bottom of the program, you'll a text box with the words "Instance Name" type in there empty. And that should do it for ya.

  18. #18
    Member
    Join Date
    Aug 2006
    Posts
    57
    That is crazy. I named the empty movie in the actual movie I was trying to get it to work in.

    I had the movie named empty.movie1 and when I put that in the code the . between empty & movie1 threw it off. Changed the name to empty and it worked first time.

    hahah...gotta love code and punctuation.

    Thanks mate for all your help.

  19. #19
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Not a problem

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