0
Sharing SharedObjects between Classes
Community Beginner
,
/t5/animate-discussions/sharing-sharedobjects-between-classes/td-p/6877900
Feb 06, 2015
Feb 06, 2015
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.
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/sharing-sharedobjects-between-classes/m-p/6877901#M151085
Feb 07, 2015
Feb 07, 2015
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'
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

