You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Rylee

Beginner

  • "Rylee" started this thread

Posts: 9

Location: Dallas, TX

Occupation: Developer for Devio, LLC

  • Send private message

1

Thursday, October 30th 2014, 8:01pm

How are indices determined in the flash viewer?

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.

Source code

1
2
3
4
5
6
7
8
<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?
Rylee Fowler
Full Stack Developer, Devio, LLC.

2

Friday, October 31st 2014, 9:31am

Hi,

the order depends on the xml parser, but normally they should be parsed top-to-down...

Btw - regarding 'it works in HTML5 viewer' - when saying that, please test ALL browsers - e.g. so far I know the xml parser of the IE browser also parses xml elements (at xml attributes) in a random order.

Directly interating over <layer> child elements is currently not possible.

Best regards,
Klaus

Rylee

Beginner

  • "Rylee" started this thread

Posts: 9

Location: Dallas, TX

Occupation: Developer for Devio, LLC

  • Send private message

3

Friday, October 31st 2014, 4:06pm

Hey,

Thanks Klaus. I re-implemented my solution in a non-parser-reliant method. I realize that it's no fault of krpano, but instead of the browser creators XML parser implementations.
Rylee Fowler
Full Stack Developer, Devio, LLC.