Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 尽管收到要更新的消息,ehaves仍然保持相同。该接口也有点冻结,所以我猜它是阻塞的,但不确定如何执行?我还尝试了一个mx:标签,其中我只显示了百分比,它的行为相同,尽管接收到要更新的消息。接口也有点冻结,所以我猜它是阻塞的,但不知道怎么做? <mx_Apache Flex_Actionscript 3_Air - Fatal编程技术网

Apache flex 尽管收到要更新的消息,ehaves仍然保持相同。该接口也有点冻结,所以我猜它是阻塞的,但不确定如何执行?我还尝试了一个mx:标签,其中我只显示了百分比,它的行为相同,尽管接收到要更新的消息。接口也有点冻结,所以我猜它是阻塞的,但不知道怎么做? <mx

Apache flex 尽管收到要更新的消息,ehaves仍然保持相同。该接口也有点冻结,所以我猜它是阻塞的,但不确定如何执行?我还尝试了一个mx:标签,其中我只显示了百分比,它的行为相同,尽管接收到要更新的消息。接口也有点冻结,所以我猜它是阻塞的,但不知道怎么做? <mx,apache-flex,actionscript-3,air,Apache Flex,Actionscript 3,Air,尽管收到要更新的消息,ehaves仍然保持相同。该接口也有点冻结,所以我猜它是阻塞的,但不确定如何执行?我还尝试了一个mx:标签,其中我只显示了百分比,它的行为相同,尽管接收到要更新的消息。接口也有点冻结,所以我猜它是阻塞的,但不知道怎么做? <mx:ProgressBar id="appProgress" mode="manual" width="300" label="{appProgressMsg}" minimum="0" maximum="100"/> public fu


尽管收到要更新的消息,ehaves仍然保持相同。该接口也有点冻结,所以我猜它是阻塞的,但不确定如何执行?我还尝试了一个mx:标签,其中我只显示了百分比,它的行为相同,尽管接收到要更新的消息。接口也有点冻结,所以我猜它是阻塞的,但不知道怎么做?
<mx:ProgressBar id="appProgress" mode="manual" width="300" label="{appProgressMsg}" minimum="0" maximum="100"/>
public function incProgress(e:TEvent):void {
    var p:uint = Math.floor(e.data.number / e.data.total * 100);
    trace("Setting Perc." + p);
    appProgress.setProgress(p, 100);
}
public function setApplicationProgressStep(e:TEvent):void {
    trace("Setting step:" + e.data);
    appProgressMsg = e.data;
}
public function updateDatabase(result:Object):void {
    var total:int = 0;
    var i:int = 0;
    var r:SQLResult;
    trace("updateDatabase called.");
    for each (var table:XML in this.queries.elements("table")) {
        var key:String = table.attribute("name");
        if (result[key]) {
            send(TEvent.UpdateApplicationProgressStep, "Updating " + key);
            i = 1;
            total = result[key].length;
            for each (var row:Object in result[key]) {
                //now, we need to see if we already have this record.
                send(TEvent.UpdateApplicationProgress, { number:i, total: total } );
                r = this.query("select * from " + key + " where server_id = '" + row.id + "'");
                if (r.data == null) {
                    //there is no entry with this id, make one.
                    this.query(table.insert, row);
                } else {
                    //it exists, so let's update.
                    this.update(key, row);
                }
                i++;
            }
        }

    }
}
updateDatabase called.
Setting step:Updating project
Setting Perc 25
Setting Perc 50
Setting Perc 75
Setting Perc 100
public function updateDatabase(result:Object, eindex:int = 0, sindex:int = 0 ):void {
    var total:int = 0;
    var i:int = 0;
    var j:int;
    var r:SQLResult;
    var table:XML;
    var key:String;
    var elems:XMLList = this.queries.elements("table");
    var startTime:int = getTimer();
    var row:Object;
    for (i = eindex; i < elems.length(); i++) {
        table = elems[i];
        key = table.attribute("name");
        if (!result[key])
            continue;
        total = result[key].length;
        send(TEvent.UpdateApplicationProgressStep, "Updating " + key);
        for (j = sindex; j < result[key].length; j++) {
            if (getTimer() - startTime > 100) {
                setTimeout(updateDatabase, 100, result, i, j);
                send(TEvent.UpdateApplicationProgress, { number:j, total: total } );
                return;
            }
            row = result[key][j];
            r = this.query("select * from " + key + " where server_id = '" + row.id + "'");
            if (r.data == null) {
                //there is no entry with this id, make one.
                this.query(table.insert, row,false);
            } else {
                //it exists, so let's update.
                this.update(key, row,false);
            }
        }
        send(TEvent.UpdateApplicationProgress, { number:1, total: 1 } );
    }
}
function doWork(arg1:Obj, arg2:Obj, start:int=0) {
   var startTime = getTimer(); // store starting time
   for(i=start; i<length; i++) {
     if(getTimer() - startTime > 100) { // see if we've been working too long
        trace("Current progress: "+(i/length * 100)+"%");
        updateProgress( i / length );
        setTimeout(doWork, 100, arg1, arg2, i); // schedule more work to be done
        return; // stop current loop
     }
     trace("Working on item "+i);
     // processing here
   }
   trace("All work done");
}

doWork(data1, data2); // start the work
function doWork(arg1:int, arg2:int, start:int=0) {
    var startTime = getTimer(); // store starting time
    for(var i:int=start; i<arg2; i++) {
        if(getTimer() - startTime > 100 ) { // see if we've been working too long
          trace("Current progress: "+(i/arg2 * 100)+"%");
          setTimeout(doWork, 100, i, arg2, i); // schedule more work to be done
          return; // stop current loop
      }
      trace("Working on item "+i);
      dispatchEvent(new progressMadeEvent("incrementChange",i,arg2))
      var dir:String = copyRes[i].nativePath.toString().split(OSSep).pop()
    copyRes[i].copyTo(appStore.resolvePath(dir)) // copies dir from DVD to appStorageDir
    }
    trace("All work done");
}