简体   繁体   中英

Multiple visibility outputs from a if statements adobe animate html5

Thank you for your time I have a large animation I am working on with several if statements with many outputs I join the outputs with & ampersand and it all works ok, but when i try to call the visibility of a movie clip it will not work, here is a simple one i wrote using three movie clips.

this.black_sw.addEventListener("click", fl_ClickToHide.bind(this));

function fl_ClickToHide() { if(this.black_mc. visible== true)(

this.black_mc.visible = false 

this.redball.visible = true
)
else if(this.black_mc. visible== false)

    (this.black_mc.visible = true

this.redball.visible = false)

}

This does not work console error if I add a "&" to join the statements also console error, deleting one of the (visible = ) conditions in each part, it works, why, I am stumped.

best regards peter

this.black_sw.addEventListener("click", fl_ClickToHide.bind(this));

function fl_ClickToHide()
{
    if (this.black_mc.visible)
    {
        this.black_mc.visible = false
        this.redball.visible = true
    }
    else
    {
        this.black_mc.visible = true
        this.redball.visible = false
    }


}

This should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM