loop over the children of a parent layer

  • Hi,

    How can you loop through all the children of a given parent. I tried this to no avail

    Code
    for(set(i, 0), i LT layer[text_links].layer.count, inc(i), 
    				showlog();
                                   trace(i);
    			);

    this being the block:

    Code
    <layer name="text_links" type="container" keep="true" zorder="2" align="topleft" width="10000" height="100" x="10" style="gui_fade_style">
    			<layer name="text_link_1" active="true" style="text_link_style" html="[p]HOME[/p]" align="topleft" x="250" y="5" width="70" onclick="text_link_activate(); text_popup_lightbox_open('link 1')" />
    			<layer name="text_link_2" background="false" style="text_link_style" html="[p]ABOUT THE PROJECT[/p]" align="topleft" x="330" y="5" width="180" onclick="text_link_activate(); text_popup_lightbox_open('link 1')" />
    			<layer name="text_link_3" background="false" style="text_link_style" html="[p]CONTACT[/p]" align="topleft" x="520" y="5" width="110" onclick="text_link_activate(); text_popup_lightbox_open('link 1')" />
    	   </layer>
  • Yeah but then I have to loop every plugin, instead of a small group, like this:

    Code
    for(set(i, 0), i LT layer.count, inc(i), 
    				if(layer[get(i)].parent == text_links,
    					set(layer[get(i)].active, false);
    				)
    			);

    If you have lot's of plugins, it will take a small delay.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!