Hi,

   Try tracing in the "onLoad" function:

public class mainClass {
   public var mc_one:MovieClip;

   public function mainClass()
   {
        trace(mc_one); // Outputs "null"
   }
        
  private function onLoad():void {
        trace(mc_one);
  }
        
}

Glen

Stuart (FunkDaWeb) wrote:
Hello,

I'm having some trouble with AS3, basically if I create a movieclip using the Flash IDE 
and give it an instance name of "mc_one", I'm unsure how to access it from an 
external actionscript class.

Currently on the root timeline I have...

var _mainClass:mainClass = new mainClass();

Which instantiates the mainClass and within the class I need to access "mc_one", but 
obviously "_root.mc_one" will no longer work.

I have tried this:

/* ... */
public class mainClass {
    public var mc_one:MovieClip;

    public function mainClass()
    {
trace(mc_one); // Outputs "null" }
}

The trouble is this solution does not work, it outputs null rather than [Object 
MovieClip]

Help please!
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to