Canvas HTML5 Component Button Visibility Toggle
I need a Component Button (ui-button) to toggle the visibility of an instance, as opposed to a mc button instance.
This code works fine with a mc button instance, but is ignored by a Component Button with instance name Line_Toggle:
this.Line_Toggle.addEventListener("click", fl_ClickToHide_2.bind(this));
function fl_ClickToHide_2()
{
if (this.textbox2.visible == true) {
this.textbox2.visible = false;
}
else if (this.textbox2.visible == false){
this.textbox2.visible = true;
}
}
I added the action with the instance named Component Button selected, from the Code Snippets > Actions, to ensure that Animate would add the correct event code for an instance named, Component Button. This was in vain.
Any idea why that did not happen? Any thoughts on how to get this to function?
I appreciate all insight, thanks in advance.
