topical media & game development

talk show tell print

#graphic-player-10-cube-be-nascom-flash10-tests-controls-CubeShadeMaterialToggle.mx

#graphic-player-10-cube-be-nascom-flash10-tests-controls-CubeShadeMaterialToggle.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")]
                  [Event(name="glow_change", type="flash.events.Event")]
          </mx:Metadata>
  
          <mx:Script>
                  <![CDATA[
                          
                          public static const USE_BITMAP_MATERIAL:String="useBitmapMaterial";
                          public static const USE_COLOR_MATERIAL:String="useColorMaterial";
                          
                          public static const GLOW_CHANGE:String="glow_change";
                          
                          protected function handleMaterialChange(e:Event):void{
                                  switch(e.currentTarget.selectedValue){
                                          case "color":
                                                  dispatchEvent(new Event(USE_COLOR_MATERIAL));
                                                  break;
                                          case "bitmap":
                                                  dispatchEvent(new Event(USE_BITMAP_MATERIAL));
                                                  break;
                                  }
                          }
                          
                          protected function updateGlow():void{
                                  
                          }
                          
                  ]]>
          </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="bitmap" value="bitmap" 
              label="bitmap material" width="150" />
              
          <mx:VRule height="20" />
  
          <mx:CheckBox id="glow_cb" label="add glow:" change="dispatchEvent(new Event('glow_change'))" />
          
  </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.