dcsimg
A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: Load movie clip??

  1. #1
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    Angry

    I have a site I am working on (basic outline/layout)and I have been creating different movie clips to show different info..etc. I was told you can load a movie clip that is in your library? Or you can load an external .swf!! Which is the recommended way? and WHY? AND MOST IMPORTANTLY...how do you do both of these??? Thanks -whispers-

  2. #2
    FlashKit Joker
    Join Date
    Jan 2001
    Posts
    659
    Hi,

    I ussualy work with loading movieclips. The advantage is that you are working in one timeline instead of several in different movies.

    When you have made a movieclip you can place them on the main timeline and trigger em with telTarget.

  3. #3
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    umm.....THANKS....

    I have made a mach movie clip (no animaiton yet...LOL) to practice/learn how to load them. I have no aciton script expereince...actually barely any FLASH experience at all. Is there a tut on how to load a movie clip from the library?? Or do you have some SIMPLE steps to follow?/ Thanks -whispers- I was told one time (befoe I was even ready to try this) to place a blank movie clip on the stage...no idea why. The eventual effect I want to achieve is when I click on some text the movie will load in the main area...then when I cliock on different text...the next movie will appear and play. I hope I explained it so you can understand..Thanks. -whispers-

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    the blank MC is the "holder" of what you will load.
    Lets say we have "holder" in the stage. The we just substitute "holder" with our new MC or external .swf

    Using an external .swf would be:

    onClipEvent (load) {
    loadMovie ("externalmovie.swf", "holder");
    }

    considering:
    the action onClipEvent --> depends on what you want to do, if it activates through a button it would be p.e. "on(release)" and so on.

    if holder is in the main timeline use "_root.holder" preferably and so on.

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    sorry if my explanation was not as clear as i would like it to be.

    Mondays a hard to deal with!! hehehe!!

  6. #6
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    Thanks...

    Thank you for the reply...can it really be that easy??? Only two lines of code?? And I just add that to a button?? for example: on release load movie?..blah blah??there is no other code thgat goes anywhere?? Thanks -whispers-

  7. #7
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    yepp, as easy as that.

    And using normal mode in Actions Panel, just adding loadmovie and setting parameters (although it's a good thing to start knowing to write the code, but it's faster!!)

    Remember to put the external movie in the same directory, or specify in the code the path (it MUST be in the same domain though)

  8. #8
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    umm....1 more...

    Is it the same when you do it with movie clips from the library????? What is the code for that?? Thanks -whispers-

  9. #9
    FlashKit Joker
    Join Date
    Jan 2001
    Posts
    659

    Re: umm....1 more...

    Originally posted by whispers
    Is it the same when you do it with movie clips from the library????? What is the code for that?? Thanks -whispers-
    Code:
    tellTarget ("your movieclip") {
        gotoAndPlay (1);
    }

  10. #10
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    Good question

    Good question.....I will definately wantto know the answer to that too...when I am ready to try this..will be soon I suppose!! Thanks Keep me posted. -whispers-

  11. #11
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    OK, lets go.

    You have to take in consideration that we are not loading a MC. We are loading a .swf movie INTO a MC.
    Then, movies don't 'really' have center points as MC have.
    When we load the movie its upper left corner snaps to the center point of our "holder" MC.
    If you want to control the appearence of the holder, you can always place a 100x100px (for this example, resize on your actual needs) flat square (remember with it's upper left corner snapped to the center point) inside "holder" and position it in the scene. Then remove from inside the MC.

    About sploenk's answer:
    It's very easy to use tellTarget, but remember that ALL that MC will be loaded, even if the user never makes use of it. With loadmovie() you load when you want the movie to load. You can even make a sub-preloader if the external movie is big.
    Sure it was for the example, but, for all the newbies, when using gotoAndStop() or gotoAndPlay() don't use frame number. Make use of labels for your frames. Easier to remember.

    This is getting long. The loading MC thinggy from the library is achieved with attachmovie. Got to Actionscript Dictionary for more.

  12. #12
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    didnt work...

    I tried to load a movie clip from my library..using tell target..actually... tellTarget ("your movieclip") {
    gotoAndPlay (1);
    My movie clip is called "aboutwindow"..when I test movie...and click on button that is supposed to have the action..I get this error: Target not found: Target="aboutwindow" Base="_level0" am I typing it worng?? or is there else I have to do?? Thanks -whispers-

  13. #13
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    ooops....

    umm....do I need to drag the movie clip to my stage first??...or do I have todo one of those blank MC things..and drag that to the stage?? Thanks..appreciate all the help I can get! -whispers-

  14. #14
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    Lets start over:
    You wanted to show diferent informations in your movie.
    Then we have 3 options:
    1. loadmovie()
    We just load external .swf's inside our main movie.
    2. tellTarget()
    With this we don't load de MC. We have it already loaded (dragged an instance in our stage). What we actually do is have all the information inside it and jump through the frames.

    Lets see the difference:
    info1, info2, and info3

    With method 1 we load inside "holder" (or whatever) external swf's (those would be info1.swf, info2.swf, etc)

    With method 2 we'd have a MC with 3 frames, lebelled info1, info2 and so on. Then we put the info inside each frame.
    Now with telltarget we tell our instance in the stage to do something, in this case gotoAndPlay("info1") or whatever.

    We could say that method 1 is "on demand"

    Depends on the size of everything to choose either way.

    Method 3.
    attachmovie
    Haven't used it. You have to make the MC in your library "exportable" and name it. Then call it whit "attachmovie()" (or something like that)

  15. #15
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    which one??

    Which one is the easiest?? I am assuming the external .swf is the easiest cause that is the one you explained the best..(in my opinion..) The prob now..is I have all these movie clips in my library...how do I export ONLY that clip to a .swf??
    In method 2 are you talking about the main movie has only three frames? Or the Library movie clip?? (How do you label a frame?)..Method 2 is getting me confused here. Thas for all the help though. Sorry to be a pian..just trying to learn, so any clarification would be great! Thanks -whispers-

  16. #16
    Junior Member
    Join Date
    Oct 2001
    Posts
    21
    mmmm....

    there's no easiest, just more convenient.

    The other day i used both methods at the same time:
    Had this menu that loaded each info (used loadmovie)
    and inside this loaded swf I didn't want scrollbars so y just had 3 frames with the text running trough them with a "next button".

    About method 2:
    the three frames are in the MC, not in the main timeline. This is one of Flas's great things, multiple timelines. That is what you do with telltarget. Be outside the MC but tell it do do things.

    For labelling, the easiest is to create a "labels" layer at the top of the layer stack then use the frame panel, you will see there "label". Put the name there. Remember to add empty keyframes on the frames you want to be labelled.

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