Question

I was hoping someone could offer a simple solution. I am trying to save a 'labeled' frame on the timeline by storing it as a SharedObject.

The user can flip between various different backgrounds on the stage by clicking a button - button one corresponds to background one, background 2 corresponds to btn two and so on... For your reference these backgrounds are stored in a sub timeline in a movieClip. Any tips on how to get this to store..? I'm open to new theories as I'm not having a lot of success saving from the movieClip on the time line.

I have already posted a question similar to this but I was wandering if it was possible to store these frames in an array? Array1 = image1 Array2 = image2 and so making it easier to store. I'm guessing I would need to make a loadermodule to store these images on the stage as well.

Thanks

// 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;

CODE ADDED TO MAKE THE TIMELINE SAVE - - - - - - - - - -

// applied to the clickersave function 
mySO.data.myBgFrame = 2;
mySO.flush ();

}

if (mySO.data.myBgFrame){
    caseSwapper.gotoAndStop(mySO.data.myBgFrame);
}
Was it helpful?

Solution

Not sure I understood exactly what you mean, but if you use click on button1 for BG1, in the click function you could write:

mySO.myBgFrame = 1;
mySO.flush ();

and than, when you need to set the saved BG:

if (mySO.myBgFrame){
    bgMovieClip.gotoAndStop(mySO.myBgFrame);
}

Is this what you need?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top