topical media & game development 
  
 
 
 
 
  
    
    
  
#graphic-player-10-cube-be-nascom-flash10-tests-controls-CubeMaterialToggle.mx
#graphic-player-10-cube-be-nascom-flash10-tests-controls-CubeMaterialToggle.mx
[swf]
 
[flash]
 flex
  <?xml version="1.0" encoding="utf-8"?>
  <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
  
          <mx:Metadata>
                  [Event(name="useWireframeMaterial", type="flash.events.Event")]
                  [Event(name="useColorMaterial", type="flash.events.Event")]
          </mx:Metadata>
  
          <mx:Script>
                  <![CDATA[
                          
                          public static const USE_WIREFRAME_MATERIAL:String="useWireframeMaterial";
                          public static const USE_COLOR_MATERIAL:String="useColorMaterial";
                          
                          protected function handleMaterialChange(e:Event):void{
                                  switch(e.currentTarget.selectedValue){
                                          case "color":
                                                  dispatchEvent(new Event(USE_COLOR_MATERIAL));
                                                  break;
                                          case "wireframe":
                                                  dispatchEvent(new Event(USE_WIREFRAME_MATERIAL));
                                                  break;
                                  }
                          }
                          
                  ]]>
          </mx:Script>
  
                  <mx:RadioButtonGroup id="material_type" itemClick="handleMaterialChange(event);"/>
          <mx:RadioButton groupName="material_type" id="color" value="color" 
              label="color material" width="150" selected="true" />
          <mx:RadioButton groupName="material_type" id="wire_frame" value="wireframe" 
              label="wireframe material" width="150" />
              <!--
          <mx:RadioButton groupName="material_type" id="visa" value="Visa" 
              label="Visa" width="150" />
              -->
  </mx:HBox>
  
  
  
(C) Æliens 
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. 
In case of other copyright issues, contact the author.