Note that there are some explanatory texts on larger screens.

plurals
  1. PORe-enable buttons in as3
    primarykey
    data
    text
    <p>Below is my code for buttons the problem I facing is that once button is clicked it wont work again after click of next button. I want to enable the previous clicked button. I hope an expert can help me here.</p> <pre><code>pages.gotoAndStop("home"); // list of button instance names var buttonsss:Array = [home, menudown.about, menudown.portfolio, menudown.clients, menudown.pricing, menudown.contact]; for each ( var mc:MovieClip in buttonsss) { mc.buttonMode = true; mc.mouseChildren = false; mc.addEventListener(MouseEvent.MOUSE_UP, onClick, false, 0, true); mc.addEventListener(MouseEvent.ROLL_OVER, rolloverEffect, false, 0, true); mc.addEventListener(MouseEvent.ROLL_OUT, rolloutEffect, false, 0, true); } function onClick(e:MouseEvent):void { pages.gotoAndStop(e.target.name); TweenLite.to(e.currentTarget,2,{tint:0xFF0000, ease:Strong.easeOut}); var myTween:Tween = new Tween(pages, "alpha", Strong.easeOut, 0, 1, 2, true); e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, rolloutEffect);//disable the roll out effect e.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, onClick);//disable the roll out effect e.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, rolloverEffect);//disable the roll out effect } function rolloverEffect(e:MouseEvent):void{ TweenLite.to(e.currentTarget,2,{tint:0x000000, ease:Strong.easeOut}); } function rolloutEffect(e:MouseEvent):void{ //should change tint to null just when its enabled, but its changing always (enabled or disabled) TweenLite.to(e.currentTarget,2,{tint:null , ease:Strong.easeOut}); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload