2013-09-06 2 views
0

<s:TextInput><s:Label>으로 오버레이하려고합니다. 레이블은 클릭시 표시 = false가되어야합니다. 문제는 TextInput 위의 레이블을 클릭하면 TextInput이 활성화되고 레이블 클릭 이벤트가 무시된다는 것입니다.<s:TextInput> ~ <s:label>

깊이 설정을 조정하려했지만 아무 소용이 없었습니다. 나는 또한 event.PreventDefault()을 사용하려고했지만 어느 쪽도 도움이되지 않았다.

거의 라벨이 투명하게 보입니다.

누군가가 나를 도울 수 있기를 바랍니다.

는 업데이트 :

이 코드는 문제를 보여줍니다.

<?xml version="1.0" encoding="utf-8"?> 
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"> 
    <fx:Declarations> 
     <!-- Place non-visual elements (e.g., services, value objects) here --> 
    </fx:Declarations> 
    <s:Label depth="1" width="200" backgroundColor="0xFFFFFF"> 
    Long boring text repeated a multiple of times. Long boring text repeated a multiple of times.Long boring text repeated a multiple of times. 
    </s:Label> 
    <s:TextInput> 

    </s:TextInput> 

</s:View> 
+3

[prompt] (http://help.adobe.com/ko_KR/flex/using/WS19f279b149e7481c-177b1c712d80a315e7-8000.html) 속성을 사용하여 동일한 결과를 얻을 수 있습니까? – splash

+0

문제를 해결하기 위해 두 구성 요소의 이벤트를 처리 할 필요가 없습니다. TextInput이 이벤트를 올바르게 관리하고 가시성을 변경하는 경우 레이블의 "visible"속성을 다음과 같이 설정할 수 있습니다. visible = {! myTextInput.visible} – Anton

+0

@splash에 동의합니다. 이미 내장 된 기능을 다시 만들려고합니다. – RIAstar

답변

0

텍스트 입력이 mxml에서 더 아래쪽에 있기 때문에 라벨이 맨 위에 놓이기 때문에 1을 결합하십시오. 2, 구성 요소에는 mouseEnabled, mouseEnabledWhereTransparent, childrenMouseEnabled 등과 같은 적절한 속성이 있습니다. 클릭 할 수 없도록하려는 구성 요소에는 false를 설정하고 mouseEnabled는 이벤트 처리기에서 교체 할 수 있습니다.