Solved

Flex: problem with z-index

Posted on 2007-03-28
3
3,531 Views
Last Modified: 2009-12-01
I have a problem setting the z-index in Flex.

This is my main file:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:v="components.*">
<mx:Form id="indiForm" width="100%">
      <mx:FormItem label="First field" required="true">
          <v:SuggestionBox id="indi_address2" width="200"/>
      </mx:FormItem>
      <mx:FormItem label="Second field" required="true">
          <mx:TextInput id="xxx" width="200"/>
      </mx:FormItem>
      <mx:FormItem label="Third field" required="true">
          <mx:TextInput id="yyy" width="200"/>
      </mx:FormItem>
</mx:Form>                  
</mx:Application>

And this is SuggestionBox.mxml (which sits in the components directory):

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:TextInput id="a" width="100%" keyUp="init();"/>
      <mx:DataGrid id="b" visible="false" showHeaders="false" includeInLayout="false" maxHeight="100" minHeight="15" >
            <mx:columns>
                  <mx:DataGridColumn dataField="col1"/>
                  <mx:DataGridColumn dataField="col2" visible="false"/>
            </mx:columns>
      </mx:DataGrid>
      <mx:Script>
            <![CDATA[
                  private function init():void {
                  b.y=a.y+a.height+1;
                  b.width=a.width;
                  parent.parent.setChildIndex(this.parent, parent.parent.numChildren - 1);
                  b.visible=true;
                  }
            ]]>
      </mx:Script>
</mx:Canvas>

What happens is that as soon as I start typing, the field moves below all other fields. What I want is that the suggestion-datagrid moves ON TOP of the other fields (a higher Z-index). What am I doing wrong?
0
Comment
Question by:WebDvlp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
maclema earned 250 total points
ID: 18839875
Try this:

parent.parent.setChildIndex(this.parent, parent.parent.numChildren);

- Matt
0
 
LVL 1

Assisted Solution

by:LadislavHajabacs
LadislavHajabacs earned 250 total points
ID: 21687176
use
parent.parent.setChildIndex(this.parent, 0); in the suggestonBox

I think  Form behaves like HBox  0 index  is the top most object (vertically)
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question