0

Trying to do the optimization code for Flash Player 6.0 .

there is a code

if (eval(Movie + "." + NameTextField) == undefined) { // If undefined, the warning will be issued when accessing
        Movie.createTextField(NameTextField, Movie.CountDepth++ , X, Y, Width, Height);             
    }

    if (eval(Movie+"."+Name) == undefined){  //  If undefined, the warning will be issued when accessing    
        Movie.createEmptyMovieClip(Name, (NumDepth == undefined )?(Movie.CountDepth++):NumDepth );
    }

but on the first pass this code always gives a warning in file flashlog.txt.

Do not be properly interviewed yet undeclared MovieClip or TextField?

askeet
  • 689
  • 1
  • 11
  • 24

1 Answers1

1

Try this:

var CountDepth:Number = 0; // you may already have this else where in your code
if (!Movie.NameTextField) { 
    Movie.createTextField(NameTextField, CountDepth++ , X, Y, Width, Height); 
}

if (!Movie.Name){   
    Movie.createEmptyMovieClip( Name, CountDepth++ );
}
Fergoso
  • 1,584
  • 3
  • 21
  • 44