have you tried without the line public var mc_one:MovieClip;?

it's my understanding that instantiating it by physically dragging it out of the library and giving it an instance name is the declaration - the way you're doing it would give a local variable the name with no value, hence mc_one = null

a

On 2 Apr 2008, at 11:53, 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



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

Reply via email to