PDA

View Full Version : Preloader problem with external movies


ian27
04-14-2003, 08:31 PM
Hi all,

I've had a bit of a problem with a preloader and hope that somebody can help me with it.

Basically, I have made a main movie which when buttons are clicked it loads in external .swf movies. To the external movie I've added a simple preloader such as:

onClipEvent (enterFrame) {
ifFrameLoaded (24) {
_root.gotoAndPlay (2);
}
}

The Problem: the preloader works fine when I run the external movie on it's own, the problem is when I run the external movie via the main movie. The preloader works fine but then it never moves onto the second frame, it just sticks with the completed preloader and goes no further. I'm presuming that this is a targeting problem. Can anybody help?

Cheers,

Ian

ian27
04-15-2003, 08:54 AM
Sorry about that everybody. I have just realised that yesterday when I posted this thread I only pasted half of the question. Hopefully now I might get a response now that you know what my problem is.

Ian

skee
04-15-2003, 05:51 PM
the _root.gotoAndPlay (2)script will tell the main movie timeline to goto frame 2 and play. I take it that you wanted the externally loaded swf to do this not the main? if you are loading into an empty mc, then the path should be more like _root.emptymc.gotoAndPlay (2). more details would help. also, I have found the advanced-cover preloader tutorial to be a great way to preload external mc's
BillyT-tuts (http://www.tableau.com.au/tutorials/)
skee

ian27
04-15-2003, 07:01 PM
Hi,

Thanks for the reply.

Okay, this is what I've got. I have my main movie (test.swf), into which I automatically want to load an external movie (topmovie.swf). I have created a blank MC and dragged it onto the stage giving this blank MC the Instance name "topmovie".

So in the first frame of my main movie I have attached the action:

loadMovie ("topmovie.swf", "_root.topmovie");

Now this works fine and runs the movie without any problems.

However, I then decided that I wanted to add a preloader to the external movie "topmovie.swf". So I open up the file "topmovie.fla" and add a preloader in the usual way by adding a stop action in the first frame and then adding the following actionscript to the preloaders MC:

onClipEvent (enterFrame) {
ifFrameLoaded (24) {
_root.gotoAndPlay (2);
}
}

Now I test the external movie "topmovie.swf" and it works fine with the preloader etc.

I then go back to the main movie "test.swf" and test it. The top movie preloader begins but then fails to move onto frame 2 once loaded which results in no top movie actually been played.

I tried adding this script instead:

onClipEvent (enterFrame) {
ifFrameLoaded (24) {
_root.topmovie.gotoAndPlay (2);
}
}

But this doesn't work either.

I hope this all makes sense.

I'm completely lost with this one so any advice would certainly be appreciated.

Ian

skee
04-15-2003, 08:14 PM
try

this.onClipEvent (enterFrame) {
ifFrameLoaded (24) {
_root.topmovie.gotoAndPlay (2);
}
}

skee

Warrior
04-15-2003, 08:24 PM
When you are referring to "_root" inside a movie clip that is being loaded by a Main Movie, you run into problems because Flash thinks you are referring to the Main Movie. This is what you should do. Put a "stop()" action on the first Keyframe inside the movie being loaded and the label "Start" in the second Keyframe. Put this preloader code on a movie clip inside the Main Movie and put a "stop()" on the Keyframe of the Preloader,

onClipEvent (load) {
loadMovieNum ("YourMovieClip.swf", 1);
}
onClipEvent (enterFrame) {
Total = Math.round(_level1.getBytesTotal()/1000);
Loaded = Math.round(_level1.getBytesLoaded()/1000);
Percent = Math.round(_level1.getBytesLoaded()/_level1.getBytesTotal()*100);
_root.PercentDisplay = int (Percent) + " %";
if (Percent == 100) {
_level1.gotoAndPlay("Start");
_root.play();
}
}


If you need help, I can send you the Flash File :D :cool:

skee
04-15-2003, 08:35 PM
listen to warrior...he nailed it
skee

Warrior
04-16-2003, 03:26 AM
Thanks skee ;)

I like your website. Cool 3D effects. What did you use to make it?

skee
04-16-2003, 04:20 AM
Warrior,
thanks. i used swift 3d for the 3D stuff...also things I learned on this forum and others .
skee

...and by the way. props to your site as well. very cool nav system

Warrior
04-16-2003, 04:31 AM
I tried Swift 3D :rolleyes: It's not hard and it's not easy but it made my computer very slow. I also noticed some people complained about their computers being slow as well. Now I am trying to learn "Maya" I don't know if you herd of it but it's what they used to make star wars, the mummy, the mummy returns and Final Fantasy movie. It is very complicated and 10 times bigger then PhotoShop. The optins are just unlimited, I really don't knwo how people get around it. I am now trying to make The Matrix text effect in Maya. Take a look at this picture of what the tutorial is teaching me. What do you think of Maya and other 3D programs? :cool:

Warrior
04-16-2003, 04:31 AM
I tried Swift 3D :rolleyes: It's not hard and it's not easy but it made my computer very slow. I also noticed some people complained about their computers being slow as well. Now I am trying to learn "Maya" I don't know if you herd of it but it's what they used to make star wars, the mummy, the mummy returns and Final Fantasy movie. It is very complicated and 10 times bigger then PhotoShop. The optins are just unlimited, I really don't know how people get around it. I am now trying to make The Matrix text effect in Maya. Take a look at this picture of what the tutorial is teaching me. What do you think of Maya and other 3D programs? :cool:

skee
04-16-2003, 04:39 AM
i don't have any experience with Maya but have heard some good things about it. just got into the 3d arena have just been tinkering around with swift 3d. haven't noticed any "slowing" issues with it and my computer. cool image. i need to check out Maya a bit. studio max is popular. check out this forum for a recent dialog on this topic


3d forum (http://www.actionscript.org/forums/showthread.php3?s=&threadid=25748)


skee

ian27
04-16-2003, 09:46 AM
Hi Warrior,

Thanks for the input. I have tried your suggestion but can't get it to work still (I'm obviously missing something - perhaps my brain). I am actually loading the external .swf file into an MC rather than onto a level - would this make any difference?

If you could post me the Flash file that you suggested that would be great.

My e-mail is <[email protected]>.

Thanks mate,

Ian

Warrior
04-16-2003, 02:56 PM
Here is the Flash File. I hope everything goes ok.

Warrior
04-16-2003, 03:02 PM
Sorry, something went wrong with the attachment in the last post. Here it is.

ian27
04-16-2003, 06:46 PM
Hi Warrior,

Thanks for the file.

I seem to have got it working okay now although I have had to use levels instead of targeted movie clips as I could only get one of them working. But am now happy that it's working at least.

Cheers mate,

Ian

Warrior
04-17-2003, 12:06 AM
I am glad I was able to help :p :D :cool:

Take care
God Bless