Jump to content
Search Community

BGoulette

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by BGoulette

  1. Thanks again, Carl. Yeah, it's an odd thing, but it's building on older code that, once upon a time, did require everything to be loaded, hence the original onComplete for the entire LoaderMax instance versus its children. That said, I've been poking around, and I think adding an onChildComplete listener to my primary LoaderMax instance ($loader, in this case) will help. It seems to be, but now I just need to make sure the other two loaders, SelfLoader and XMLLoader have finished and have been handled before prematurely calling my completeHandler. It's a big steamy mess, but I think I'm on the way to getting it to behave properly!
  2. Thanks, Carl, but that's not quite what I meant. I can load and display everything as necessary -- once all the SWFs have been loaded. What I need to do is find some way to trigger the "onComplete" handler prematurely while still loading the remaining SWFs...
  3. Hi all, I'm sorry to clog up the forums with something I'm sure I should be able to figure out, but I'm stuck. I have an arbitrary number of SWFs all loaded into a "shell" swf via LoaderMax. These swfs are pulled from references in an XML file (though that shouldn't matter). I have a "loading" progress bar that currently waits until everything (SelfLoader, XMLLoader, and all the SWFLoaders) is finished before displaying the first loaded SWF. Let's say there are 7 SWFs. After the second is fully loaded -- and these have been prioritized, so hopefully that will help keep things in order -- I want to display the first loaded SWF while the remaining 5 load in the background. I have my handlers set up so that I can detect when the desired number of SWFs have been loaded (2 is also arbitrary and user-definable), but after that, I'm not sure how to tell my "shell" to display the first loaded SWF. Any suggestions? Thanks!
  4. I'm a moron: SWF Studio Pro also includes strings like ssGlobals.ssAppDataDir that solve my problem. Too many help files to read and not enough common sense to read them! Ack!
  5. Hey, guys, here's what's going on: I'm using SWF Studio Pro to augment my SWF and create a folder in the user's %APPDATA% directory on a Windows machine. That all works like it should. The problem, however, is when I attempt to load an XML file saved to the user's local machine: when my EXE is first run, it copies an XML file to %APPDATA%\pathname\filename.xml Because I won't know what the users' names are, how can I tell LoaderMax to look in said folder? SWF Studio Pro uses what it called "monikers" that get resolved to the actual paths required, so for example when I type "appdata://pathname/filename.xml", the program sees "C:\Users\Blake\AppData\Roaming\pathname\filename.xml" LoaderMax is, understandably, having trouble (that is, it's not) resolving the full appdata path. Any thoughts on how to solve this problem? Thanks!
  6. This is probably stupid, and I'm probably overlooking something, but I'm curious to know if there's a "clean" way to spit back the name of a file that fails to load (for whatever reason, be it nonexistence [for SWFs] or malformedness for XML or whatever). I know if I trace out evt.target while listening for errors, I get something like: XMLLoader 'xmldata' (_mymodule.xml) But I'm wondering if there's an easy way to just get _mymodule.xml without having to resort to substr or regexp. That's my plan if there isn't a simple way to do it, but there must be a simpler way than that, right? Thanks!
  7. Instead of using CR_btnGrp.autoAlpha=0; have you tried just using CR_btnGrp.alpha=0? If CR_btnGrp is the name of your instance (a normal displayObject), I'm pretty sure it wouldn't have a native autoAlpha property. There's also the property {startAt:{alpha:0}} you could add to your TweenMax statement, but I've had mixed results with that sometimes... CR_btnGrp.alpha=0; TweenMax.from(CR_btnGrp, 1.5, {autoAlpha:0, startAt:{alpha:0}}); (I think that's the proper syntax: just going off the top of my head here...)
  8. Jack, Yes, that makes sense, and shortly after posting, I messed around with my code some more -- well just setting loader.empty(true, false) -- before realizing that loader.empty() was the same thing (default values). So I changed it to that, and I didn't see any change in performance or weird issues with the bandwidth profiler, so I'm good to go for now! As always, thanks very much!
  9. I'm experiencing similar issues, and after reading this thread, I still have a question: I'm doing the same thing, storing LoaderMax-loaded content in separate variables; for example: mySwf=MovieClip(LoaderMax.getContent("swfurl")). After that, I'm running loader.empty(true, true) to try to keep as few items around as necessary. I guess what I'm asking is: Am I keeping double the items in memory if I only call loader.empty(true, true) versus loader.empty(true, false)? Or, because I'm storing a reference to the items elsewhere, I wouldn't be bloating things by not unloading the loader's contents? (I'm confusing myself with my tortured sentence structure -- sorry!) I only see the error when I'm simulating a download from within Flash (haven't moved to trying it on a server yet). And even though the error shows up in the output window, it doesn't seem to affect the actual functionality of my project. Just hoping for some clarification -- I'll admit I'm woefully unenlightened when it comes to garbage collection! Thanks!
  10. I apologize for thread necromancy, but I'm just writing to express my conviction that TweenMax/LoaderMax are indisputably awesome. I'd been banging my head around trying to figure out how to register a font loaded from an external SWF via a LoaderMax SWFLoader instance and kept coming up blank. Until I searched the forums and found one thread that directed me to this thread. That's my long-winded way of saying "thank you very much!" I'm so grateful, I'll say it again: thank you very much!!!
  11. Jack, thank you! What I was doing wrong was a) setting load to true and failing to properly handle events specific to the VideoLoader instance. Having done that, everything loads and behaves almost like it should! /* IGNORE The "almost" is a cuepoint issue. The F4V has an embedded cuepoint; in my old, pre-LoaderMax way, I'd just write an onCuePoint handler and assign a metadata object's onCuePoint function to it: var meta:Object=new Object(); meta.onMetaData=onMetaData; meta.onCuePoint=onCuePoint; ... function onCuePoint (obj:Object):void { target.handleCuePoint(obj); } This would send the entirety of the cuepoint back to my target (document class) where I'd respond to it. I saw that VideoLoader has a VIDEO_CUE_POINT constant, but I'm not sure what to attach it to? Or more accurately, I'm not sure what I should be listening for in my handleCuePoint handler. Tracing it out, I can see that it's triggered, but it only returns an Event of type "videoCuePoint" Is there some way to retrieve the */ Okay, figured it out! LoaderEvent.data.name returns the cuePoint's name, which is all I need at this point! I'm guessing there are other LoaderEvent.data.* properties if I need them down the road! Again, thanks for all your patience and help! I really appreciate it!
  12. Thanks again: I'd initially tried loadedVideo=LoaderMax.getContent("vid") as VideoLoader, but when that returned null, I thought I was doing something wrong. What I think is happening is that onComplete handler fires before the video has actually been loaded, and I'm not sure how (or if I need to) set up an onInit listener for a video loaded through XML. I looked (briefly) at the tutorial you linked, but I didn't see anything with regards to onInit (or how to wrangle a solitary video [not part of a node]). So I've tried moving things out of the onComplete handler...except I'm not sure where I should put them! I mean, if I'm trying to load a VideoLoader through XML, is the onComplete handler (for the XML) where I'd start trying to use it? I typed out a bunch of stuff, but I can't see how it would have worked. I'm sure I'm overlooking something simple, and it's driving me batty! All I'm trying to do is load an XML file (which I've done); then load a video (referenced in the XML as a node) and wait until I have access to its properties/metadata before firing the main document's initialization function. I'm sorry to keep asking, but what am I overlooking now? Again, thanks!
  13. One (ha!) more thing: I feel stupid, and I apologize for wasting your time, but after I've loaded a video through a VideoLoader instance, I'm trying to figure out what to assign it to: for example, with an XMLLoader, I can do the following: loadedXML=new XML(LoaderMax.getContent("xmlThing")); then, in a parent class, I can do myXML=preloader.loadedXML and have access to it (preloader is an instance where the LoaderMax stuff happens). If I wanted to be able to access, say, duration and videoTime from my parent class instance, what would I assign? I tried loadedVideo=LoaderMax.getContent("vid"); but that returns a sprite. (I renamed the video instance in the XML file to "vid"). I'm sure I'm overlooking something simple here, but it escapes me! Thanks for your help (again)!
  14. Why yes, yes it does! And I agree: I like that LoaderMax doesn't try to cram everything and its grandma into memory without your permission! Of course, when you forget to give it permission... I guess I thought that because I created an XMLLoader with just xl=new XMLoader("blah.xml", {name:"blah"}), I could get away with it. Of course I overlooked the fact that I'm "manually" instantiating the XMLLoader instance while relying on LoaderMax to read my mind re: the VideoLoader instance in the XML file! Now to just figure out how to attach/manipulate the loaded video! Thanks for the quick reply!
  15. Hi! I'm probably doing it wrong, but I'm trying to load, in addition to a slew of other XML-related stuff, a video through an XML file. Am I wrong to try to do something like this? lm=new LoaderMax({name:"main", onError:onError, onProgress:onProgress, onComplete:onComplete}); sl=new SelfLoader(target); xl=new XMLLoader("filename.xml", {name:"xmlContent"}); lm.append(sl); lm.append(xl); lm.load(); // Not shown are the event listeners Within the XML file, buried among some other nodes, I have: When I trace out LoaderMax.getContent("vidLoader") or LoaderMax.getContent("commercial"), I get null. What am I doing wrong? Thanks!
  16. I'm an idiot. Apparently, Flash has the gall to require you to add or equivalent before it'll work! > So, um...yeah, it was my fault...
  17. This may be answered somewhere else, but if so, I'm not sure what to look for... I have a swf with a SelfLoader, which works great. What I need to do also is load an XML file (which contains references to video files and some other stuff). Is there a way to append an XML loader referencing the contents of parameters while the original SelfLoader is still loading? Or will I have to create a second loader after the initial SWF is finished loading? The way it's set up is to allow various xml files (one at a time) to be loaded into the main SWF, and I won't necessarily know what those XML files are until runtime...Thanks for any advice!
  18. If it's just a simple trace, I can live with it! Thanks!
  19. Hi, I have a loaderMax that looks for a jpg, etc. If the requested jpg doesn't exist, I want to draw a simple gray rectangle in its place. (If the users can't be bothered to tell me the correct location of the image they want to load, I'm not going to belabor the point! ) This seems to work -- the gray rectangle gets drawn -- but I'm still seeing an error in the output window. I included an onError handler when I appended an ImageLoader onto my loaderMax instance (that's what creates the gray rectangle), but I'm still seeing the following: [pre] Loading error on ImageLoader 'imgHeadshot' (): Error #2032: Stream Error. URL: file:///G|/Users/User/Documents/Folder/ [/pre] I'm not sure if this is a LoaderMax thing or something more general, but is there anyway to avoid it? I tried wrapping the loaderMax.append and loaderMax.load statements in a try..catch, but that didn't do anything. Help? PS: Here's what things look like right now: private function loadHeadshot (strImage:String):void { // Load headshot image. ldrHeadshot=new LoaderMax({name:"headshot", onComplete:onLmComplete, onError:onLmError}); ldrHeadshot.append(new ImageLoader(strImage, {name:"imgHeadshot", container:sprHeadshot, width:64, height:48, scaleMode:"proportionalInside", crop:true})); ldrHeadshot.load(); } private function onLmError (evt:LoaderEvent):void { sprHeadshot.graphics.beginFill(0x808080); sprHeadshot.graphics.drawRect(0, 0, 64, 48); onLmComplete(); } private function onLmComplete (evt:LoaderEvent=null):void { sprHeadshot.x=SPR_WIDTH-(64+MARGIN); sprHeadshot.y=MARGIN; sprAnchor.addChild(sprHeadshot); }
  20. Gah! I knew it would be in there somewhere! I just didn't look in the right place! Thanks, Jack!!!
  21. All right, so I'm not sure if this is a valid concern or not, but I figure I'd ask anyway. Is there any way with LoaderMax to track the loading progress of your main timeline? I've always just written my own stuff that looks at, say, target.loaderInfo.bytesLoaded and stuff...This works all right for loading just the main timeline, but what I end up doing is after loading the main timeline, then creating a LoaderMax instance and loading other stuff from there. If there were a way to use LoaderMax for your main timeline as well as external assets, I'd love to know about it! It's quite frankly something I've probably overlooked, but I'd appreciate any prods in the right direction! Thanks! PS: Here's what I've tried, which doesn't work. I know why, I'm just not sure what to change: // obj.target is a reference to the main timeline swfLoader=new SWFLoader(obj.target, {name:"main", container:this, x:50, y:50, onInit:onInit, onProgress:onProgress, onComplete:onComplete}); swfLoader.load();
  22. Just chiming in to note that I've had this problem, too: I'm using TimelineLite (LOVE it, btw!), but one of the tweens in that array applies a blur filter to a dynamically-masked display object; if I use remove:true in the blurFilter's properties list, I get that weird shifting issue. To counteract it in the meantime, I'm just reapplying the mask immediately after the blur filter is removed...kinda hack-y, but it's working for now!
×
×
  • Create New...