Can you post some sample code you were talking about so that it will be clear..?
some of the code like this:
//part of the code
private function creationcomplete():void
contentContainer.mouseChirldren = false;
contentContainer.mouseEnabled = false;
contentContainer.tf. = false;
<container:ContentContainer id="contentContainer" width="200" height="100"/>
public class ContentContainer extends UIComponent
public var tf:TextField;
public function ContentContainer():void
tf = new TextField();
textField.text = "WhatEVER";
How can I make the button("mybtn") can be click when the textField is on top of it? It seems like it's not the matter of the textFleld, a textFlow in the UIComponent is also have the problem.
Thanks for reply.
I'm still waitting.
1 person found this helpful
Why do u want to display text on the button instead you can assign the x and y positions to the textField and add it around the button instead of giving the positions within the textField area..?
I have worked on the problem it seems the button is not clickable as the button is below the textField layer as the Z-Index of textField is higher than that of button.
That's just a example.
In my work , below the uicomponent there is a full Screen picture. It can be drag by mouse . But when it is below the textField ,it can't be reached.
When there is a lable in a Group ,just set mouseChirldren and mouseEnabled to false, the element below the Group can be Reached.No matter how it's z-index is.
Yes it is working perfectly ....thanks for sharing the answer....:)
Thanks for your reply,and i still want to find out what's happening in the uicomponent.
I put an mx:Label over an mx:Button and set the label's
mouseChildren/mouseEnabled = false and the button still got clicked. If you
try that do you see the same results?
yes，it should be. When you set mouseChildren/mouseEnabled = false,the lable is not interactive,and the button can receive your mouseEvent as if the lable isn't there.
You also can try putting the lable in a group,and set the group's mouseChildren/mouseEnabled = false,and the button under the group.You don't have to set the lable's mouseChildren/mouseEnabled = false,cause the group's mouseChildren=false make all his children can't interactive.
But when in the uicomponent ,it dosen't work.
I think i make some mistake somewhere ,and it has nothing to do with the uicomponent.
I try some code like this:
protected function application_creationCompleteHandler(event:FlexEvent):void
var tf1:TextField = new TextField();
tf1.htmlText = "<a href='no'><u>11111111111111111111111</u></a>";
tf1.x = 50;
tf1.y = 100;
var tf2:TextField = new TextField();
var fm2:TextFormat = new TextFormat();
fm2.size = 40;
tf2.width = 200;
tf2.htmlText = "<a href='no'><u>222222222222222222222222222222222</u></a>";
tf2.x = 10;
tf2.y = 80;
var textFlow:TextFlow = new TextFlow();
var controller:ContainerController = new ContainerController(uc3,500,500);
var tfp:ParagraphElement = new ParagraphElement();
var sp:SpanElement = new SpanElement();
sp.text = "3333333333333333333333333333333333333333";
sp.fontSize = 20;
var linke:LinkElement = new LinkElement();
linke.href = "gasd";
<mx:UIComponent id="uc1" width="100%" height="100%" />
<mx:UIComponent id="uc3" width="100%" height="100%" mouseChildren="false" mouseEnabled="false" />
<mx:UIComponent id="uc2" width="100%" height="100%" mouseChildren="false" mouseEnabled="false" />
uc1 is the bottom and this code can prove that TextField in uc1 can be click,although uc2 and uc3 is over it.
Really sorry wasting your time.