//Away3D project using FlashDevelop
//Objects get placed onstage hidden, become visible, move to intermediate position then to final position
//Setup: puts them into position - already visible false
//First main append - added because it seemed to make things work right for first label
setupTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, 0, {x:intropos_x, y:intropos_y, z:intropos_z, rotationX:introrot_x, rotationY:introrot_y, rotationZ:introrot_z}));
mainTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, 0, { visible:false } ));
mainTimeline.addLabel("Step"+stepnumber, mainTimeline.duration); //This seems to pick up and add the next delay value
FlashConnect.trace(mainTimeline.duration);
//This adds delay before move and onStart makes visible and sets start color
mainTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, 0, {delay:beforedelayseconds, x:intropos_x, y:intropos_y, z:intropos_z, rotationX:introrot_x, rotationY:introrot_y, rotationZ:introrot_z, onStart:startcolor, onStartParams:[getobjid, stepnumber] }));
//First object has no intermediate pos, checkagain checks xml, problem: object picks up time in Not Equal statement!
if ( checkagain != "qq" ) {
mainTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, tointerseconds, {x:interpos_x, y:interpos_y, z:interpos_z, rotationX:interrot_x, rotationY:interrot_y, rotationZ:interrot_z}));
} else {
mainTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, tofinalseconds, {x:finalpos_x, y:finalpos_y, z:finalpos_z, rotationX:finalrot_x, rotationY:finalrot_y, rotationZ:finalrot_z, onComplete:changecolor, onCompleteParams:[stepnumber, getobjid]}));
}
mainTimeline.append(new TweenMax(array[getobjid].ObjectContainer3D, tofinalseconds, {x:finalpos_x, y:finalpos_y, z:finalpos_z, rotationX:finalrot_x, rotationY:finalrot_y, rotationZ:finalrot_z, onComplete:changecolor, onCompleteParams:[stepnumber, getobjid]}));
//Finish adding tweens - Loops 6 times
Button calls function-------------------------------------------------------------------------
private function stepprev(e:MouseEvent):void {
//var gettime
var getct:String = new String(mainTimeline.currentLabel);
//var lt:Number = mainTimeline.getLabelTime(getct);
//var getct:Number = mainTimeline.currentTime;
//var getlabelp:String = new String (mainTimeline.getLabelBefore(lt));
//var zz:Number = new Number(thestep);
//var newstep:Number = zz - 1;
//var makestring:String;
//makestring = String(newstep);
FlashConnect.trace(getct); //RETURNS NULL
var getlabelp:String = mainTimeline.getLabelBefore(mainTimeline.currentTime);
if (ppause == false) {
mainTimeline.gotoAndPlay(getlabelp);
}else {
mainTimeline.gotoAndStop("Step3"); //WORKS PROPERLY
}}