How do you address a named instance of a movieclip from the class file of the movieclip?
I have a movieclip instance named 'placeholder' o开发者_运维问答n 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?
Just use the script:
placeholder.alpha = someValue;
From script? You could do:
var placeholderClip:MovieClip = getChildByName("placeholder") as MovieClip;
and then access the alpha property on the movie clip variable.
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.
精彩评论