# Goto and Play won't take me where needed

**URL:** https://forum.kirupa.com/t/goto-and-play-wont-take-me-where-needed/279830
**Category:** flash
**Created:** [January 19, 2009, 8:03pm UTC](https://forum.kirupa.com/t/goto-and-play-wont-take-me-where-needed/279830 "2009-01-19T20:03:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![veninz](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@veninz](https://forum.kirupa.com/u/veninz)
#### Post date: [January 19, 2009, 8:03pm UTC](https://forum.kirupa.com/t/goto-and-play-wont-take-me-where-needed/279830/1 "2009-01-19T20:03:45Z")

</div>

hi, i have a flash animation which consits of images going up and down and text (done in cs4). it is for a website and i want the animation to continue playing where it left if the link on the page is changed (the animation is on every page) so i used this code:

import flash.net.SharedObject;  
var mySo:SharedObject;

mySo = SharedObject.getLocal(“lifebanner”);  
if (mySo.data.tst\>1) {  
this.gotoAndPlay(mySo.data.tst);  
}

this.addEventListener(Event.ENTER\_FRAME, onEnter);  
function onEnter(e:Event):void {  
mySo.data.tst = currentFrame;

}

it works fine with the 1st 240 frames, where there’s 2 sets of text and 2 images. By works fine i mean if i switch it of and on again the animation doesn’t start over but continues from where i switched it off. Now my problem is that on frame 240 is another image going up and if i close the movie anywhere after 240 it still starts at 240.

I checked the mySo.data.tst it works fine (picks up the number of frame) but for some reason it doesn’t play it, just jumps back to 240.

Please help, Thanks.
