A Flash Developer Resource Site

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

Thread: loadmoive problem..

  1. #1

    loadmoive problem..

    This work,

    (code in the _root frame)
    loadMovie("entry.swf", "entry_mc");

    But this doesn't

    (code in entry_mc)
    onClipEvent (load) {
    loadMovie("entry.swf", this);

    }

    any idea why?

    chup

  2. #2
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    I'm no expert on loadMovie so I can't really say. But here's another aproach you could try:

    this.loadMovie("entry.swf");

    /Mirandir

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The second one doesn't work, because 'this' doesn't mean anything in this context. With a loadMovie, the first part is the name of the clip to load, the second is the name of the clip to load it into, and it needs "" around it.

  4. #4
    So what sld i do if i realli wanna load the movie use a clip event?

    chup

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    this.loadMovie("entry.swf");
    loadMovie("entry.swf", this);

    Both of the above work, if you put them in a keyframe in the movie clip itself, and not as an "onClipEvent" of that movie clip.

  6. #6
    So am i correct to say that no matter what, putting on the onClipevent won;t work?

    chup

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    No. If you add an empty movie clip to the stage, you can load a movie clip into it with an onClipEvent (enterFrame). Get the attachment, it's for MX, and just make sure you have entry.swf in the same folder you save it to.
    Attached Files Attached Files

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Iaskwhy...

    The only reason why it's working, is because you're using loadMovieNum - which you shouldn't, it should be only loadMovie when loading in an holder clip! -, and what in fact is happening is that your loading "entry.swf" on _level0, thus replacing your main movie with the new loaded movie.

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    oldnewbie, That's what I thought, but.....

    I have a folder here with the main movie, a target clip, and a load-into-the-target-movie-from-the-folder clip that proves it works. I know, I know, it ain't supposed to work, and it's driving me nuts too. So check the attachment out. Both swf's and both fla's are in the zipper. Tell me WTF is happening.
    Attached Files Attached Files

  10. #10
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I have put it on my server, check it out.

    http://64.21.153.144/noob.htm

    What we have here is an external swf loading into a target that is on the main timeline. I assume that means level0??? The target uses the usual name and instanace name, but the button code is:

    on (release) {
    loadMovieNum ("flamx.swf", 1);
    }

    OK, that should load it into level1, but... it loads the external into the MC, every time, and not only that, but I can drag that clip anywhere around the stage, and it will still load the swf into it. It's driving me bats, cause it should not work at all.

    On top of that, I can't build a new file with target clip and load an external swf into it now using loadMovie, for some reason. I've tried twice today, and I have done this a dozen times before and it worked as expected. Now, they don't work.

    I take that back, I just made one and it worked as usual. Phew...
    Last edited by iaskwhy; 10-26-2002 at 04:43 PM.

  11. #11
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Your secretholder mc is corrupted! Delete the one you have on stage, and drag a new instance from the Library... Then it won't load in that mc!

  12. #12
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    OK, did that. Gave it the same instance name, and it's still doing it.

    But, I did not stumble on this by accident. Got it out of a Macromedia book. I was sceptical too, but it works, and I can reproduce it.

    Ah, totally forgot. The secret loader is named that for a reason. Open the flamx.fla and look at the action for frame 1. LOL. don't tell anyone.
    Last edited by iaskwhy; 10-26-2002 at 06:07 PM.

  13. #13
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Ok! But it only works if the holder has that instance name...

    And what would your point be?

  14. #14
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    The only point is, that it can be done. It can come in handy for loading random clips from an array into the clip, which can be moved at will anywhere on the stage.

    It'll also allow chup to use an onclipEvent to load his movie.
    Last edited by iaskwhy; 10-26-2002 at 08:12 PM.

  15. #15
    so what went wrong actually?

  16. #16
    Senior Member
    Join Date
    Oct 2002
    Posts
    153
    Go to www.cruciallimit.com.Than go to lab and choose flash.There you can download a documented fla, which teachs how to load external swfs into target with transitions and preloader.

  17. #17
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Nothing went wrong. But there is a way to make an onClipEvent load a movie. Either on load or enterFrame. It's just a round about way to do it.

    Sorry, forgot, you can see it here. This is set for an enterFrame event, [frame 60]. At frame 60, the main movie loads a second movie into a target, which you can move anywhere you want on the stage. I have tested it on a load event and it works the same way, only no wait.

    http://64.21.153.144/noob.htm
    Last edited by iaskwhy; 10-26-2002 at 08:59 PM.

  18. #18
    Senior Member
    Join Date
    Oct 2002
    Posts
    153
    Can you post the *.fla iaskwhy?

    Thanks

  19. #19
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Sure, forgot again. I been awake too long.

    OK, this is a zip with 3 fla's in it. You should open all three to the same folder and make swf copies. Look in the flamx.fla and check the first frame action script. That's the kicker. The other two fla's are one for an enterFrame event, [60], and one for a load event, first and only frame. You have a lot more control over the loaded movie if you make the target the same size as the loading movie. And you can put the target anywhere on stage you want and alpha it to 0 so it doesn't show if you want. It's really quite simple.

    Also, this is loading a movie as an external resource, so it isn't in the library, but to work, the flamx.swf, [or your own movie clip] has to be in the same folder to work, either on your PC, or on your server.
    Attached Files Attached Files

  20. #20
    Senior Member
    Join Date
    Oct 2002
    Posts
    153
    Can you explain me this code please:

    _x = _level0.theClip._x;
    _y = _level0.theClip._y;


    What the hell is theClip?
    I don´t see any movieClip named theClip.

    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