Jump to content
Search Community

prioritizing headaches

smurfarita test
Moderator Tag

Recommended Posts

I'm having some odd behavior when using the prioritize() function in LoaderMax. I'm getting an error String used where a Boolean value was expected. The expression will be type coerced to Boolean.

 

Now I took a look at the code and documentation and it clearly states that the function accepts a String. So I looked through the code and also saw TweenLite has a prioritize value that is a Boolean. Is it possible that these two could be conflicting? I'm utilizing both within my application and was wondering if this may be the root of my issue.

 

When I place the LoaderMax code in it's own empty SWF all runs fine, but as soon as I put it back within my application I get the error. The application is made up of many class files and SWFs that all pull in either TweenMax/TweenLite or LoaderMax depending on the needs of the class.

 

Any suggestions? I tried to cast the loader as in... LoaderMax(loadQueue).prioritize("myLoader) with no luck.

Link to comment
Share on other sites

I bet you're just using the wrong syntax. There are two prioritize() methods - one is static:

 

LoaderMax.prioritize("myLoaderNameOrURL", true);

 

And one is an instance-level method, like:

 

var loader:ImageLoader = new ImageLoader("1.jpg");
...do other stuff, like dumping it in a LoaderMax...
loader.prioritize(true);

 

Notice the static method's first parameter is a String that indicates the name or URL of the loader to prioritize. This makes it simple to accomplish from anywhere in your app, even if you don't have a reference to the specific loader - you just use the name or URL. If, however, you have the instance, you can call prioritize() directly on that instance. See the difference?

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.
×
×
  • Create New...