Jump to content
GreenSock

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

spiralstatic

Members
  • Posts

    6
  • Joined

  • Last visited

spiralstatic's Achievements

0

Reputation

  1. I've got it working but it turned out to be a bit tricky. Changing the last reference from window to my global scope seemed to work although I started seeing issues around references to GreenSockGlobals. I can remove these errors if I include the the TweenLite library much later in the code (before I was trying to import at the start, but obviously something wasn't initialised at this point). After this there were some problems with setTimeout but this was probably just due to the framework I'm using. I changed 'window.setTimeout' to 'setTimeout' to fix this. I also had to change the window reference in EasePack.min.js to my global scope. Thanks for your help!
  2. Thanks Jack... this is all really helpful. I will investigate today and get back to you.
  3. Is it possible to include the GSAP library into a Javascript project that doesn't use or run on a browser? I'm developing software using a framework that has no need for a browser, and at first glance it doesn't look possible as the TweenLite/TweenMax source is referencing things like 'window' and 'createElement' etc...
  4. Oh yeah, you're right - I removed the "load" attribute from the XML nodes so that I could perform the replaceURLText. Your solution worked but I decided to write it a neater way and instead append the "bg" loader to the original "queue" loader (so now my mainQueue complete event only fires once everything has completely loaded) - private function initLoad():void { queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new XMLLoader(rootURL + XMLFile, {name:"xmlDoc", onComplete:completeXMLHandler}) ); queue.load(); } private function completeXMLHandler(event:LoaderEvent):void { trace("XML loaded"); queue.replaceURLText("{imageDirectory}", rootURL + GlobalAccess.pathImages, true); queue.append(queue.getLoader("bg")); } Thanks for your help on this one - much appreciated!
  5. Hey, thanks for the quick response. I'm taking a look at this right now but can't seem to get anywhere. The XMLLoader has been appended to a LoaderMax loader, and I'm trying to extract the width/height of the image when the LoaderMax onComplete handler has fired (i.e. AFTER everything should have loaded, right?). If I add an onChildComplete handler to the XMLLoader no event appears to be dispatched for the subloads (the image in the XML). How do I access the ImageLoader seeing as it was created dynamically by the XMLLoader? Here's the code - I've removed any liquidStage stuff as it's irrelevant - private function initLoad():void { queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new XMLLoader(rootURL + XMLFile, {name:"xmlDoc", onComplete:completeXMLHandler, onChildComplete:onChildLoaded}) ); queue.load(); } private function completeXMLHandler(event:LoaderEvent):void { trace("XML loaded"); queue.replaceURLText("{imageDirectory}", rootURL + GlobalAccess.pathImages, true); queue.getLoader("xmlDoc").getLoader("bg").load(); } private function onChildLoaded(event:LoaderEvent):void { trace("sub loaded " + event.target); } private function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } private function completeHandler(event:LoaderEvent):void { trace(event.target + " is complete! (everything loaded)"); var photo:ContentDisplay = LoaderMax.getContent("bg"); addChild(photo); TweenLite.from(photo, 1, {alpha:0}); trace(photo.width, photo.height); GlobalAccess.contentXML = LoaderMax.getContent("xmlDoc"); trace("Here's the XML... \n" + GlobalAccess.contentXML); } Hope you can help, Thanks
  6. Hi there, I'm using XMLLoader to load my XML, then load an an image that sits inside the XML. The image loads fine and I can use this code to show it - var photo:ContentDisplay = LoaderMax.getContent("bg"); addChild(photo); TweenLite.from(photo, 1, {alpha:0}); The problem is if I want to use LiquidStage to display the image (by adding it to a liquid area). If I do this then the image doesnt't appear until you manually resize the browser. This happens even if I call update() on the liquidStage or liquidArea objects. I traced out the width/height of the image once it's been added to the stage, and they are both zero - var photo:ContentDisplay = LoaderMax.getContent("bg"); addChild(photo); TweenLite.from(photo, 1, {alpha:0}); trace(photo.width, photo.height); // 0 0 This is obviously an issue - but I don't understand why it's happening or how I can fix it. I don't want to add the display object before it's loaded, so don't want to hard code a width/height anywhere in the load constructor. Also I'm dynamically creating the imageLoader so have less control on how it loads the image (I think!?). Any help would be much appreciated! Thanks, Matt
×