dimanche 18 décembre 2016

Action Script 3 Visibility from a function

Here I have a simple Action Script 3 Code. tick1 is also a button and i defined its visibility to false at the start.

So What i want to happen is when I click the button, the tick to appear. What happens so far is it appears but disappear back instantly.

Also another question. Can I use a symbol other than a Button for tick1. If so how should I define it at the start.

Here is my code

import flash.events.MouseEvent;

    /*  */

    btnButter.addEventListener(MouseEvent.CLICK, butterHide);
    btnCoffee.addEventListener(MouseEvent.CLICK, coffeeHide);
    btnPflour.addEventListener(MouseEvent.CLICK, pFlourHide);


    var i:int = 0;
    tick1.visible = false;

    function butterHide (e:MouseEvent):void {

        //txtButter.visible = false
        btnButter.visible = false;
        tick1.visible = true;

    }

Aucun commentaire:

Enregistrer un commentaire