Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-22-2003, 08:58 PM   #1
aeon
Visit aendirect.com
 
aeon's Avatar
 
Join Date: May 2003
Location: Singapore
Posts: 104
Send a message via MSN to aeon Send a message via Skype™ to aeon
Default multi loadMovie prob

I've thought of a way to load multiple movies in the background while the user is browsing other areas. When a user eventually comes to a section, that swf has either loaded or in the cache. It's a way to speed up overall browsing.

ActionScript Code:
// main loadMovie function function loadMulti(movieName,lvl){     loadMovieNum(movieName,lvl); //movieName and lvl depends on array index     lvl = "_level"+lvl;     lvl._visible=0; //hide loaded movies     lvl.stop(); //so they won't play } //builds array for movie names, arrays start at index [0] don't forget //enter your own file names multiMovies = new Array("amp.swf","contact.swf","data.swf","love.swf","root.swf","type.swf"); //start loading the 6 movies from level 11 to 16 for(i=0;i<=multiMovies.length;i++){     loadMulti(multiMovies[i],i+11); //adds 11 to load to lvl 11,12,13, etc... }

The problem is I can see the loaded movies pile up on the upper levels and the stop(0 and _visible=0 doesn't work.

It's 4.30AM now... feelin cranky...

Anyone??

If I can get this working, it'll be a cool idea i guess.
aeon is offline   Reply With Quote
Old 07-22-2003, 09:03 PM   #2
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

try putting the visible and stop in the first frame of the external movie

cheers
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 07-22-2003, 09:55 PM   #3
pixelwit
village halfwit
 
pixelwit's Avatar
 
Join Date: Jul 2001
Location: USA, PA
Posts: 3,330
Default

This post has been identified as a 'crosspost', that is, it has been posted multiple times on the forums. Please post each question just once and we will do our best to answer it. Thanks.

Since this is a crosspost and this thread has little or nothing to do with Animation and Effects, your other thread has been deleted.

-PiXELWiT
http://www.pixelwit.com
__________________
There are no answers, only choices.
pixelwit is offline   Reply With Quote
Old 07-23-2003, 06:16 AM   #4
aeon
Visit aendirect.com
 
aeon's Avatar
 
Join Date: May 2003
Location: Singapore
Posts: 104
Send a message via MSN to aeon Send a message via Skype™ to aeon
Default

Sorry about that! I posted at the wrong forum so I reposted at the right one.
Thanks for deleting the wrong one.
I don't it'll work id I put the stop and _visible on the 1st frame of the movie...
aeon is offline   Reply With Quote
Old 07-23-2003, 06:19 AM   #5
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

did you try?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 07-23-2003, 11:10 AM   #6
aeon
Visit aendirect.com
 
aeon's Avatar
 
Join Date: May 2003
Location: Singapore
Posts: 104
Send a message via MSN to aeon Send a message via Skype™ to aeon
Default

Yeh I tried but I need to make it play when I actually load it from navigation.
Didn't succeed.
ActionScript Code:
// main loadMovie function function loadMulti(movieName,lvl){     loadMovieNum(movieName,lvl); //movieName and lvl depends on array index     lvl = "_level"+lvl;     lvl._visible=0; //hide loaded movies     lvl.stop(); //so they won't play     trace(lvl); } //builds array for movie names, arrays start at index [0] don't forget //enter your own file names multiMovies = new Array("amp.swf","contact.swf","data.swf","love.swf","root.swf","type.swf"); //start loading the 6 movies from level 11 to 16 for(i=0;i<=multiMovies.length;i++){     loadMulti(multiMovies[i],i+11); //adds 11 to load to lvl 11,12,13, etc... }

the trace output for the variable lvl is _level11, _level12, _level13... so I don't know why

lvl._visible=0;
and
lvl.stop();

doesn't work...
aeon is offline   Reply With Quote
Old 07-23-2003, 11:53 AM   #7
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

because your setting the values before the movie has even started loading...

as for making them play, set a var with your buttons as well as the loadMovie

eg

playMovie=true;

then in frame one of the movie have

if(_level0.playMovie!=true){
stop();
}

cheers
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 07-23-2003, 12:28 PM   #8
aeon
Visit aendirect.com
 
aeon's Avatar
 
Join Date: May 2003
Location: Singapore
Posts: 104
Send a message via MSN to aeon Send a message via Skype™ to aeon
Default

ActionScript Code:
// main loadMovie function function loadMulti(movieName, inst) {     inst = "MC"+inst;     _root.createEmptyMovieClip(inst, random(9));     loadMovie(movieName, inst);     //loads movieName into inst     _root.inst.stop();     //so they won't play     trace(mNamesArray[i]+" is loaded into "+inst);     trace(inst);     inst._visible = 0;     trace(inst._visible); } //builds array for movie names, arrays start at index [0] don't forget //enter your own file names mNamesArray = new Array("memo.swf", "contact.swf", "data.swf", "love.swf", "root.swf", "type.swf"); //start loading the 6 movies into MC1 to MC6 for (i=0; i<=mNamesArray.length-1; i++) {     loadMulti(mNamesArray[i], i+1);     //add 1 so instance name start at 1 not 0 }

trace(inst); returns undefined...

why?
aeon is offline   Reply With Quote
Old 07-23-2003, 12:35 PM   #9
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

trace(inst._visible);

returns undefined - not inst

when you provide inst to the function its a number...then in the first line you change it to a string...then you attempt to use it as the depth parameter in the loadMovie which needs a number not a string...
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T 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 10:07 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.