PDA

View Full Version : Loading External Movie



Paz
May 29th, 2003, 07:26 PM
Hi

I am trying to create a online portfolio and wanted to open an external movie in a specific place. I have now managed to do this, but now it opens where I want it does not play my movie that it opens. (code below)

on (release) {
_root.empty.loadMovieNum("kari.swf", "_level1");;
}

If I don’t place the external movie within the area I would like it in, and have it just open the movie will play quite happily.

Any advice?


:(

aurelius
May 29th, 2003, 07:33 PM
What is the code you are using to position the loaded .swf where you want it on the stage?

Paz
May 29th, 2003, 07:51 PM
the code is as follows

on (release) {
_root.empty.loadMovieNum("kari.swf", "_level1");;
}

and it works, but just does not play the movie when opened.

aurelius
May 29th, 2003, 08:15 PM
Maybe I'm confused (I usually am :)). Let me see if I get you right here.

1. You loaded the shockwave and it played fine, but it was not placed where you wanted it.

2. You managed to place the loaded clip at a specific location, but when you did that, it no longer plays.

3. You're wondering how to make it play now that you moved it to the specific location.

Is that right, or am I talking crazy here?

Did the code you provided work before you managed to move the clip to a specific place? If so, then the problem is probably with some other code, probably the code that you used to place the loaded clip at a specific place?

Or perhaps you meant "specific level" when you said "specific place"?

Have you tried placing a "this.play();" on the first frame of the loaded clip?

Paz
May 30th, 2003, 05:10 AM
No you guessed right, your not going crazy!

I Have tried placing a "this.play();" on the first frame of the loaded clip but still no good. :-\

I might have to rethink my idea.
:sigh:

aurelius
May 30th, 2003, 10:14 AM
Perhaps this has something to do with it.

I checked the actionscript dictionary for movieClip.loadMovieNum(), but found that it was only listed as a global function (just a plain old "loadMovieNum()" rather than being attached to a movieClip). I could have sworn loadMovieNum was both a global and movieclip method, but the doc says it's not. But if you think about it, that makes perfect sense. After all, loadMovieNum is loading into a level rather than another movieclip.

So maybe just try:



on (release) {
loadMovieNum("kari.swf", "_level1");
}

And then use:


_level1._x = 50;
_level1._y = 50;

to place the clip where you want on the stage.

(I noticed just now that you're code has two semicolons, that's probably just a typo on the forum, but check your code just in case)

Let me know if that works.

upuaut
May 30th, 2003, 10:38 AM
The alternative is to use loadMovie() instead of loadMovieNum();
The later loads movies into levels, as aurelius explained. The former loads an external movie into a target movie clip, using the following syntax

targetClipInstance.loadMovie("url");

then you can move the movie around all you like by simply calling

targetClipInstance._x=50;

or something like that.

the loadMovieNum uses the upper left corner of the stage as a registration point for the player. So when you load a movie into level 2 it lines up it's upper left corner with the registration point, and ends up being unmovable.

I don't think that you can do

_level1._x=50; The x and y possition of a level are always 0/0

lunatic
May 30th, 2003, 11:53 AM
Please ignore me if this is a stupid question but why are you putting "_level1" in quotes like that? If you want it loaded one level about the _root why not just put

loadMovieNum("Kari.swf", 1);

?

Sometimes you'll find you have to tweak the placement of the stuff in the external swf on IT'S stage to get it to line up the way you want but I have had much success with the above method for loading external swfs, especially if they are smaller than my main movie.

catreya
May 30th, 2003, 02:38 PM
I have a similar problem. My code goes like this..


on (release) {
_root.createEmptyMovieClip("movieloader",1);
_root.movieloader._width = 200;
_root.movieloader._height = 200;
_root.movieloader._x = 10;
_root.movieloader._y = 200;
_root.movieloader._alpha = 100;
_root.movieloader.loadMovie("heading.swf",1);

}


Now, if i delete the width and height property for the clip, it works just fine. However, if I introduce them, i think the external swf file is loaded, but it does not display its contents.

weird!

Paz
June 1st, 2003, 06:19 PM
Hi aurelius,

I have tried your method this just seems to open the movie on a new page filling the entire browser window.

I have only started with action scripting recently, so I think I might just be me making stupid mistakes. I'll keep trying...

Thanks
:hair:

aurelius
June 1st, 2003, 07:46 PM
Hi Paz,

Could you post your .fla? Maybe we could take a look and something might pop out at us.

aurelius

Paz
June 2nd, 2003, 07:08 PM
Hi aurelius,

Sorry my file is too large to attach do you have an email address i may forward this on to?

Paz

Paz
June 2nd, 2003, 07:11 PM
Sorry just ignore that I see the email button ;)

