all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

Need Assistance w/ IF THEN Statements



Need Assistance w/ IF THEN Statements aswg
11/15/2004 10:10:39 PM
flash actionscript: Hello,

Flash MX.

I am a beginner-student of this and I cannot get any of my if then statements
to work properly w/o an error. I am using a tutorial which provides the code:

function checkLoaded (movies){
var total = 0;
var done = 0;
var pLoaded = 0;
for (var i = 0; i<movies[0].length; i++) {
var mc = eval(movies[0] );
if (mc.getBytesTotal ( ) ! = undefined) {
total += mc.getBytesTotal ();
done += mc.getBytesLoaded();
} else {
total = 0;
break;
}
pLoaded = Math.ceil (done/total*100);
}
trace(pLoaded + "% loaded");
}


and the error message I receive reads as follows:

Scene=Scene 1, Layer=Actions, Frame=1: Line 7: ')' expected
if (mc.getBytesTotal( ) ! = undefined) {

Scene=Scene 1, Layer=Actions, Frame=1: Line 10: 'else' encountered without
matching 'if'
} else {

Am I simply over looking something or is this another type of error? This is
the second time around in which I cannot fiugre out whether I simply typed
something wrong or there is a greater issue afoot.

aswg
Re: Need Assistance w/ IF THEN Statements aswg
11/15/2004 11:01:08 PM
Thanks alot and my apologies concerning the double posting.

Re: Need Assistance w/ IF THEN Statements Jeckyl
11/16/2004 9:23:40 AM
You've posted this twice.

I've already answered .. its an extra space between ! and =

AddThis Social Bookmark Button