`
vissul
  • 浏览: 190056 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

flex 菜单条

阅读更多

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:states>
  <mx:State name="index1">
   <mx:AddChild position="lastChild">
    <mx:VBox  id="myvbox1" x="{mymenubar.x}" y="{mymenubar.x + mymenubar.height}" width="{mymenubar.width}" height="248" backgroundAlpha="0.5" backgroundColor="#FFFFFF">
     
    </mx:VBox>
   </mx:AddChild>
  </mx:State>
  
  <mx:State name="index2">
     <mx:AddChild position="lastChild">
    <mx:VBox  id="myvbox2" x="{mymenubar.x}" y="{mymenubar.x + mymenubar.height}" width="{mymenubar.width}" height="248" backgroundAlpha="0.5" backgroundColor="#F5E31">
     
    </mx:VBox>
   </mx:AddChild>
  </mx:State>
  
  <mx:State name="index3">
     <mx:AddChild position="lastChild">
    <mx:VBox  id="myvbox3" x="{mymenubar.x}" y="{mymenubar.x + mymenubar.height}" width="{mymenubar.width}" height="248" backgroundAlpha="0.5" backgroundColor="#8DF531">
     
    </mx:VBox>
   </mx:AddChild>
  </mx:State>
  
  <mx:State name="index4">
     <mx:AddChild position="lastChild">
    <mx:VBox  id="myvbox4" x="{mymenubar.x}" y="{mymenubar.x + mymenubar.height}" width="{mymenubar.width}" height="248" backgroundAlpha="0.5" backgroundColor="#31F5E5">
     
    </mx:VBox>
   </mx:AddChild>
  </mx:State>
  
  <mx:State name="index5">
     <mx:AddChild position="lastChild">
    <mx:VBox  id="myvbox5" x="{mymenubar.x}" y="{mymenubar.x + mymenubar.height}" width="{mymenubar.width}" height="248" backgroundAlpha="0.5" backgroundColor="#D731F5">
     
    </mx:VBox>
   </mx:AddChild>
  </mx:State>
 </mx:states>
  
 <mx:XMLList xmlns="" id="menulist">
  <menuitem  id="menu1">
   <menuitem id="submenu1" type="radio" groupname="one">
   
  </menuitem>
  <menuitem id="submenu2" type="radio" groupname="one">
   
  </menuitem>
  </menuitem>
  <menuitem id="menu2">
   
  </menuitem>
  <menuitem id="menu3">
   
  </menuitem>
  <menuitem id="menu4">
   <menuitem id="submenu3" type="radio" groupname="two">
  </menuitem>
  <menuitem id="submenu4" type="radio" groupname="two" selected="true" >
   
  </menuitem>
  <menuitem id="submenu5" type="radio" groupname="two">
   
  </menuitem>
  </menuitem>
 </mx:XMLList>
 
 <mx:Script>
  <![CDATA[
   import mx.events.MenuEvent;
   private function menuClickHandle(e:MenuEvent):void{
    if(e.label == "submenu1"){
    currentState = "index1";
    }else if(e.label == "submenu2"){
    currentState = "index2";
    }else if(e.label == "submenu3"){
    currentState = "index3";
    }else if(e.label == "submenu4"){
    currentState = "index4";
    }else if(e.label == "submenu5"){
    currentState = "index5";
    }
   }
  ]]>
 </mx:Script>
 <mx:MenuBar dataProvider="{menulist}" id="mymenubar" labelField="@id" showRoot="false" width="293" horizontalCenter="0" y="24" change="menuClickHandle(event);">
  
 </mx:MenuBar>
    <mx:transitions>
  <mx:Transition id="myTransition1" fromState="*" toState="index1">
   <mx:Parallel target="{myvbox1}">
    <mx:WipeUp  duration="2000"/>
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
   </mx:Parallel>
  </mx:Transition>
   <mx:Transition id="myTransition2" fromState="*" toState="index2">
   <mx:Parallel target="{myvbox2}">
    <mx:WipeDown  duration="2000"/>
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
   </mx:Parallel>
  </mx:Transition>
   <mx:Transition id="myTransition3" fromState="*" toState="index3">
   <mx:Parallel target="{myvbox3}">
    <mx:WipeRight  duration="2000"/>
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
   </mx:Parallel>
  </mx:Transition>
   <mx:Transition id="myTransition5" fromState="*" toState="index5">
   <mx:Parallel target="{myvbox5}">
    <mx:WipeLeft  duration="2000"/>
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
   </mx:Parallel>
  </mx:Transition>
   <mx:Transition id="myTransition4" fromState="*" toState="index4">
   <mx:Parallel target="{myvbox4}">
    <mx:Blur blurXFrom="0" blurXTo="100" duration="2000"/>
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
    </mx:Parallel>
  </mx:Transition> 
 </mx:transitions>
</mx:WindowedApplication>

分享到:
评论
2 楼 kg_dogg 2010-03-29  
kg_dogg 写道
Severity and Description Path Resource Location Creation Time Id
Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'menu'. budingLab/src menu.mxml Unknown 1269833737808 1120

这是怎么回事
1 楼 kg_dogg 2010-03-29  
Severity and Description Path Resource Location Creation Time Id
Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'menu'. budingLab/src menu.mxml Unknown 1269833737808 1120

相关推荐

Global site tag (gtag.js) - Google Analytics