I can access the targetObj instance inside the document class,but when I try to access it in another .as class,get this error:
Access of undefined property targetObj. Anyone can help?
First of all read this.
As you have not mentioned where the 'targetObj' is located, I'll take a guess that you are probably talking about a movieclip instance in the flash stage.
If you have other classes (.as files) and want to allow them to have access to the big family (of you sprites & MC's) then you may :
In short you will have to link the document class to other classes to be able to access classes in the flash IDE or the stage itself, as document class is the entry point to all you custom classes.
, and I refer to it this way in the document class:VideoPlayer.netStreamClientClass = TsVideoClient;`. I can't put it in the document class otherwise will get a nested class error...Create a class, for example called resource. For each item on stage that you want to access, create a public static class member variable in the resource class. In your document class assign the stage item to this public static variable in the resource class. In your other classes you now can access your instances on stage through the references in the resource class.