我希望有人可以提供一个简单的解决方案。 我试图通过将其存储为SharedObject来保存时间轴上的“标记”框架。
用户可以通过单击按钮在舞台上的各种不同背景之间切换 - 按钮1对应于背景1,背景2对应于btn 2,依此类推...... 作为参考,这些背景存储在子时间轴中。关于如何存储的任何提示..?
//// ---------------- WINDOW SWAPPER -------------------
this.but_one.btn_one.addEventListener(MouseEvent.CLICK, swapperslide);
function swapperslide(event:MouseEvent):void
{
this.caseSwapper.gotoAndStop("frametwo");
}
this.but_one.btn_two.addEventListener(MouseEvent.CLICK, swapperslidetwo);
function swapperslidetwo(event:MouseEvent):void
{
this.caseSwapper.gotoAndStop("framethree");
}
save_btn.addEventListener (MouseEvent.CLICK, clickersave);
// ---- saves -----------------------
function clickersave (e:MouseEvent):void {
mySO.data.myframe = timelineframe;
////mySO.data.my_y = bones_mc.y;
mySO.flush ();
}
由于
P.s影片剪辑上的帧也包含AS3 停止();
编辑代码更新-----------------------------
//SAVE FUNCTIONS ---------------------------------------
//---------------------------------------------------
//---------------------------------------------------
var mySO:SharedObject = SharedObject.getLocal("iDesign");
bones_mc.x = mySO.data.my_x;
bones_mc.y = mySO.data.my_y;
if (!mySO.data.my_y) {
bones_mc.x = 424;
bones_mc.y = 119;
}
//----
save_btn.addEventListener (MouseEvent.CLICK, clickersave);
function clickersave (e:MouseEvent):void {
mySO.data.my_x = bones_mc.x;
mySO.data.my_y = bones_mc.y;
mySO.data.mybut_x = btrfly_mc.x;
mySO.data.mybut_y = btrfly_mc.y;
mySO.data.mytig_x = tiger_mc.x;
mySO.data.mytig_y = tiger_mc.y;
mySO.data.mybow_x = pink_bow_mc.x;
mySO.data.mybow_y = pink_bow_mc.y;
mySO.data.myblkbow_y = pink_bow_mc.y;
mySO.data.myblkbow_x = pink_bow_mc.x;
// tears saved - - - - - - -
mySO.data.mytear_drop_mc_three_x = tear_drop_mc_three.x;
mySO.data.mytear_drop_mc_three_y = tear_drop_mc_three.y;
mySO.data.mytear_drop_mc_one_x = tear_drop_mc_one.x;
mySO.data.mytear_drop_mc_one_y = tear_drop_mc_one.y;
mySO.data.mytear_drop_mc_two_x = tear_drop_mc.x;
mySO.data.mytear_drop_mc_two_y = tear_drop_mc.y;
mySO.data.mytear_drop_mc_four_x = tear_drop_mc_four.x;
mySO.data.mytear_drop_mc_four_y = tear_drop_mc_four.y;
mySO.data.myframe = caseSwapper.currentFrame;
trace(caseSwapper.currentFrame)
mySO.flush ();
}
//caseSwapper.currentFrame = mySO.data.myframe;
tear_drop_mc_three.x = mySO.data.mytear_drop_mc_three_x;
tear_drop_mc_three.y = mySO.data.mytear_drop_mc_three_y;
答案 0 :(得分:1)
要存储当前帧,您需要使用currentFrame
属性。
mySO.data.myframe = caseSwapper.currentFrame;
答案 1 :(得分:0)
要在SharedObject中存储值,您必须先获得引用:
function clickersave (e:MouseEvent):void {
var mySo:SharedObject = SharedObject.getLocal("SomeName");
mySo.data["my_y"] = bones_mc.y;
mySo.flush();
}