topical media & game development

talk show tell print

explore-ximpel-debug.mx

explore-ximpel-debug.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
   xmlns:ximpel="net.ximpel.player.*" xmlns:ae="*"
   layout="vertical" initialize="send()" creationComplete="finalize()" width="870" height="710"
   paddingLeft="0" paddingTop="0" paddingBottom="0" paddingRight="0" backgroundColor="#000000">
  
  <mx:Style source="explore-ximpel-style-obsidian.css"/>
  
  <mx:Script>
   <![CDATA[
     import mx.events.*;
     import mx.managers.SystemManager;
     import net.ximpel.events.*;
     import net.ximpel.player.*;
     import flash.events.FullScreenEvent;
     import mx.controls.Alert;
     import mx.rpc.events.ResultEvent;
  
  

trace(s)


     public var count:Number = 0;
     public function trace(m:String) : void {
                     count++;
                     status.text += "[" + count + "] " + m ;
                     if (count % 5 == 0) status.text += "\n";
                     }
  

start -- send


     public function send() : void { 
         trace("tracing");
         player.trace = trace;
         player.config = "explore-ximpel-config.xml";
         player.send();
         }
         
  

resize -- must be in display


     public function resize(fx:Number = 1.0, fy:Number = -1.0): Number {
     if (fy == -1.0) fy = fx;
     var x:Number = this.width / player.width;
     var y:Number = this.height / player.height;
     var s:Number = 1.0;
     if (x > y) s = y; else s = x;
     player.scaleX = s * fx; player.scaleY = s * fy;
     return s;
     } 
  
  

init -- empty


     private function init():void {
     trace("app");
     }
     
     
  

finalize -- when initialized


     private function finalize():void {
     trace("finished");
     player.image = "assets/@logo.jpg";
     resize(1.0,0.5);
     player.ximpel.start();
     player.index=2;
     }
  ]]>
  </mx:Script>
  
  

display -- with debug


  <mx:VBox>
  <ae:explore_ximpel_net_ximpel_player_Display id="player" />
  <mx:TextArea width="100%" height="200" id="status"  text=" starting ... "  />
  </mx:VBox>
  </mx:Application>
  


(C) Æliens 27/08/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.