Nested arrays and Tween. A Bug or a Feature?

  • Hi there!
    I'm working on some stuff and I have to efficietly parse children of Layers. Because I got a lot of layers and children, I decided to store the children nodes into a parent array instead of having a loop through all layers available. (That may be inconsistent, just tell me if you have better idea *wink* ).

    OK, to get you see, Here is the expected structure:

    Code
    <layer name="Parent">
       <layer name="Child0" />
       <layer name="Child1" />
    
    
    </laver>

    This structure is created by an action:

    This works like a charm.

    The point is that the "showSubItem" action acts correctly with a direct "show" command:

    Code
    <action name="showSubItem">
       for( set(i, 0), i LT subItems.count, inc(i),
    
    
      	set( subItems[get(i)].item.alpha, 1.0 );
      );
    </action>

    But when using a TWEEN command, it works ONLY for the items with index greater than 0... i.e. the first item (idx=0) does not show.

    Code
    <action name="showSubItem">
    for( set(i, 0), i LT subItems.count, inc(i),
       tween( subItems[get(i)].item.alpha, 1.0, 3.0 );
      );</action>


    Note that I found a workarround by modifying the index reference (saying it's a nonsense, as the index will ever be 0-N, but anyway, there is here a black-magic trick):


    I guess it is something about item-array naming convention or somewhat...

    Regards,

    Paul

    « Quidquid latine dictum sit, altum sonatur »
    Pentax stuff.

Jetzt mitmachen!

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