PDA

View Full Version : calling loadMovie from inside mc


civicparadox
01-05-2003, 09:05 PM
I have a movie clip named "movie". What I wanted to do was connect code to the movie clip and load a swf. I can do it when I attach the code to a frame but it doesn't work when I attach it to the movie clip. Here is my code.

onClipEvent (load) {
loadMovie("about.swf", this);
}

I also tried...

onClipEvent (load) {
loadMovie("about.swf", movie);
}

onClipEvent (load) {
loadMovie("about.swf", _root.movie);
}

and...

onClipEvent (load) {
loadMovie("about.swf", _root.this);
}


Some one please help. Thanks.

bembino
01-06-2003, 01:16 AM
That's odd. It doesn't work, but it should. Can you put the loadMovie on the first frame of that clip instead?

jaredly
01-06-2003, 02:04 PM
Are you placeing your ActionScripting on the movie that you are trying to load the external .swf into(your container movie). I am not so sure if you can do that. The container movie is actualy replaced by your exterenal .swf when you load it in.

If you must have your code on a movie clip, first make a new movie with nothing in it. just a blank _mc. Place your coed on that new blank movie, then place (or nest) your container movie inside of that blank movie.

here is the code that you would use on the blank movie.

onClipEvent (load) {
loadMovie("about.swf", this.movie);
}

"I am guessing that movie is the instance name you gave your container movie"

Let me know if that helped at all.

jaredly
01-06-2003, 02:19 PM
I just took a look at your site. Did you know that to launch your clients email you can make a button with this actionscript on it. I is really easy.

on (release) {
getURL ("mailto:you@yourcompany.com");
}

check out my site (http://www.mcartordesign.com/mdc_v2)

Roll over the card in the uper right hand corner and click on the email link

civicparadox
01-07-2003, 05:27 AM
Jared,

Thanks for the tip. So you are saying that I should have a blank movie clip on the main timeline. And that movie clip should container another movie clip and finally the external .swf is in the inner movie clip. If I'm understanding you right, the hiarchial tree should look like this...

root
movie clip
inner movie clip
external swf

I just tried that but it still doesn't work. Strange because when I load the swf into the movie clip by putting code on the frame, it works fine. Here is the code..

loadMovie("external.swf",movieClip);

civicparadox
01-07-2003, 05:34 AM
Oh by the way, I was able to get the swf to load if I put the code on the first frame of the movie clip.

Thanks Bembino

jaredly
01-07-2003, 01:44 PM
I was saying you should try some thing like this.

_root
new_mc ----- loadMovie ("external.swf", "_root.new_mc.container_mc");
container_mc

You got it to work like this?

_root
container_mc ----- loadMovie ("external.swf", "_root.container_mc");

civicparadox
01-08-2003, 05:31 AM
Thanks Jared, you way works also. The other way I got it to work was to put

loadMovie("external.swf", this);

in the first frame of the mc.