PDA

View Full Version : [AS3] Change alpha property of button [from post]


v_gyku
09-07-2006, 10:36 AM
I am trying to change the alpha property of a button using actionscript 3.
I dont want to create external AS file. Can you guide me on this?


circle_mc.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
trace("You clicked the ball");
//circle_mc.startDrag();
//square_btn.visible=false;
//what should i write to change the alpha of square_btn?

}

senocular
09-07-2006, 11:19 AM
alpha is changed using the alpha property. Unlike AS1 and AS2, alpha is now measured in a decimal value from 0 to 1 where 0 is no alpha and 1 is 100% alpha.
square_btn.alpha=.5; // 50% alpha

You can reference these properties easily in the as3 language reference:
http://www.adobe.com/go/AS3LR

v_gyku
09-07-2006, 11:26 AM
Thanks! I got it in the livedocs. forgot to mention it.
I think i need some time to research. This is my very first day with AS3.

Thanks n sorry...


alpha is changed using the alpha property. Unlike AS1 and AS2, alpha is now measured in a decimal value from 0 to 1 where 0 is no alpha and 1 is 100% alpha.

ActionScript Code:
square_btn.alpha=.5; // 50% alpha






You can reference these properties easily in the as3 language reference:
http://www.adobe.com/go/AS3LR