Am i doing this wronlgy?


Ok, i have a MovieClip in my library with a function that uses variables declared just above it like so;

var myString:String = "this is a string";

function traceVal():void

traceVal(); // Returns "this is a string"

okay. this works after i drag and drop the mc from the library to the stage.

later on, i right clicked on the linkage properties of the mc and made it into a Class called “Tracer” with a base class of “flash.display.MovieClip”, and removed the traceVal(); caller,

back on stage, when i tried to make an instance of the Class and call a nested function in it. It was unable to return me the variables which was declared in the MovieClip

var my_tracer:Tracer = new Tracer();


my_tracer.traceVal(); // Retruns "null"

am i doing this wrongly? can anyone help me?