0

I want to make a simple pictures slideshow with Apache Royale. To simplify I have 2 <j:Image> in a <j:Group>. Something like this (but written dynamicaly in as3)

<j:Group>
    <j:Image src="1.jpg" id="im1"/>
    <j:Image src="2.jpg" id="im2"/>
</j:Group>

This would result of 2.jpg visible because im2 is after im1. Now I want to set position of im2 before im1. This would be the equivalent of setElementIndex of Flex. (I don't want to play with visible)

Is it possible ? How to do ?

Regards

Fred
  • 399
  • 3
  • 12
  • More of a general comment: if what you're after is porting a Flex app to Royale it might be worthwhile considering the emulation components. setElementIndex exists there as a stub, but is waiting for a proper implementation. – yishayw Oct 23 '19 at 07:06

2 Answers2

1

setElementIndex is not currently implemented in Royale. What we did in our app with a similar use case was to remove the element you want to move to the front and re-add it.

yishayw
  • 151
  • 2
0

I'm pretty sure that the following will work:

im2.parent.addElementAt(im2,0);

Have you tried it?

Harbs
  • 106
  • 5