Hi there,

I have discovered what appears to be a bug in Flash (player 7): I have
a class method which takes an object and a path string in dot-notation
format, and evaluates the result of the combined path. e.g.

evalAppendedPath( my_mc, "some.nested.clip" );

would return the object result of: my_mc.some.nested.clip;

This is a general purpose method which can take any object as an
input, and the evaluated result could also be of any type, so the
method return type is always going to be Object.

This method works just fine, and is not the source of the problem.

The problem comes when I know what the expected return type is and I
need to cast it so that I can use it with strong typing. In every
case, casting the returned result works just fine, with the exception
of movieclips placed on the stage at authortime. For example:

var result:Object = evalAppendedPath( my_mc, "some.nested.clip" );
trace( result );  // "_level0.my_mc.some.nested.clip"
trace( typeof( result )); // "movieclip"
var mc:MovieClip = MovieClip( result );
trace( mc ); // "null"

But if I load an external swf asset, evaluate its path, and cast it,
the cast works and doesn't yield null.

Short of changing all my internal class references to type Object
instead of MovieClip (which could cause all sorts of problems trying
to mesh with other code) or loading all my assets externally (which
will cause load time issues) is there anything else I can do?

Thanks!

--

Scott Whittaker
Trilobyte Interactive
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to