Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
doodledude

LoaderMax: loader context

Recommended Posts

Hi Jack,

 

it would be useful to allow keyword configuration for the more standard loadercontext as well as leaving scope for more advanced usage.

this would allow it be set from the XML file per swfloader instance.

 

e.g. loadercontext.applicationdomain definition types:

 

private function setLoadContext(context:*):LoaderContext{
		var lc:LoaderContext;
		if(context is LoaderContext){
			lc = context;
		}else{
			lc = new LoaderContext();
			if(context is ApplicationDomain){
				lc.applicationDomain = context;
			}else if(context is String){
				switch(context){
					case "CHILD":
						lc.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);//#LC child definitions
						break;
					case "SEPARATE":
						lc.applicationDomain = new ApplicationDomain();//#LC separate definitions
						break;
					case "ADDED":
					default:
						lc.applicationDomain = ApplicationDomain.currentDomain;//#LC added definitions
						break;
				}//end switch
			}else{
				lc.applicationDomain = ApplicationDomain.currentDomain;//#LC added definitions
			}
		}
		return lc;
	}

 

thanks

.

  • Like 1
Link to comment
Share on other sites

The latest version recognizes a "domain" attribute for ImageLoaders and SWFLoaders which can be "child", "separate" or "own" (the default is "own"). So you can do


 

Does that work well for you?

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Greensock,

 

domain applies to the security domain. I believe this poster (and myself included) would like to know if there's a way to control loaderContext.

Link to comment
Share on other sites

Sure, you can set your own LoaderContext using the "context" special property. Even set a new default one using the static LoaderMax.defaultContext property. Or were you asking if you could define a different SecurityDomain inside your XML? If so, then no - that's not currently possible although you could definitely parse the XML manually and feed in whatever LoaderContext you want to each loader as you create the instances.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×