aurelius
June 2nd, 2003, 08:09 PM
Okay, I got the files. They appear to work fine to me. What is it exactly that is the problem?

Paz
June 3rd, 2003, 06:28 PM
When the .swf file has opened it should allow the three buttons to change images, but if you go over the buttons or press them, the images don't change.

Please let me know if it is operating in this correct way for you!

Thanks
Paz

aurelius
June 3rd, 2003, 06:59 PM
yeah, it loads all three images for me, no problems. weird. I wonder why it won't work for you?

Paz
June 4th, 2003, 03:44 AM
Do you have any idea, why this is?

As i don't understand this at all anymore. Please can some body shed some light on this!

As this has stopped me from working even before i've really got started.

aurelius
June 4th, 2003, 09:23 AM
Just to be sure, here's what happens with the .fla you sent me. When the .swf first starts up, there's a big picture on the screen. On the left are the three little buttons. When I pass my mouse over each of them, the big picture slides off and a new picture slides on the screen. Thes pictures take up the full screen with the exception of the grey bar on the left side of the screen (in which the three buttons reside at the bottom). Is that what it's supposed to do?

Paz
June 4th, 2003, 02:07 PM
Yes that is what is supposed to do, but it doesn't do that here.

What browser are you using and is it running on windows, currently i'm working in Flash MX, on windows MX using explorer 6.

can you think of any other reason why this might not be working here?

aurelius
June 4th, 2003, 03:00 PM
Weird. I'm using Flash MX, Windows 98SE, and IE 5.

I'm pretty stumped on why it won't work for you . . .

one thought . . . maybe your Flash Players aren't updated. What do you get when you run this:



trace(getVersion());


I'm not sure out of date Flash players are the problem, but better safe than sorry.

Paz
June 4th, 2003, 03:20 PM
This is all i get ( WIN 6,0,4,0 )

aurelius
June 4th, 2003, 03:28 PM
Hmmm...again, I doubt this is the problem, but you might as well update your Flash Players.

When you update your Flash Players, just going to macromedia.com and downloading the latest version only updates your browser player. You need to update the Flash Player that your authoring tool uses (yes, they're different, and it's annoying). It's a hefty 10Mb download, but well worth it.

Here's a link to download the right file:
Windows update (http://download.macromedia.com/pub/flash/updates/mx/player6/fp6_update_r79.exe)

Paz
June 4th, 2003, 03:34 PM
Thanks a lot, just downloading now. I'll let you know how i get on!

Paz
June 4th, 2003, 05:50 PM
Thought this might be the solution, but no, not working.

aurelius
June 4th, 2003, 06:43 PM
Anybody else have any ideas why Paz's flash works for me but not for him?

Paz
June 4th, 2003, 06:56 PM
I have now uploaded the flash file on the following:-

http://www.pagemakers.co.uk/flash

The movie is operated by pressing the white bar. When pressed there's a big picture on the screen. On the left are the three little buttons. When I pass my mouse over each of them, the big picture slides off and a new picture slides on the screen. The pictures take up the full screen with the exception of the grey bar on the left side of the screen.

Please let me know if this does or does not work for people. Thanks!

aurelius
June 4th, 2003, 07:08 PM
This link loads something else (a .fla that changes colors)?

Paz
June 4th, 2003, 07:17 PM
Yes thats if you press the colored buttons along the bottom. I know that works.

Its the white bar that i need to know if its working to load my .swf file and play! on the left hand side of the movie.

Cheers

aurelius
June 4th, 2003, 07:55 PM
Ah, I see. It doesn't work for me. :( The big image loads, but the other three don't when I click the buttons.

Paz
June 5th, 2003, 06:44 PM
Hi aurelius,

I got this working finally, the problem was nothing to do with the .fla file. It was the .swf i was loading into this.

I had placed the command of "_root" instead of using "this".

Now its all working, took abit of research but well worth it. Thanks for all your efforts! working link below.

http://www.pagemakers.co.uk/flash

aurelius
June 5th, 2003, 07:22 PM
ah, of course. that makes sense. since the .swf worked for me, then the problem would have to be a path problem once you loaded it into the main shockwave.

looks great, by the way.