07-22-2003, 08:58 PM
|
#1
|
|
Visit aendirect.com
Join Date: May 2003
Location: Singapore
Posts: 104
|
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.
|
|
|
07-22-2003, 09:03 PM
|
#2
|
|
Oops I did it again
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
|
try putting the visible and stop in the first frame of the external movie
cheers
|
|
|
07-22-2003, 09:55 PM
|
#3
|
|
village halfwit
Join Date: Jul 2001
Location: USA, PA
Posts: 3,328
|
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.
|
|
|
07-23-2003, 06:16 AM
|
#4
|
|
Visit aendirect.com
Join Date: May 2003
Location: Singapore
Posts: 104
|
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...
|
|
|
07-23-2003, 06:19 AM
|
#5
|
|
Oops I did it again
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
|
did you try?
|
|
|
07-23-2003, 11:10 AM
|
#6
|
|
Visit aendirect.com
Join Date: May 2003
Location: Singapore
Posts: 104
|
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...
|
|
|
07-23-2003, 11:53 AM
|
#7
|
|
Oops I did it again
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
|
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
|
|
|
07-23-2003, 12:28 PM
|
#8
|
|
Visit aendirect.com
Join Date: May 2003
Location: Singapore
Posts: 104
|
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?
|
|
|
07-23-2003, 12:35 PM
|
#9
|
|
Oops I did it again
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
|
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...
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 08:03 PM.
///
|
|