dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: loadMovie

  1. #1
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    loadMovie

    hi,

    I am trying to load a movie into another movie, but i need it to be in a certain place on the scene... I have seen this done, but i have no idea how to do it. can someone help me?

    thanks,

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    7
    create an empty movie in your main movie and give it a name (loadingplace). now you can load the other movie in the empty movie as example with a button and the function:

    loadMovie("yourmovie.swf", "_root.loadingplace");

    you can place the loadingplace movie where ever you want.

    i hope this helps

  3. #3
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88
    thanks,

    i think i get this, but just to be sure, do you mean make an empty movie clip, call it "loadingspace" and then load everything into that empty clip with the script you gave?

  4. #4
    Junior Member
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    7
    yes

  5. #5
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    still won't work...

    thanks for your help, but i am sorry to say that i can't get this thing to work. i made the empty movie clip, put it where i need it to be and used the script to load the other movie into it, but nothing happens. we have checked and double checked everything we can think of but it still won't work. is there something else we could be doing wrong?

    thanks...

  6. #6
    Senior Member Sir Yendor's Avatar
    Join Date
    Sep 2001
    Location
    Over here
    Posts
    1,140
    Make sure that both movies are saved to the same directory.

  7. #7
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    still don't get it...

    ok, thanks so much for the help... i've never attempted to do this before and i am still not getting it. everything is in the same directory, but there are a couple of things i think i am doing wrong:

    1) when you say "blank movie", do you mean a movie clip with nothing in it? whenever i make a movie clip with nothing in it, its size is 0 X 0 so even if the other .swf loads in it, i can't see it, or are you taking about something else?

    2) does the second movie have to load from a button or can it be a frame action?

    3) is the script loadMovie("principal2.swf", "_root.loadingspace"); to be placed in the movie clip or in the main scene?

    sorry for all the questions, i really hope someone can help me get this figured out... thanks

  8. #8
    Senior Member Sir Yendor's Avatar
    Join Date
    Sep 2001
    Location
    Over here
    Posts
    1,140
    It took me a while to get this, but once you got it, you'll always be able to do it. I've only tried it by making a button begin the movie so I'll explain how I do that.

    1. Create an empty Movie Clip.

    2. Drag it to your main movie on its own layer. Try and drag it to as close to where you want it as possible. Make sure this layer is ABOVE anything that may hide it. Once it is dragged to your main movie, you should see a little white circle in the position where you dragged the movie to.

    3. Click on the little white circle to select the blank movie and give it an instance name of contents (or anything else you will remember)

    4. Add a button to your main movie and place this code on it:

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


    MyMovie.swf should be the name of the SWF you want to load. One problem you MIGHT be having is if you dont use the EXACT name of the SWF you want to load. It IS case sensitive. I've made that mistake a couple times and was only able to correct it by fixing the case of the appropriate letter(s). For example if the file name of the SWF I am trying to load was MyMovie.SWF it would not work if my code was
    Mymovie.SWF

    5. Make sure BOTH movies are saved to the same directory.

    6. Make sure BOTH movies are published. Actually I don't know if this is necessary.

    7. Once you are getting the movie to load, you can position it correctly by going back to the little white circle we've been talking about. Click it to select it. You can then change your "x" and "y" coordinates to position it properly.

    See if that works for you. I'll be on line for another hour or so, let me know how it goes.

  9. #9
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    still won't work

    i still can't get this thing to work for some reason... we have tried everything we can think of and it just does nothing when you click that button... is there something i could be missing??? this seems like the best way to set up the site i am making, but i can't get anything to load...

    thanks

  10. #10
    Senior Member Sir Yendor's Avatar
    Join Date
    Sep 2001
    Location
    Over here
    Posts
    1,140
    I'm up against 3 deadlines so can't give you a lot of time right now.


    I'll be back on later this evening and can maybe help then. What I suggest you do is respond here with a STEP BY STEP list of what you are doing. It should look something like the 7 steps I outlined below. Maybe if I look at that I can help figure out what you are doing wrong. Remember, everything is case sensitive, so check that.

    Lastly, I only know how to do this from a button, so I might not be able to help you solve exactly what you are looking to do.

  11. #11
    Junior Member
    Join Date
    Oct 2002
    Location
    Croatia
    Posts
    25
    here is the fla. just change the name of the swf.
    Attached Files Attached Files
    Should I ever become an evil overlord, my force-field generators would be inside the shield they generate.

  12. #12
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    step by step...

    thanks so much for the help... i can't figure thins thing out at all.

    ok step by step:

    1) set up the main movie with a menu etc (main.swf)

    2) set up the second movie the same size as the portion of the main movie that i want it to fit into (diseno.swf)

    3) created an empty movie clip in the main movie (loadspace)

    4) placed the movie clip on the scene in a folder above the rest of the movie.

    5) i named the instance of the empty clip contents

    6) programmed the appropriate button (the "diseno" button) with the following script:

    on (release) {
    _root.contents.loadspace("diseno.swf");
    }

    7) both movies published to the same directory -- actually they are the only things in that directory

    8) checked and checked and checked and checked spelling etc.

    9) tested 1000000000000 times and it just won't work...

    if you get a chance to check out what i am working on you can see it here: http://www.canadianmotorcycleadventu...imsa/main.html
    (i put it on another client's server, but shhhhh! )

    any help would be very much appreciated, thanks...

    phill justice

  13. #13
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    What's with this loadspace?

    (release) {
    _root.contents.loadspace("diseno.swf");
    }

    What's the instance name of your empty container clip?
    Or do you have 2 container clips?

  14. #14
    Senior Member
    Join Date
    Mar 2002
    Posts
    194

    Here you go

    You don't need the symbol name in the code it's not:

    on (release) {
    _root.contents.loadspace("diseno.swf");
    }

    It's:

    on (release) {
    loadMovie("diseno.swf", "contents");
    }


    Hope this helps!
    Damon Hancock
    Vice President, Interactive Development
    Creativepointe

  15. #15
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Solution stealer!

  16. #16
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    still won't work

    thanks to everyone for the help, but i can't get this thing to work yet... is there anyone that would let me send thme to .fla? there must be a huge error somewhere that i am overlooking.

    thanks...

  17. #17
    Senior Member
    Join Date
    Mar 2002
    Posts
    194
    send it my way if you'd like.

    damon@creativepointe.com
    Damon Hancock
    Vice President, Interactive Development
    Creativepointe

  18. #18
    Senior Member
    Join Date
    Jul 2000
    Posts
    180

    if still not working...

    Make sure that the MC "loadspace" has an INSTANCE name of loadspace and not just the name of the MC. That's what used to stump me alot.

  19. #19
    ...
    Join Date
    Jun 2002
    Location
    MEXICO
    Posts
    88

    THANKS EVERYONE!!!

    thanks so much everyone for all the help with this problem, finally things are working PERFECTLY! things finally clicked when we got out of the site we are working on and just made a "bare bones" movie that we could see what was really going on. this is a great step for us and really opens up the potential of full flash sites. from mexico, a very special thanks and... when are you coming to visit???

    regards..

  20. #20
    ultramember itworks's Avatar
    Join Date
    Nov 2002
    Location
    with angelina jolie
    Posts
    1,140

    with a button it's easy... what about onClipEvent?

    loading a movie when the user clicks a button it's one thing but can anyone show how to load a movie into a container in tha main movie when it begins?!

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