2012-04-20 50 views
0

我已經逐字清理了我可以找到的每個資源,以確定我遇到的問題的解決方案。基本上,我不能重新指定任何按鈕的x或y位置(通過源代碼或設計)。如果你們中的任何人都可以建議我如何解決這個問題,我將非常感激。謝謝。 :)重新定位Flex按鈕的問題

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*" 
    frameRate="999" 
    creationComplete="init();" 
    > 
    <mx:Style source="Whistle.css"/> 
    <!--local:whistle id="myWhistle"/--> 
     <mx:Label text="=" width="13" fontWeight="bold" fontSize="15"/> 
     <mx:Text text="{tempo_slider.value}" width="30"/> 

    <mx:Button id="stop" icon="@Embed(source='../assets/media-playback-stop.png')" 
     click="{if (playPause.selected) {player.stop();playPause.selected=false;}}"/> 
    <mx:Button id="playPause" width="40" 

       click="{if (playPause.selected) player.play(); else player.pause();}" 
       downIcon="@Embed(source='../assets/media-playback-pause.png')" labelPlacement="top" 
       overIcon="@Embed(source='../assets/media-playback-start.png')" 
       selectedDownIcon="@Embed(source='../assets/media-playback-start.png')" 
       selectedOverIcon="@Embed(source='../assets/media-playback-pause.png')" 
       selectedUpIcon="@Embed(source='../assets/media-playback-pause.png')" toggle="true" 
       upIcon="@Embed(source='../assets/media-playback-start.png')"/> 
    <mx:Button id="loop" toggle="true" 

     icon="@Embed(source='../assets/view-refresh.png')" 
     change="{player.loop=loop.selected;}"/> 

    <!--<mx:Label text="midiFileURL={midiFileURL}" />--> 

    <mx:Script> 
     <![CDATA[ 
      //[Bindable] 
      private var midiFileURL:String; 
      import mx.core.FlexGlobals; 
      import com.knet.Player; 
      private var player:Player; 
      private function init():void { 
       midiFileURL=FlexGlobals.topLevelApplication.parameters.midiFileURL; 
       //midiFileURL="http://www.reveeveille.net/audio/gavotte_yves_menez_0.mid"; 
       //midiFileURL="../assets/gavotte_yves_menez_0.mid"; 
       //midiFileURL="../assets/bwv806b.mid"; 
       //midiFileURL="../assets/gavotte_de_audiern.mid"; 
       //midiFileURL="../assets/an_alarch.mid"; 
       //midiFileURL="../assets/Another_Jig_Will_Do.mid"; 
       midiFileURL="../assets/bro_goz.mid"; 
       //midiFileURL="../assets/derobee_de_guingamp.mid"; 
       //midiFileURL="../assets/Evit_Farsal_waltz.mid"; 
       //midiFileURL="../assets/mtsofmourne.mid"; 
       //midiFileURL="../assets/andro_traditionnel_09.mid"; 
       player=new Player(/*myWhistle,*/tempo_slider, midiFileURL); 
      } 
     ]]> 
    </mx:Script> 
    </mx:Application> 
+0

你想要做些什麼來重新定位它們? – JeffryHouser 2012-04-20 19:32:45

+0

什麼。我試圖轉移x位置。和y。但沒有改變。 – Anonymous 2012-04-20 19:36:06

+0

設計模式自動將它們置於彼此之下(粉色虛線顯示)我想自由編輯它 – Anonymous 2012-04-20 19:42:41

回答

0

要麼使用佈局在應用標籤=「絕對」,或把一個畫布容器內部的按鈕,然後使用X位置他們,Y屬性。

當你不使用絕對或者使用像HBox VBox這樣的控件來設置x,y值時什麼也不做。

0

如果您未指定應用程序的佈局,則雙向默認爲「垂直」。所以在「垂直」佈局中,您不能將組件放置在期望的位置;要實現這一點,你需要指定應用程序佈局爲絕對的,所以它會工作。