# sharedObject & loadMovie problem

**URL:** <https://forum.kirupa.com/t/sharedobject-loadmovie-problem/36910>\
**Category:** flash\
**Created:** [December 3, 2003, 11:29am UTC](https://forum.kirupa.com/t/sharedobject-loadmovie-problem/36910 "2003-12-03T11:29:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanmarco](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sanmarco](https://forum.kirupa.com/u/sanmarco)\
**Post date:** [December 3, 2003, 11:29am UTC](https://forum.kirupa.com/t/sharedobject-loadmovie-problem/36910/1 "2003-12-03T11:29:27Z")

</div>

I use “sharedObject “ to load a different “swf” at each page loading. It works properly on my computer but not all on the server. In fact I made three “swf”, the first one imbeds the code and, according to the “Cookie”, loads one of the two other animations. Please take a look at my code and if you have any idea don’t hesitate, let me know. It is quite urgent. Thanks for your help![AS]choix = sharedObject.getLocal(“cookianim”);  
index = choix.data.vindex;  
trace("Start index= "+index);  
if (index == “” || index == “undifined”) {  
loadMovie(“banner3.swf”, \_root);  
choix.data.vindex = “3”;  
choix.flush();  
index = choix.data.vindex;

```
} else if (index == "3") {
	choix.data.vindex = "2";
	choix.flush();
	index = choix.data.vindex;
} else {
	choix.data.vindex = "3";
	choix.flush();
	index = choix.data.vindex;
}
anim = "banner"+index+".swf";
index = choix.data.vindex;
getURL("javascript:alert('ok')");
loadMovie(anim, _root);

```

stop();[/AS]
