0
votes

I found this great tutorial for "Matrix" cascading code in Flash, but the code has errors. The full tutorial and code is at Flash Matrix - Animated Code Effect ...

Here's the part of the code w/ the problem (lines 75 - 88):

**

if(this.ind < this.myCodes.length and this.delay != 0){
this.ind++;
this.delay--;
} else {
this.ind = 0;
this.delay = this.myCodes.length;
}

**

When I test it I get error:

Scene 1, Layer 'Layer 1', Frame 1, Line 75, Column 35 1084: Syntax error: expecting rightparen before and.

When I placed the rightparen before and, I get error:

Symbol 'one_pod', Layer 'Actions', Frame 1, Line 80, Column 3 1083: Syntax error: else is unexpected.

... and haven't found a fix for the else... I'm not a good actionscripter so kind of hit a wall here... Any ideas?

Thanks!

(I emailed the author re/ this but he hasn't responded...)

1
"I'm not a good actionscripter" so start with AS3 language, not the almost-obsolete AS2. - VC.One
Your absolutely right, but this tute has the best looking result... Otherwise, yes, I only work in AS3... - Tim Houston

1 Answers

0
votes

Try using the AND operator (&&) instead of the word and in your code:

if( (this.ind < this.myCodes.length) && (this.delay != 0) )
{
    this.ind++;
    this.delay--;
} 
else 
{
    this.ind = 0;
    this.delay = this.myCodes.length;
}