I'm trying to export data for sprite animation. I have several MovieClips in a stage and keyframes with different positons/angle to make an animation. When I try to write x,y data to a file I can't reach data outside of first frame.
function testWrite():void {
var fileRef:FileReference;
var txt:String;
var fr:int;
txt = "";
// 'Head' is the name one of MovieClips
for (fr = 0; fr < 4; fr++) {
txt += "frame: " + currentFrame + ", " + Head.x + "\n";
nextFrame();
Head.nextFrame();
}
fileRef = new FileReference();
fileRef.save(txt, "testExport.txt");
}
testWrite();
This is a function I'm using for it, but no matter if I use nextFrame() or gotoAndStop(x) it won't change frame. Both Head.x and Head.currentFrame stays the same.
Can anyone help me with this?