チェンジセット 1099

差分発生行の前後
無視リスト:
コミット日時:
2008/08/27 18:16:35 (5 年前)
コミッタ:
tasuku
ログメッセージ:

r50@poppop (orig r49): tasuku | 2008-04-07 16:05:37 +0900
エラー処理周りを修正。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint.as

    r1098 r1099  
    152152  if (onPost) { 
    153153    onPost = false; 
    154     if (comm.getHttpStatus() == 202 || comm.getError()) { 
     154    if (comm.getErrorStr()) { 
    155155      // error 
     156      Alert.show(comm.getErrorStr(), ALERT_TITLE); 
     157      this.enabled = true; 
     158    } else if (comm.getStringData() != '') { 
    156159      Alert.show(comm.getStringData(), ALERT_TITLE); 
    157160      this.enabled = true; 
  • as3/gunyarapaint/trunk/gunyarapaint/src/gunyarapaint/Logger.as

    r1090 r1099  
    11package gunyarapaint 
    22{ 
     3  import flash.display.BitmapData; 
    34  import flash.errors.EOFError; 
    45  import flash.utils.ByteArray; 
    5   import flash.display.BitmapData; 
    66   
    77  public class Logger 
     
    1212     
    1313    private var log:ByteArray; 
     14     
     15    private var logCount:uint; 
    1416 
    1517    private var width:uint, height:uint; 
     
    139141        writeByte(ACTION_REDO); 
    140142        break; 
    141       } 
     143      default: 
     144        return; 
     145      } 
     146      logCount++; 
     147    } 
     148    public function getLogCount():uint { 
     149      return logCount; 
    142150    } 
    143151    // put byte data 
     
    264272      preX = 0; 
    265273      preY = 0; 
     274      logCount = 0; 
    266275    } 
    267276    public function compress():void { 
  • as3/gunyarapaint/trunk/nicopedia/gunyarapaint/Com.as

    r1090 r1099  
    2929    private var urlLoader:URLLoader; 
    3030    private var loader:Loader; 
    31     private var httpStatus:int; 
    3231     
    33     private var error:Boolean
     32    private var errorStr:String
    3433 
    3534    public function Com() 
     
    117116     
    118117    private function post(request:URLRequest):void { 
    119       error = false
     118      errorStr = null
    120119      urlLoader = new URLLoader(); 
    121120      urlLoader.dataFormat = URLLoaderDataFormat.BINARY; 
     
    138137     
    139138    private function configureListeners(dispatcher:IEventDispatcher):void { 
    140       dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, postHttpStatusHandler); 
     139      // dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, postHttpStatusHandler); 
    141140      dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, postSecurityErrorHandler); 
    142141      dispatcher.addEventListener(IOErrorEvent.IO_ERROR, postIOErrorHandler); 
     
    147146     
    148147    private function postSecurityErrorHandler(evt:SecurityErrorEvent):void { 
    149       error = true; 
    150       Alert.show(evt.text, 'セキュリティエラーが発生しました。'); 
     148      errorStr = 'セキュリティエラーが発生しました。\n詳細:' + evt.text; 
    151149      dispatchEvent(new Event('completeGetData')); 
    152150    } 
    153151    private function postIOErrorHandler(evt:IOErrorEvent):void { 
    154152      // TODO: not event based, see URLLoader help 
    155       error = true; 
    156       Alert.show(evt.text, 'ネットワークエラーが発生しました。'); 
     153      errorStr = 'ネットワークエラーが発生しました。\n詳細:' + evt.text; 
    157154      dispatchEvent(new Event('completeGetData')); 
    158155    } 
    159156    private function postOpenHandler(evt:Event):void { 
    160     } 
    161     private function postHttpStatusHandler(evt:HTTPStatusEvent):void { 
    162       dispatchEvent(new Event('httpStatus')); 
    163       httpStatus = evt.status; 
    164157    } 
    165158    private function postProgressHandler(evt:ProgressEvent):void { 
     
    178171      return loader.content; 
    179172    } 
    180     public function getHttpStatus():int { 
    181       return httpStatus; 
    182     } 
    183     public function getError():Boolean { 
    184       return error; 
     173    public function getErrorStr():String { 
     174      return errorStr; 
    185175    } 
    186176  } 
  • as3/gunyarapaint/trunk/picokakiko/src/picokakiko.as

    r1094 r1099  
    4949  if (onPost) { 
    5050    onPost = false; 
    51     if (comm.getHttpStatus() == 202 || comm.getError()) { 
     51    if (comm.getErrorStr()) { 
    5252      // error 
     53      Alert.show(comm.getErrorStr(), ALERT_TITLE); 
     54      postPicoButton.enabled = true; 
     55    } else if (comm.getStringData()) { 
    5356      Alert.show(comm.getStringData(), ALERT_TITLE); 
    54       postPicoButton.enabled = true;     
     57      postPicoButton.enabled = true; 
    5558    } else { 
    5659      // redirect 
  • as3/gunyarapaint/trunk/picokakiko/src/picoplayer.mxml

    r1092 r1099  
    33  xmlns:flmml="com.txt_nifty.sketch.flmml.*" 
    44  creationComplete="init()" 
    5   layout="absolute" width="309" height="43" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]" color="#222222"> 
    6   <mx:Button id="playButton" x="10" y="10" label="ピコ再生" width="73" enabled="false" color="#444444"/> 
    7   <mx:Button id="stopButton" x="91" y="10" label="ピコ停止" enabled="false"/> 
    8   <mx:Button id="postPicoButton" x="166" y="10" label="元ネタにしてピコカキコ" enabled="false"/> 
     5  layout="absolute" width="309" height="139" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]" color="#222222"> 
     6  <mx:Button id="playButton" x="10" y="40" label="ピコ再生" width="120" enabled="false" color="#444444" fontSize="20"/> 
     7  <mx:Button id="stopButton" x="180" y="40" label="ピコ停止" enabled="false" fontSize="20" width="119"/> 
     8  <mx:Button id="postPicoButton" x="41" y="94" label="元ネタにしてピコカキコ" enabled="false" fontSize="20"/> 
    99  <flmml:FlMML id="mml_player"/> 
    1010 
     
    7474  ]]> 
    7575  </mx:Script> 
     76  <mx:Label x="10" y="10" text="ピコカキコプレーヤ" fontSize="14"/> 
     77  <mx:Label x="203" y="14" text="ver.2008040701"/> 
    7678</mx:Application>