Copy link to clipboard
Copied
I have created a varable of Shared Object inside the Document Class
EXAMPLE -> var so:SharedObject = SharedObject.getLocal("Barns","/");
but inside of a movieclip class I have
if(so.data.adams == "yes"){
adamsHighlight.visble = true}
and I get an error
E:\Android 2.0\ohioMap.as, Line 12 | 1120: Access of undefined property so. |
what am i missing here. I thought if it was public, it is shared throughout the project
sorry new to classes.
Copy link to clipboard
Copied
it is but so is not defined in your movieclip class unless you use:
var so:SharedObject=SharedObject.getLocal("Barns","/");
now, the so in your document class and in your movieclip class reference the same object. eg,
//doc class
so.data.testvar="hi";
//movieclip class
trace(so.data.testvar); // should trace 'hi'
Find more inspiration, events, and resources on the new Adobe Community
Explore Now