Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > Simple Stuff (Newbies)

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-14-2003, 08:31 PM   #1
ian27
Registered User
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 90
Send a message via AIM to ian27 Send a message via MSN to ian27 Send a message via Skype™ to ian27
Default Preloader problem with external movies

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

Last edited by ian27; 04-15-2003 at 08:52 AM.
ian27 is offline   Reply With Quote
Old 04-15-2003, 08:54 AM   #2
ian27
Registered User
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 90
Send a message via AIM to ian27 Send a message via MSN to ian27 Send a message via Skype™ to ian27
Red face

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
ian27 is offline   Reply With Quote
Old 04-15-2003, 05:51 PM   #3
skee
shreadmeister
 
skee's Avatar
 
Join Date: Jun 2002
Location: Sonoran Desert
Posts: 491
Default

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
skee
__________________
HeavyBag
skee is offline   Reply With Quote
Old 04-15-2003, 07:01 PM   #4
ian27
Registered User
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 90
Send a message via AIM to ian27 Send a message via MSN to ian27 Send a message via Skype™ to ian27
Default

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
ian27 is offline   Reply With Quote
Old 04-15-2003, 08:14 PM   #5
skee
shreadmeister
 
skee's Avatar
 
Join Date: Jun 2002
Location: Sonoran Desert
Posts: 491
Default

try

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

skee
__________________
HeavyBag
skee is offline   Reply With Quote
Old 04-15-2003, 08:24 PM   #6
Warrior
Victory Is Mine
 
Warrior's Avatar
 
Join Date: Apr 2003
Location: Earth
Posts: 1,233
Default

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,

ActionScript Code:
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
Warrior is offline   Reply With Quote
Old 04-15-2003, 08:35 PM   #7
skee
shreadmeister
 
skee's Avatar
 
Join Date: Jun 2002
Location: Sonoran Desert
Posts: 491
Default

listen to warrior...he nailed it
skee
__________________
HeavyBag
skee is offline   Reply With Quote
Old 04-16-2003, 03:26 AM   #8
Warrior
Victory Is Mine
 
Warrior's Avatar
 
Join Date: Apr 2003
Location: Earth
Posts: 1,233
Default

Thanks skee

I like your website. Cool 3D effects. What did you use to make it?
Warrior is offline   Reply With Quote
Old 04-16-2003, 04:20 AM   #9
skee
shreadmeister
 
skee's Avatar
 
Join Date: Jun 2002
Location: Sonoran Desert
Posts: 491
Default

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
__________________
HeavyBag

Last edited by skee; 04-16-2003 at 04:24 AM.
skee is offline   Reply With Quote
Old 04-16-2003, 04:31 AM   #10
Warrior
Victory Is Mine
 
Warrior's Avatar
 
Join Date: Apr 2003
Location: Earth
Posts: 1,233
Default

I tried Swift 3D 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?
Attached Images
File Type: jpg the-matrix.jpg (33.5 KB, 442 views)
Warrior is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:26 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.