2 Replies Latest reply on Feb 10, 2008 1:54 AM by tinylion_uk

    Specifying z-index

    monkeyden.com Level 1
      I have an ad rotator, which has images of varying sizes. When it changes to a larger image all the components below it shift down. How do I "pin" the ad rotator in the background so it won't affect the other components? Of course I could just force the size of the Canvas holding the ad rotator is in but I consider this a workaround. Having work in the HTML client, my first instinct is to specify a z-index in CSS but this doesn't seem to be working correctly. Thanks for any pointers.
        • 1. Re: Specifying z-index
          Ratsnackbar Level 2
          I believe you can set the index of the object to 0 in the display stack with something like this.

          this.parent.setChildIndex(child:DisplayObject,index:int);

          Not sure that will get you what you want but setting it to the lowest index (0 I think) should at least put it behind all other objects of that parent. If the object is in a view that is not set to Absolute though I think this will NOT have the effect you are looking for.

          • 2. Re: Specifying z-index
            tinylion_uk Level 2
            i'd use more than 1 canvas, all of the same size, in absolute, x & y at 0,0 or whatever

            obviously the below is pseudo code

            <canvas loayout absolute>

            <canvax x 0 y 0>
            all your adds
            </>

            <canvas x 0 y 0 no background colour>
            all your components
            </>

            </>

            this is just a canvas stack, what happens in the back canvas will not effexct anything in the overlaying canvas.

            i think. :)