Flash as3时间轴动画存储值

问题描述 投票:0回答:1

我在动画的第20帧上设置了一个值

var final_answer = hundreds.text+tens.text+units.text;
var mySharedObject:SharedObject = SharedObject.getLocal("/");

我想在第40帧上访问它,但出现以下错误

场景1,“动作”层,框架210,第5行1120:访问未定义的属性mySharedObject。

I have also tried to use a normal variable - is there anyway to store a variable in what is effectively a cookie between frames?
actionscript-3 flash variables shared-objects
1个回答
0
投票

我建议您使用文档类,但是如果您不想在第一帧中全部处理,可以使用addFrameScript

addFrameScript(4,onFrame5);

function onFrame5():void{
    trace('current frame is 5');
}
© www.soinside.com 2019 - 2024. All rights reserved.