# swf#2 accessing SOL data entered in swf#1

**URL:** <https://forum.kirupa.com/t/swf-2-accessing-sol-data-entered-in-swf-1/634628>\
**Category:** flash\
**Created:** [May 16, 2016, 3:09pm UTC](https://forum.kirupa.com/t/swf-2-accessing-sol-data-entered-in-swf-1/634628 "2016-05-16T15:09:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhnh](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bhnh](https://forum.kirupa.com/u/bhnh)\
**Post date:** [May 16, 2016, 3:09pm UTC](https://forum.kirupa.com/t/swf-2-accessing-sol-data-entered-in-swf-1/634628/1 "2016-05-16T15:09:23Z")

</div>

OK, so I have two swf files. SWF#1 creates a local Shared Object and enters data. Code for SWF#1:  
var msg:String;  
var sol:SharedObject = SharedObject.getLocal(“SOLtest”);  
function saveData():void{  
msg = inputText.text;  
sol.data.msg = msg;  
sol.flush();  
sol.close();  
}  
I’d like to access the Shared Object data from SWF#2. I’ve tried  
var sol:SharedObject;  
sol = SharedObject.getLocal(“SOLtest”);

```
btn. addEventListener(MouseEvent.CLICK, onup);
function onup(e:MouseEvent):void{
	if(sol.data.msg == null) trace("no data");
	inputText.text = sol.data.msg;
}

```

but it doesn’t work. Can anyone tell me how to pull this off? Many thanks.

---

<div class="post-metadata">

**Author:** ![linusj](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@linusj](https://forum.kirupa.com/u/linusj)\
**Post date:** [May 16, 2016, 5:25pm UTC](https://forum.kirupa.com/t/swf-2-accessing-sol-data-entered-in-swf-1/634628/2 "2016-05-16T17:25:55Z")

</div>

You seem to be missing a forward slash?

`mySO = SharedObject.getLocal("myObjectFile","/");`

Look at the section: **Specifying a path**  
[http://help.adobe.com/en\_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d80.html](http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d80.html)

---

<div class="post-metadata">

**Author:** ![bhnh](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bhnh](https://forum.kirupa.com/u/bhnh)\
**Post date:** [May 17, 2016, 2:29pm UTC](https://forum.kirupa.com/t/swf-2-accessing-sol-data-entered-in-swf-1/634628/3 "2016-05-17T14:29:28Z")

</div>

Awesome. It worked. Thanks, linus!
