Question
help with error msg
The following code throws an error (Attribute used outside
class) on
line 3 and 4. What have I done wrong?
Can you see any other problems with this code / approach??
(the goal is to load a number of swf's into movie clips and then show
them one after the other)
Steve
-------------------------------
AS in frame 1 of main SWF:
if (init == undefined) {
var aSWFs:Array = new Array("an1.swf", "an2.swf", "an3.swf");
public nSWFs:Number = aSWFs.length;
public nCurSWF:Number = 0;
public aSWFmcs:Array = new Array();
for (var n=0; n<=nSWFs; n++) {
aSWFmcs.push(createEmptyMovieClip("swf"+n, n));
}
var mcl:MovieClipLoader = new MovieClipLoader();
var Listen:Object = new Object();
Listen.onLoadInit = function() {
if (nCurSWF <= nSWFs) {
nCurSWF++;
// load the next swf
mcl.loadClip(this.aSWFs[nCurSWF], aSWFmcs[nCurSWF]);
trace("loading " + this.aSWFs[nCurSWF]);
} else {
// done loading... start playing
aSWFmcs[0].gotoAndPlay(2);
}
}
mcl.addListener(Listen);
mcl.loadClip(this.aSWFs[0], aSWFmcs[0]);
init = 1;
}
------------------------------------
AS in frame 1 of each SWF:
stop():
AS in last frame of each SWF:
stop();
// if the Current SWF is not the last increment nCurSWF, else set it to
the start
if (nCurSWF < nSWFs) {
nCurSWF++;
} else {
nCurSWF = 0;
}
aSWFs[nCurSWF].gotoAndPlay(2);
line 3 and 4. What have I done wrong?
Can you see any other problems with this code / approach??
(the goal is to load a number of swf's into movie clips and then show
them one after the other)
Steve
-------------------------------
AS in frame 1 of main SWF:
if (init == undefined) {
var aSWFs:Array = new Array("an1.swf", "an2.swf", "an3.swf");
public nSWFs:Number = aSWFs.length;
public nCurSWF:Number = 0;
public aSWFmcs:Array = new Array();
for (var n=0; n<=nSWFs; n++) {
aSWFmcs.push(createEmptyMovieClip("swf"+n, n));
}
var mcl:MovieClipLoader = new MovieClipLoader();
var Listen:Object = new Object();
Listen.onLoadInit = function() {
if (nCurSWF <= nSWFs) {
nCurSWF++;
// load the next swf
mcl.loadClip(this.aSWFs[nCurSWF], aSWFmcs[nCurSWF]);
trace("loading " + this.aSWFs[nCurSWF]);
} else {
// done loading... start playing
aSWFmcs[0].gotoAndPlay(2);
}
}
mcl.addListener(Listen);
mcl.loadClip(this.aSWFs[0], aSWFmcs[0]);
init = 1;
}
------------------------------------
AS in frame 1 of each SWF:
stop():
AS in last frame of each SWF:
stop();
// if the Current SWF is not the last increment nCurSWF, else set it to
the start
if (nCurSWF < nSWFs) {
nCurSWF++;
} else {
nCurSWF = 0;
}
aSWFs[nCurSWF].gotoAndPlay(2);