Jump to content
GreenSock

eigenface

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by eigenface

  1. Looking at the source code for XMLoader, it doesn't appear you can use the includeNested option with prependURLs for loaders defined in xml - includeNested is always false. Would it be easy to allow includeNested to be defined in the xml also? It would be very useful. For example, I have a hierarchy of folders containing various different resources I need to load. I'm defining the loaders I need in an xml file. It would be nice if my xml file could mirror the folder structure that contains my resources, like: ... ... As things stand, I have to specify the full path to the deepest subfolder in each deepest-nested LoaderMax node. I assume the "load" attribute applies to nested loaders - I assume because the outermost node has load="false", none of the inner loaders will load. Similarly, you might add an attribute "nestPrependURLs", which itself applies to nested loaders. Then the first line of the above xml becomes:
  2. Sorry for the delayed reply. Now the sequence is: SWFLoader gets a bunch of progress events. swfB main class constructor is called. DataLoader gets an error event. SWFLoader gets an error event. DataLoader gets a fail event. SWFLoader gets a child fail event. SWFLoader gets a fail event. Perfect - this is how I expected it to work. Thanks for fixing this.
  3. "As for the FAIL events that were received AFTER the COMPLETE event on the LoaderMax, that is expected." I didn't get a COMPLETE event before, and I'm still not getting one now (nor did I instantiate LoaderMax, at least not explicitly.) I updated my greensock classes again (just before posting this), and I'm getting a somewhat different, but still strange sequence of events: SWFLoader gets a bunch of progress events. swfB main class constructor is called. (Not an event, just letting you know.) DataLoader gets an error event. (Now this is in the right place, but not if I set priority <= -1.) SWFLoader gets an error event. DataLoader gets a fail event. SWFLoader DOES NOT get a child fail event. (It's supposed to, right?) SWFLoader DOES NOT get another progress event. (I guess this is good.) SWFLoader gets a fail event. SWFLoader gets another error event. (Is this supposed to happen?) SWFLoader gets another fail event. (Is this supposed to happen?) The priority = -1 fix seems to have corrected the order of the error events (but now I'm not getting a child fail event from the SWFLoader at all), but it seems like a brittle fix. If I decide I want to change the priority of my DataLoader error event listener to -1, then the order is wrong again. You have to know internal implementation details in order to avoid breaking the system. Also, I'm getting two events at the end, an error event and a fail event to SWFLoader, that apparently should not be there. Thanks for the sample code, I'll try it out once I get the basic stuff working.
  4. With regard to the second issue, what I'm really trying to do is determine if I can use LoaderMax for the following use-case: in swfA, I'm using a SWFLoader to load swfB. SwfB may need to load any kind of resource at any point in the future, not necessarily right away. I want swfA to hear about it if any of those resource loads fail. (Ideally, swfA could also track the progress of the resource loads, but this is not essential.) Is LoaderMax intended for this use-case or not?
  5. I'm going to ignore the second issue and concentrate on the first one for now. I updated all my greensock classes, and now I'm getting even weirder behavior. The setup is the same: in swfA, I'm using a SWFLoader to load swfB. SwfB uses a DataLoader to load some data, using requireWithRoot. I've entered an incorrect filename so the DataLoader fails. There are no other DataLoaders. Here is the sequence: SWFLoader gets a bunch of progress events. swfB main class constructor is called. SWFLoader gets an error event. DataLoader gets an error event. (Shouldn't this go before the error event to SWFLoader? The default is listen for the target and bubbling phases, not capture; the child gets the event before the parent.) SWFLoader gets a child fail event. DataLoader gets a fail event. (Shouldn't this go before the child fail event to SWFLoader?) SWFLoader gets another progress event. (Is this supposed to happen?) SWFLoader gets a fail event. SWFLoader gets another error event. (Is this supposed to happen?) SWFLoader gets another fail event. (Is this supposed to happen?)
  6. So this is what appears to be happening, and it doesn't seem ideal, but I've been wrong before: in swfA, I'm using a SWFLoader to load swfB. SwfB uses dataLoader1 to load some data, using requireWithRoot. If the data loads, the SWFLoader fires a complete event. If the data fails to load, the SWFLoader fires an error event and a child fail event, but not a regular fail event (also, not a complete event.) I'm thinking the SWFLoader should fire a regular fail event if any child fails (if it's not going to fire a complete event.) It was my understanding that a loader always completes or fails. Actually, maybe it is better than you only get a child fail, and not a regular fail also - easier to tell those 2 cases apart that way. Does the behavior I'm describing make sense? As a separate issue, it appears to be the case that requireWithRoot only works for subloaders instantiated when their root finishes loading. I tried instantiating dataLoader2 in the complete event handler for dataLoader1, also using requireWithRoot (dataLoader2 has to wait for dataLoader1 to finish in order to know what to load next.) But then the SWFLoader fires a complete event after dataLoader1 completes, and only after that does dataLoader2 complete. Seems to me, it would make more sense if the SWFLoader didn't fire its complete event until both DataLoaders completed.
  7. No, that makes sense in light of the "make a request, get an event" idea. You told it to load, so it has to either complete or fail, and if you deliberately remove one of its children, I guess it didn't fail at what you intended it to do. I just hadn't fully wrapped my head around the idea. So if the LoaderMax only has one child, and you remove that child while it's loading, does the LoaderMax complete or fail? By the above logic, it should complete, but then again it never actually completed loading anything.
  8. Thanks a lot for the fix - this works as expected now. So autoDispose disposes of a loader after the complete event fires (after complete event handlers are called.) But it doesn't dispose of the loader after fail events, right? So it will always complete or fail, but not always autoDispose. What was the rationale for that? I would have assumed it would always autoDispose. I'm kinda confused by your response to my statement. In the example where in the process of loading one child, you append a second child, then the first finishes loading, and then you remove the second one (before it finishes loading, I meant), what happens? A complete event or a fail event?
  9. Yeah, that makes sense - Events are responses to specific requests, and the loader's state of completeness is represented by its progress property. Although, it seems like there are also weird cases with the way LoaderMax currently works. For example, while in the process of loading one child, you append a second child, then the first finishes loading, and then you remove the second one. LoaderMax never fires a complete Event, right? Is there a relatively simple way to state under what circumstances the complete event fires? I think the error I posted is an event listener priority issue - according to my trace statements, allWordsCompleteHandler was firing before the final wordsCompleteHandler. And when I don't use autoDispose, I don't get the error. I think allWordsCompleteHandler was happening first, and disposing of the final DataLoader, which caused the error. Aha! And apparently the reason allWordsCompleteHandler was happening first is because I'm calling dispose manually on each DataLoader as it completes, in wordsCompleteHandler. This seems like a real bug, because it happens whenever I manually call dispose in wordsCompleteHandler, regardless of whether or not I've set the DataLoaders to autoDispose - it's not a matter of disposing of the DataLoader twice (which shouldn't cause problems anyway.) In fact, I'm disposing of the LoaderMax twice (once with autoDispose and once manually inside allWordsCompleteHandler) and this doesn't seem to cause any problems. Here are my handlers. protected function wordsCompleteHandler(event:LoaderEvent):void { trace("wordsCompleteHandler"); var loader:DataLoader = event.target as DataLoader; wordsStr = loader.content; loader.dispose(); // comment out this line to prevent Error } protected function allWordsCompleteHandler(event:LoaderEvent):void { trace("allWordsCompleteHandler"); if (parentLoader) { parentLoader.dispose(); parentLoader = null; } } protected function failHandler(event:LoaderEvent):void { if (parentLoader) { parentLoader.dispose(); parentLoader = null; } trace("ListData, load failed, url: " + event.target.url); }
  10. It'd be like saying, "I put turkey, stuffing, and yams on my TODO list, and then I finished cooking the turkey, the stuffing, and the yams, but I'm not officially done with the TODO list (even though turkey, stuffing, and yams are the only things on it), because I never officially picked up the TODO list and said 'Okay, I'm starting now.'" Does that make sense?
  11. Ok, I'll pull out a "clean" example. In the meantime, I see what you mean about LoaderMax not firing an event if it was never directly asked to take an action, but is that really the behavior you want? It seems to me, if it's ever the case that all of a LoaderMax's children complete loading, the LoaderMax onComplete should fire. It just doesn't seem logical that all the children can complete without the parent also being "complete", see what I mean? Is there something I'm missing?
  12. I updated all greensock classes today, immediately before trying the above.
  13. Here is a method I'm calling multiple times in rapid succession: public function loadWords(url:String):void { var loader:DataLoader = new DataLoader(url, { format:URLLoaderDataFormat.TEXT, onComplete:wordsCompleteHandler, onFail:failHandler, autoDispose:true }); loader.load(); if (parentLoader == null) { parentLoader = new LoaderMax({ onComplete:allWordsCompleteHandler, autoDispose:true }); } parentLoader.append(loader); } parentLoader is an instance var for the class instance this method belongs to, and starts out null. wordsCompleteHandler ends up getting called once for each time this method is called (good), failHandler never gets called (good), but neither does onComplete:allWordsCompleteHandler (bad). Shouldn't allWordsCompleteHandler get called once all the DataLoaders appended to parentLoader complete? Is the order I'm appending/loading/instantiating f*cking things up somehow? Seems like the above code should work fine. I tried changing the method to this: public function loadWords(url:String):void { if (parentLoader == null) { parentLoader = new LoaderMax({ onComplete:allWordsCompleteHandler, autoDispose:true }); } var loader:DataLoader = new DataLoader(url, { format:URLLoaderDataFormat.TEXT, onComplete:wordsCompleteHandler, onFail:failHandler, autoDispose:true }); parentLoader.append(loader); } That is, I made sure the parentLoader was instantiated before any DataLoaders were instantiated, and I didn't load any of them individually. Instead, I called parentLoader.load() after the last time loadWords was called. This produces the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock.loading::LoaderMax/_loadNext() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading.core::LoaderCore/_completeHandler() at com.greensock.loading::DataLoader/_receiveDataHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() This looks like LoaderMax getting confused about what it should load next. Not sure what's going on.
  14. Thanks. I guess I don't have to worry about it unless I compile from that particular (old?) version of flash. Did it happen when compiling for a particular version of flash player, or compiling from a particular version of the flash authoring tool?
  15. In the 6.03 version of OverwriteManager, you've removed a return statement from a while loop in favor of breaking out of the while loop before returning, blaming an extremely rare bug in flash player which sometimes throws and error. I put return statements inside while loops all the time! Would you mind cluing me in as to what to the extremely rare circumstances are? I don't want to run afoul of this flash player bug.
  16. I'm curious, does this var i:int = array.length; while (--i > -1) { ... have any advantage over this var i:int = array.length; while (i-- > 0) { ... and if so, what? I ask because I believe this changes was made in TweenLite/Max.
  17. Is there a good way to tween tint without making the whole target a solid block of color? Instead, I want to lightly shade the target with a different color with the original details still visible. A "tintMultiplier" variable like fl.motion.Color has would be ideal.
  18. Thanks, that makes sense.
  19. I'm having a lot of trouble getting liquid stage to do what I want, even though what I want is very simple. Here is what I'm trying to do: I have an image box. This box should keep the correct aspect ratio, resize when the screen resizes, and keep it's top left point anchored. This code seems to work perfectly for that: imageBoxArea = LiquidArea.createAround(screen.imageBox, ScaleMode.PROPORTIONAL_INSIDE, AlignMode.LEFT, AlignMode.TOP); I have a grey box. This box should stretch to fit the width of the stage, and should also stretch to fit the height of the image box. The grey box should remain anchored at the same y-value, the same y-value as the image box. In other words, the grey box forms a horizontal stripe behind the image box. It seems like what I want to do is put the grey box in a LiquidArea, and then something like horizontalScaleMode = STRETCH, verticalScaleMode = PROPORTIONAL_INSIDE, but of course liquid stage doesn't work that way. How does it work?
  20. Thanks for all the explanation. I will definitely give feedback as I continue to work. My first question is, how do I get LiquidStage to work when the swf is embedded in a webpage? The resizing works correctly if I open the swf in the standalone player, but if I use swfobject2 to embed in html, then when I resize the window in Firefox the swf does not resize. Do I need a special scale mode or other settings?
  21. Looks like several new classes have been added to the layout folder, LiquidWrapper has been removed, and much of the code has been rewritten. I'd more or less gotten my head around the old setup and incorporated it into a project I'm currently working on, but I assume the new setup is supposed to be more powerful and/or intuitive. Can you help me understand what the changes entail? Looks like LiquidStage.pinObject(sprite, LiquidStage.TOP_LEFT) is now liquidStage.attach(sprite, liquidStage.TOP_LEFT) But I don't see a parallel for LiquidStage.stretchObject(sprite, LiquidStage.TOP_LEFT, LiquidStage.TOP_RIGHT, LiquidStage.BOTTOM_LEFT). How do I achieve the same effect? Also, I had been using a LiquidWrapper like wrapper = new LiquidWrapper(parent, NaN, NaN, LiquidWrapper.ALIGN_TOP, LiquidWrapper.ALIGN_LEFT) I assume LiquidArea is the new LiquidWrapper, but the constructor arguments are quite different. How do I achieve the same effect? In general, can you give me some overall advice about what changes were made and why? How should I think about what the new layout classes do, intuitively? For example, previously I could specify several pin points, whereas now it looks like I can only specify one. Conceptually, what's the difference?
  22. I think there's a bug in your TimelineMax "Who's the boss..." movie, or at least a confusing UI choice. When the timeline finishes, the play button changes to "restart", even though it's still really play. It seems strange that when you alternately click the restart button on the left and reverse, the timeline switches direction back and forth, but when the alternately click the identically-labeled restart button on the right and reverse, the timeline starts over every time you click restart. Congratulations on the site update, by the way. It looks great.
  23. This isn't a tweening question, this is a purchasing question, but I didn't know where else to put it. I tried to pay with credit card, and after I entered my information, it prompted me to set up a paypal account, which I didn't want to do. This paypal account requires my bank info. Is there a way to simply pay with a credit card? Am I missing something?
  24. So should duration be totalFrames or totalFrames - 1?
×