Cap'nAhab
Cap'nAhab

Reputation: 163

How do you address a named instance of a movieclip from the class file of the movieclip?

I have a movieclip instance named 'placeholder' on the canvas, and I want to change the alpha of the named movieclip from it's class without effecting the alpha of all the movieclips of the same type. How would I specifically target the named movieclip instance that is on the canvas?

Upvotes: 0

Views: 145

Answers (3)

John Zhang
John Zhang

Reputation: 103

Just use the script:

placeholder.alpha = someValue;

Upvotes: 2

Mike Belotti
Mike Belotti

Reputation: 405

From script? You could do:

var placeholderClip:MovieClip = getChildByName("placeholder") as MovieClip;

and then access the alpha property on the movie clip variable.

Upvotes: 1

Marty
Marty

Reputation: 39466

Either on the timeline or within the class (if you've created on) of the parent / container for these MovieClips you could do:

placeholder.alpha = 0.5;

If they are placed straight onto the main timeline then you can do the same from the timeline your objects are placed on or within the document class.

Upvotes: 0

Related Questions