I have a function that iterates over the indices between two elements to automatically align them to a certain standard. This works deterministically in the HTML5 viewer -- that is to say, I always get the result I'm looking for in the HTML5 viewer. However, in the Flash viewer, the indices seem to be in a random order, so that two child elements will not have consecutive indices.
Example code follows.
Code
<layer name="main_sidebar" keep="true"
type="container"
> <!-- and other various positioning things... -->
<layer name="sub_tab_one" keep="true" style="my_tab_style" /> <!-- and other styling and positioning things -->
<layer name="sub_tab_two" keep="true" style="my_tab_style" />
<layer name="sub_tab_three" keep="true" style="my_tab_style" />
<!-- and so on... -->
</layer>
One would expect `layer[sub_tab_one].index`, `layer[sub_tab_two].index`, and `layer[sub_tab_three].index` to be consecutive, and they are in the HTML5 viewer. However, in the Flash viewer, the order of indices is unpredictable. Is there any way around this?
Alternatively, is there any easy way to iterate over the child elements of a layer?