用于桌面应用程序xml的闪存中的AS3简单保存功能

时间:2013-12-19 16:10:27

标签: xml actionscript-3 flash restore savechanges

我正在flash中制作一个基本的拖放应用程序。我希望将当前闪存屏幕中的所有内容保存到XML文件中。 (或任何其他直接的解决方案)我应该怎么做?

我希望鼠标单击时可以使用简单的保存功能,这样当您点击“保存”时,所有当前排列都会保存在某处,并且当玩家点击“恢复”时就可以重新加载。

谢谢大家。 (P.S我是AS3的设计师和新手,我研究过AS2)

stop();

Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);
function follow(evt:MouseEvent){
    tweezer_cur.x = mouseX;
    tweezer_cur.y = mouseY;
}

//Resetter btn ---------------------

reset_btn.addEventListener(MouseEvent.CLICK, startover);

function startover(event:MouseEvent):void
 {
 gotoAndPlay(1);
 }

//------------------------------ fullscreen
function setFullScreen():void {
if (stage.displayState== "normal") {
stage.displayState="fullScreen";
stage.scaleMode = StageScaleMode.NO_SCALE;
} else {
stage.displayState="normal";
}
}

fullbtn.addEventListener(MouseEvent.CLICK, goFull); 
    // btn declared - - - - - - - - 

    function goFull(event:MouseEvent):void {
 setFullScreen();
 };

 //---------------------------- print project



printme_btn.addEventListener(MouseEvent.CLICK, startPrintJobHandler, false, 0, true);

    function startPrintJobHandler(event:MouseEvent):void
    {
     var printJob:PrintJob = new PrintJob();
     printJob.start()

     var printJobOptions:PrintJobOptions = new PrintJobOptions(); 
     printJobOptions.printAsBitmap = true; 

     printJob.addPage(artworkContainer, null, printJobOptions);

     printJob.send();
 }

 //--- all the draggables will live here
dragme.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
dragme.addEventListener(MouseEvent.MOUSE_UP, dropObject);

function pickupObject(event:MouseEvent):void {
event.target.startDrag(true);
}
 function dropObject(event:MouseEvent):void {
 event.target.stopDrag();
}

0 个答案:

没有答案