"onclick" doesn't work on layer type="container"

  • Hey.

    I have four <layer> within on <layer type ="container">. When I assigned an action "onclick" to one of the <layer> it work fine. But when I assigned the very same action "onclick" on the root element <layer type="container">, then nothing happend. Why is it so ? How can I assign an action to the <layer type="container"> ?

    Here is the code:


  • Oh shit, the code is messed up when I paste it here. In Sublime Text 3 it look good. Do you know if there is a way to "clean" the code with Sublime Text 3 ? Edit -> Line -> Indent doens't work so well.

  • Hi,

    layers "cross", "arrows", "mouse" are within layer "explications" type="container" such as:

    Code
    <layer name="explications" type="container">
    
    
    <layer name="cross"/>
    <layer name="arrows"/>
    <layer name="mouse"/>
    
    
    </layer>

    ah yea right, with bgcaputre="true" it's working when I click on the background. But I was expecting it to have an effect on the container + the layer which are insides. But it doesn't work so ?

  • But I would that the action happen to the container + everything which is in the container. Is copy / past this onclick action to every element in the container the only way to do so ? or is there an easier / cleaner way ?

  • Thank you spelican. That's what I was looking for.

    I have one container with layers inside. I wanted that when the user click anywhere on the container, the container disappear. Thanks to you it's working now. *thumbsup*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!