2010-11-21 21 views

cevap

0

Doğrudan onu hedefleyemedim, böylece bir BorderContainer uygulamasında sardım ve bu da hile yaptı. İsterseniz tek istediğiniz bir BorderContainer kullanabilirsiniz, eğer renk ve hedefleyebileceğiniz bir kutu.

<?xml version="1.0" encoding="utf-8"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:s="library://ns.adobe.com/flex/spark" 
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()"> 

    <fx:Script> 
     <![CDATA[ 
      import mx.controls.Alert; 

      public function init():void{ 

       myBox.addEventListener(MouseEvent.MOUSE_OVER, changeColor); 

      } 

      public function changeColor(e:MouseEvent):void 
      { 
       myFill.color = 0xFFFF00; 
      } 


     ]]> 
    </fx:Script> 

    <s:states> 

    </s:states> 

    <fx:Declarations> 
     <!-- Place non-visual elements (e.g., services, value objects) here --> 
     <s:SolidColor id="myFill" color="0xFF0000" /> 
     <s:SolidColorStroke id="myStroke" color="0x000000" weight="2" /> 
    </fx:Declarations> 

    <s:BorderContainer id="myBox" >  
     <s:Rect width="200" height="200" fill="{myFill}" stroke="{myStroke}" id="box1" /> 
    </s:BorderContainer> 



</s:Application> 
+0

Cevabınız için teşekkür ederiz. Bunun üzerinde çalışıyorum kendime aittir, ancak uygulamanıza yüklediğimde artık düzgün çalışmıyor. Kullanıyorum \t \t ve bunun içindekileri paketleyin. kutu benim ikinci sekmemde ve dinleyicinin çalışma şeklini etkileyip etkilemediğini merak etti mi? – Mrcosgrove

+0

boşver, şimdi çalışıyorum, teşekkürler! – Mrcosgrove

İlgili konular