Copy link to clipboard
Copied
Hola.
Estoy iniciando en Adobe Animate, me surge una duda y no he podido encontrar solución.
¿Cómo se debe programar un botón para que active o desactive una capa en HTML5 Canvas?
Muchas gracias.
Hi.
You can, for example, access a symbol or layer and toggle its visibility.
...var that = this;
// advanced layers off
// you have to create a symbol and toggle its visibility
this.toggleSymbol.addEventListener('click', function() // toggleSymbol is the button's name
{
that.cover.visible = !that.cover.visible;
});
// OR
// advanced layers on
// when you use advanced layers, Animate turns layers into symbols
this.toggleLayer.addEventListener('click', function() // toggleLayer is the button's name
{
var
Copy link to clipboard
Copied
Hi.
You can, for example, access a symbol or layer and toggle its visibility.
var that = this;
// advanced layers off
// you have to create a symbol and toggle its visibility
this.toggleSymbol.addEventListener('click', function() // toggleSymbol is the button's name
{
that.cover.visible = !that.cover.visible;
});
// OR
// advanced layers on
// when you use advanced layers, Animate turns layers into symbols
this.toggleLayer.addEventListener('click', function() // toggleLayer is the button's name
{
var l = that.getChildByName("layer"); // "layer" is the name of the layer you want to change
l.visible = !l.visible;
});
I hope it helps.
Regards,
JC
Copy link to clipboard
Copied
Muchas gracias.
Me fue muy util tu ayuda.
Copy link to clipboard
Copied
De nada, meu amigo!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now