Jump to content
Search Community

Multi-Task

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by Multi-Task

  1. Side note... To set back the SWF timeline of the child swf, is it someAsset.rawContent.gotoAndStop(1); or someAsset.content.gotoAndStop(1); These would all be loaded into the container_mc
  2. If this is not possible given my scenario, do you know of any work arounds? I was thinking about adding some custom listeners and events but not sure if that would even help in this scenario.
  3. Thanks Carl for helping out... So I added a simple text field on stage to try to determine what is being referenced and for displaying errors. Environment: AIR app runs on desktop and loads in externally hosted SWF files. This all works great since I have a crossdomain policy in place. However; after your suggestions. I am getting a #2047 error. Any ideas? Is it not possible to call public functions of an AIR app from externally hosted SWFS? private function showSomething():void { try { this.dText.text = "parent " + MovieClip(this.parent.parent.parent.parent); } catch(e:Error) { this.dText.text = e.errorID+"\nError Message : "+e.message; } } private function done():void { this.dText.text = "done"; var curParent:MovieClip = this.parent.parent.parent.parent as MovieClip; curParent.swfFinished(); }
  4. From the child swf, this.parent says its referencing the stage. so this.parent.parent should be the container_mc? adding another parent (this.parent.parent.parent) should be the stage of the parent application? but what about the document class of that parent? :/ I should add that these sub SWFs are being loaded into an AIR app. SWFs are pulled from Server... Am I even able to access the public functions within the AIR app from the loaded SWFs?
  5. Trying to unload a child SWF by calling the parent document class function from the child document class... Loading as such from Main Document class: (SWF loads and plays fine) if(currAsset is SWFLoader){ container_mc.addChild(currAsset.rawContent); currAsset.rawContent.gotoAndPlay(1); } Also, within Main Document Class: public function swfFinished():void { var currAsset = media.getChildAt(mediaTracker-1); currAsset.content.visible = false; currAsset.rawContent.gotoAndStop(1); container_mc.removeChildAt(0); currAsset=null; //set up and play the next swf managePlayBack(); } Then - From the Child SWFs Main Document Class: This function is fired once the SWF is done (last frame of SWF calls this), this fires but doesnt trigger parent function of swfFinished(). private function done():void { var curParent:MovieClip = this.parent.parent.root as MovieClip; curParent.swfFinished(); } Any ideas?
  6. I am wondering if this is even possible. I am using LoaderMax/XMLLoader and loading in SWF files that are externally hosted into an AIR app. Everything works great! With LoaderMax is it possible to have one of these child SWFs load in some type of XML data? Or if need be, should I have the AIR app do all the loading (including the other XML) and pass that to the child SWF? Thanks in advance! In detail: AIR app -> Loads SWFs SWFS -> Load XML SWF -> displays something or does something RAD!!! Thanks in advance!
  7. Thanks Carl! I was also curious per one of my initial questions; Have you guys noticed whether with the LoaderMax by itself and/or AIR/Flash Player, is it better (memory speaking) to use FLVs within swfs or MP4s? Thanks in advance!
  8. Thanks Carl for responding. So per my set up I am loading everything into the var media:LoaderMax; This is referenced in the first function where I am setting; var currAsset = media.getChildAt(mediaTracker-1); I am also harnessing the XMLLoader and once that is done I am calling media.load(); I am cycling through these per a var mediaTracker:int; As the files play over and over, I am just incrementing the mediaTracker ++ and then if its at the end setting it back to 1. Now when the videoComplete function is called per the Event; VideoLoader.VIDEO_COMPLETE Do I actually want to unload(); given I am going to play the file again? I thought that would empty out all content and then I would have to reload? Thanks in advance!
  9. Video presenter made with VideoLoader... I made a video presenter that loads videos (mp4) and cycles through them. There are 8 videos in total around 30MB combined. Everything loads in perfectly and plays for awhile, however, for some reason after a certain number of cycles, the screen will go black and the video complete listener never fires. It does this on random videos and is never the same video that it happens to. The managePlayer function will fire and load the video but it never fires the complete event. Is this sufficient addition/removal of videoLoader? Am I missing something? Any ideas why the screen would go black and the complete event never fires? Per memory usage would it be better to make swfs rather than MP4s? private function managePlayer():void { //this just traces out to a window where we are at addToDisplayIt("managePlayer"); var currAsset = media.getChildAt(mediaTracker-1); if(currAsset.vars.type!=null) { if(currAsset is VideoLoader){ container_mc.addChild(currAsset.content); currAsset.playVideo(); currAsset.addEventListener(VideoLoader.VIDEO_COMPLETE, videoComplete); } } } private function videoComplete(e:Event):void { //this just traces out to a window where we are at addToDisplayIt("videoComplete"); var currAsset:VideoLoader = VideoLoader(e.target); currAsset.removeEventListener(VideoLoader.VIDEO_COMPLETE, videoComplete); currAsset.gotoVideoTime(0, false); container_mc.removeChildAt(0); currAsset=null; managePlayBack(); }
  10. Carl, thanks for responding so quickly. Yep! Policy file is in place and I did set everything up per that link you sent prior to testing this. Since yesterday I have tested a few more things in more detail. My policy file loads per my Logs. OK: Policy file accepted: https://somebucket.s3.amazonaws.com/crossdomain.xml) The problem: There is extra encoding happening on certain URL parameter values. Fixed by unescape(url); However is it possible to turn this off globally with the loadermax and set vars? hmm...
  11. Multi-Task

    s3

    First off, the new forum and site are sick! Nice work. Looks great! I am stumped on this one. I made a sample loader (image loader) since I know the test is an image. I am trying to load an image from s3 and I am getting errors? Any ideas why? Below is just an example with real data taken out. Also: In the output window I am getting Error on ImageLoader - with the correct path to the file which if copy and pasted works in a browser. It also says Error Load never completed URL: then the url again with the parameters and values in a different order. Why is this parameter and value shift happening? Also which URL is it actually trying to load? Any help is appreciated. Thanks in advance! var myImage:ImageLoader = new ImageLoader("https://somebucket.s3.amazonaws.com/img/someFile.jpg?AWSAccessKeyId=someAccessKey&Expires=someTime&Signature=someSignature", {container:this}); myImage.load();
  12. True. All true. I just didn't know if there were limits built in. Thanks though. Publishing for AIR 3.4, (the same assets/playlist run fine when in debug mode). I will try to find that happy place for a few various devices. I have tried leveraging setting various vars: media = LoaderMax.getLoader("media"); media.vars = {maxConnections : 1, auditSize : false }; But to no avail… Thoughts? Trying to play - 10 MP4s @ an average of 8MB each -mt
  13. Is there a maximum of videoLoaders one can add? I have 14 MP4s that I am trying to play back. On initial start of the app. It attempts to load but then crashes. Is there a Max to LoaderMax (especially for video)? Thanks in advance. -MT
  14. Roger that Carl. A new test will commence here shortly. I will try swfs only (without FLVs embedded). Thanks for the help, forgot to mention this is for an air app. no browser. Interesting comment you made about FLVs. I have a few SWFs that have FLVs embedded in them and they act very goofy upon playback. I'll be back (arnold voice). Thanks again.
  15. Thanks Carl. Even if I am going to cycle through and play them again? I thought the dispose method completely removes them and sets it out for GC... It is fairly odd too, since I am testing also if all eventListeners have been cleared which they are. Like so, trace(currAsset.hasEventListener(VideoLoader.VIDEO_COMPLETE)); Returns false as it should.
  16. Good morning, I am trying to create a little toy where I can loop FLVs and SWFs. What are the best practices for this when it comes to adding and removing them from the display list? I tried running this for a few hours and noticed that the memory continued to build. I am using the XMLLoader and then using LoaderMax to handle rest. Everything plays fine for the most part and files get added and removed however the memory building is where I am boggled. Below is how I am going about adding and removing items from the display, as well as, managing playback. private function managePlayBack():void { //if list is complete if(mediaTracker==(media.numChildren)) { //setTracker back to 0 mediaTracker=0; managePlayer(); } else { mediaTracker++; managePlayer(); } } private function managePlayer():void { var currAsset = media.getChildAt(mediaTracker); if(currAsset.vars.type!=null) { //detect what type of asset needs to be shown and played if(currAsset is VideoLoader){ container_mc.addChild(currAsset.content); currAsset.playVideo(); currAsset.addEventListener(VideoLoader.VIDEO_COMPLETE, videoComplete); } if(currAsset is SWFLoader){ container_mc.addChild(currAsset.rawContent); currAsset.rawContent.gotoAndPlay(1); addEventListener(Event.ENTER_FRAME, swfComplete); } } currAsset = null; } /* VIDEO COMPLETE FUNC */ private function videoComplete(e:Event):void { var currAsset:VideoLoader = VideoLoader(e.target); currAsset.removeEventListener(VideoLoader.VIDEO_COMPLETE, videoComplete); currAsset.gotoVideoTime(0, false); container_mc.removeChildAt(0); currAsset=null; //set up and play the next asset managePlayBack(); } /* SWF COMPLETE FUNC */ private function swfComplete(e:Event):void { var currAsset = media.getChildAt(mediaTracker); if (currAsset.rawContent.currentFrame == currAsset.rawContent.totalFrames) { removeEventListener(Event.ENTER_FRAME, swfComplete); currAsset.content.visible = false; currAsset.rawContent.gotoAndStop(1); container_mc.removeChildAt(0); currAsset=null; //set up and play the next asset managePlayBack(); } } Thanks in advance for any insight on this. -MT
  17. Carl, Thanks for responding. My apologies, I am using <imageLoader> nodes and then within each our attributes for duration, title, etc... Since, I have tried unloading and loading again. Any other suggestions?
  18. Ooops forgot to add some code… I guess where it would make sense would be to check for count within the managePlayBack function if the counter reaches a certain point…. private function getPlayList():void { xmlLoader = new XMLLoader(urlStr, {name:"xmlDoc", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); xmlLoader.load(true); } private function completeHandler(event:LoaderEvent):void { xmlLoader.removeEventListener(LoaderEvent.COMPLETE, completeHandler); xmlLoader.removeEventListener(LoaderEvent.ERROR, errorHandler); xmlLoader.removeEventListener(LoaderEvent.PROGRESS, progressHandler); media = LoaderMax.getLoader("media"); media.addEventListener(LoaderEvent.COMPLETE, mediaCompleteHandler); media.addEventListener(LoaderEvent.ERROR, errorHandler); media.addEventListener(LoaderEvent.PROGRESS, progressHandler); media.load(); } private function progressHandler(event:LoaderEvent):void { //trace("progress: " + event.target.progress); } private function errorHandler(event:LoaderEvent):void { if(event.target is XMLLoader) { xmlLoader.removeEventListener(LoaderEvent.COMPLETE, mediaCompleteHandler); xmlLoader.removeEventListener(LoaderEvent.ERROR, errorHandler); xmlLoader.removeEventListener(LoaderEvent.PROGRESS, progressHandler); } else { media.removeEventListener(LoaderEvent.COMPLETE, mediaCompleteHandler); media.removeEventListener(LoaderEvent.ERROR, errorHandler); media.removeEventListener(LoaderEvent.PROGRESS, progressHandler); } } private function mediaCompleteHandler(event:LoaderEvent):void { media.removeEventListener(LoaderEvent.COMPLETE, mediaCompleteHandler); media.removeEventListener(LoaderEvent.ERROR, errorHandler); media.removeEventListener(LoaderEvent.PROGRESS, progressHandler); if(ini==false) { ini = true; TweenLite.to(intro, .5, {alpha:0, onComplete:removeIntro}); } } private function removeIntro():void { managePlayer(); removeChild(intro); intro = null; } //Counter for how many times through private var playbackCnt:int = 1; private function managePlayBack():void { //if playlist is complete if(mediaTracker==media.numChildren) { //inc up playbackCnt++; trace("playlist complete "); //setTracker back mediaTracker=1; if(playbackCnt==50) { trace('Lets do something here and check for new data'); } managePlayer(); } else { mediaTracker++; managePlayer(); } } private function managePlayer():void { var currAsset = media.getChildAt(mediaTracker-1); if(currAsset.vars.type!=null) { if(currAsset is ImageLoader){ container_mc.addChild(currAsset.content); TweenLite.to(currAsset.content, .5, {alpha:1}); TweenLite.delayedCall(currAsset.vars.time, fadeImageOut, [currAsset.content]); } } } private function fadeImageOut(obj):void { TweenLite.to(obj, .5, {alpha:0, onComplete:imageComplete, onCompleteParams:[obj]}); } private function imageComplete(obj):void { container_mc.removeChildAt(0); obj = null; managePlayBack(); }
  19. I am using the LoaderMax to help load in an XML doc that contains image paths, other data, etc... Gallery functions great! Love it. You guys ROCK! My question is, to advance this I want to have my gallery reload the xml doc every few hours. To account for any changes etc... To do this in the background while it is currently playing is some what understandable… However, I have been going back and forth with toggling the Loaders or at a certain interval create a new xmlLoader and grab new data. Once everything is loaded, toggle the list. ??? I went through the docs after someone suggested calling "load(true)" on the xmlLoader instance, but that resulted in wiping. Another suggestion was to append then remove old but that seemed tedious. Any help is much appreciated…. I will continue to look through the forums. Thanks! -mt
×
×
  • Create New...