greensock / GreenSock-AS3

Public repository for GreenSock's ActionScript 3 libraries like GSAP (TweenLite, TweenMax, etc.) and LoaderMax. For AS2, see the GreenSock-AS2 repository and for JavaScript, see the GreenSock-JS repository. Main site: http://www.greensock.com
409 stars 144 forks source link

LoaderItem urlVariables #11

Open jesperstarkar opened 8 years ago

jesperstarkar commented 8 years ago

Line 89: var data:URLVariables = new URLVariables( ((request.data is URLVariables) ? request.data.toString() : null) );

A problem occurs if request.data is null or an empty URLVariables object. This happens if you assign a URLVariables object to the URLRequest of the Loader(item), with no parameters passed into it.

.toString() renders an empty string which in URLVariables.decoderesults in an error thrown.

My suggestion is to keep the existing URLVariables object if present, or create a new one from parsing arbitrary data if not: var data:URLVariables = (request.data is URLVariables) : request.data : new URLVariables(request.data.toString());

jackdoyle commented 8 years ago

Thanks for the suggestion. Sure, we can make that change in the next push. Disclaimer: we're no longer developing LoaderMax (or any of our ActionScript tools), as our customers have largely moved to the open web and our focus is on supporting them with the JavaScript tools. Thanks again!