0

I have an actionscript class with a static member variable defined.

public class A
{
     public static var x:int;
}

When I try to access it from different parts in my code I don't get the same value in each spot.

A.x 

I am accessing the variable in different modules that are loaded, so they are all in their own separate .swf file. Could this by why?

1 Answer 1

4

Seems like an application domain problem. The main swf and the modules seem to be accessing their own copies of the A class. You should probably change the way you load your modules.

Check this out:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/LoaderContext.html#applicationDomain http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/ApplicationDomain.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.