チェンジセット 3854

差分発生行の前後
無視リスト:
コミット日時:
2010/04/25 00:45:26 (3 年前)
コミッタ:
hkrn
ログメッセージ:

gunyarapaint.as3proj

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/branches/gunyarapaint/air/.actionScriptProperties

    r3646 r3854  
    1818  </compiler> 
    1919  <applications> 
     20    <application path="ParserDelegate.mxml"> 
     21      <airExcludes/> 
     22    </application> 
    2023    <application path="ApplicationDelegate.mxml"> 
    2124      <airExcludes/> 
    2225    </application> 
    2326    <application path="PlayerDelegate.mxml"> 
     27      <airExcludes/> 
     28    </application> 
     29    <application path="PlayerDelegate2.mxml"> 
    2430      <airExcludes/> 
    2531    </application> 
  • as3/gunyarapaint/branches/gunyarapaint/air/src/PlayerDelegate.mxml

    r3686 r3854  
    2727            import mx.utils.Base64Decoder; 
    2828             
     29            import org.libspark.gunyarapaint.framework.LayerBitmapCollection; 
    2930            import org.libspark.gunyarapaint.framework.Painter; 
    3031            import org.libspark.gunyarapaint.framework.Player; 
     32            import org.libspark.gunyarapaint.framework.commands.ICommand; 
    3133            import org.libspark.gunyarapaint.framework.events.CommandEvent; 
    3234            import org.libspark.gunyarapaint.framework.events.PlayerEvent; 
     35            import org.libspark.gunyarapaint.framework.events.UndoEvent; 
    3336             
    3437            import spark.core.SpriteVisualElement; 
     
    3942                var config:File = appDir.resolvePath("config.xml"); 
    4043                var stream:FileStream = new FileStream(); 
    41                 m_commands = new Vector.<uint>(64, true); 
     44                m_commands = new Vector.<uint>(32, true); 
     45                m_commandStrings = new Vector.<String>(); 
    4246                try { 
    4347                    stream.open(config, FileMode.READ); 
     
    139143            private function onParse(event:CommandEvent):void 
    140144            { 
    141                 m_commands[event.command.commandID] = event.command.commandID; 
     145                var command:ICommand = event.command; 
     146                m_commands[command.commandID] = command.commandID; 
     147                m_commandStrings.push(command); 
    142148            } 
    143149             
     
    179185                currentState = "finished"; 
    180186                saveImage(); 
     187                saveLogs(); 
    181188            } 
    182189             
     
    209216                } 
    210217                catch (e:Error) { 
    211                     trace(e); 
     218                    Alert.show(e.getStackTrace(), e.message); 
    212219                } 
    213220                finally { 
    214221                    bitmap.dispose(); 
     222                    stream.close(); 
     223                } 
     224            } 
     225             
     226            private function saveLogs():void 
     227            { 
     228                var file:File = File.userDirectory.resolvePath(".oekaki/log_player_delegate.txt"); 
     229                var stream:FileStream = new FileStream(); 
     230                try { 
     231                    var len:uint = m_commandStrings.length; 
     232                    stream.open(file, FileMode.WRITE); 
     233                    for (var i:uint = 0; i < len; i++) { 
     234                        stream.writeUTFBytes(m_commandStrings[i] + "\n"); 
     235                    } 
     236                } 
     237                catch (e:Error) { 
     238                    Alert.show(e.getStackTrace(), e.message); 
     239                } 
     240                finally { 
    215241                    stream.close(); 
    216242                } 
     
    239265            private var m_params:XMLList; 
    240266            private var m_commands:Vector.<uint>; 
     267            private var m_commandStrings:Vector.<String>; 
    241268        ]]> 
    242269    </fx:Script>