0

I am trying to reference a movie clip through its instance name which I have called "mc_mycursor" inside flash.

I want to access this movie clip inside my main document class which runs the entire application. Till now I have been exporting all objects on my stage to classes and then adding them as child objects to my stage which works fine but I would like to know how to directly refer to an object inside stage in AS3 just by using its instance name.

I have declared the variable in my main doc as follows

private var mc_mycursor:MovieClip;

but when i try to do something like mc_mycursor.x = 500, it throws an error. I am new to Flash so some help would be appreciated.

1 Answer 1

1

You first need to instantiate it like:

mc_mycursor = new MovieClip();
addChild(mc_mycursor);

You can do this in the constructor or at least before you try to modify properties.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.