Jump to content
Search Community

alkrantz

Members
  • Posts

    8
  • Joined

  • Last visited

alkrantz's Achievements

0

Reputation

  1. Thanks Carl, Ill try that. Also, that code you gave me to check if loaders were being prioritized helped a lot too. Turns out they were not. I had to change the prioritize snytax a bit (still not sure why but at this point I'll take it) and now they are prioritizing which looks like it might possibly have the trickle down effect of making the currentTarget.progress tip work as well. Thanks again guys, great community. When I get some money coming in I will renew my greensock membership. I have donated before but it expired. -A
  2. Thanks for the feedback guys unfortunately this doesn't solve my dilema. Carl, unfortunately autoPlay:false does not solve my problem. In fact I already have that in my code. The conflict here is that I have a button that explicitly tells the loaded .swf to play, and what I want to do is change the logic of that button so that it only tells the .swf to play IF it is completely loaded. So essentially the problem is that I don't know how to check the COMPLETE status of an appended item in the que. Mark, Unfortunately the currentTarget.progress still gives me the progress of the entire _queue and not individual loaders. Thanks again for taking the time guys I do really appreciate it.
  3. Absolutely. You can get the progress/bytesLoaded/bytesTotal anytime for any loader. myLoader.prioritize(); trace("current progress: " + myLoader.progress); If you want to get only the currently loading children of a LoaderMax, you can use its getChildrenByStatus() method. Does that answer your question? Not sure that I understand Jack, and I cant seem to figure it out. Let me try to explain where the hangups in my projects are: Currently I have created a que that loads four swfs and everything works great. They load fine. When a user clicks one of four buttons a corresponding .swf from the que is played. This also works perfectly. When the que begins loading the four .swfs a progress bar animates and a text field displays information about the total mbs loaded and the time remaining. I need three things to happen that I haven't yet figured out. First, when a user clicks on one of the four buttons I want to prioritize the loading of the corresponding .swf from the que (which I think is working but I am not sure how to tell) Second, I want the progress bar and progress information to change from displaying the overall que progress, to the progress of the individual loader/swf being prioritized by the clicked button. Third, when the user clicks a button and prioritizes a .swf from the que, the .swf is also played. However, it will begin playing even if the .swf is not fully loaded and I don't want that. I only want the .swf to play if it has completed loading. What I can not figure out how to do currently is: A. Make the progress information correctly reflect the progress data of the prioritized loader and not the entire loader. Basically i cant figure out how to reference the individual loaders in the que. When I try to reference them by using the the "name" attribute I get an " Variable seq_1 is not defined." error. Which I assume must somehow be related to scope. B. Check to see if individual loaders have completed loading so I can restrict playback to .swfs that have completed loading only. Below is the relevant code I am using: // Vars var _queue = new LoaderMax({name:"sequenceLoader",onComplete:QueueComplete,onProgress:QueueProgress,onError:QueueError}); // LaoderMax Que _queue.append( new SWFLoader("interactive_sequence.swf", {name:"seq_1", estimatedBytes:3000, container:this.heroMain_mc.sectionContainer_2_mc.container_mc, autoPlay:false})); _queue.append( new SWFLoader("motion_sequence.swf", {name:"seq_2", estimatedBytes:3000, container:this.heroMain_mc.sectionContainer_3_mc.container_mc, autoPlay:false})); _queue.append( new SWFLoader("coming_soon_sequence.swf", {name:"seq_3", estimatedBytes:3000, container:this.heroMain_mc.sectionContainer_4_mc.container_mc, autoPlay:false})); _queue.append( new SWFLoader("coming_soon_sequence.swf", {name:"seq_4", estimatedBytes:3000, container:this.heroMain_mc.sectionContainer_5_mc.container_mc, autoPlay:false})); _queue.load(); function QueueProgress(event:LoaderEvent):void { // show preloader Object(this).loader_main_mc.visible = true; var perc:Number = Math.abs(event.target.bytesLoaded / event.target.bytesTotal) * 100; var secs:Number = ((1 / event.target.progress) - 1) * event.target.loadTime; var frameNumber:Number = Math.round(event.target.progress * 100); this.loader_main_mc.loaderAnimation_mc.gotoAndStop(frameNumber); this.loader_main_mc.percent.text = String(perc.toFixed(2)) + " %" + " of " + (mbps.toFixed(2)) + " mb"; this.loader_main_mc.time.text = String(secs.toFixed(1)) + " seconds remaining"; //trace("progress: " + event.target.progress); } function QueueComplete(event:LoaderEvent):void { // hide preloader Object(this).loader_main_mc.visible = false; //trace('complete'); } function QueueError(event:LoaderEvent):void { //trace("error occured with " + event.target + ": " + event.text); } // Code in button functions var sec_1_Content = LoaderMax.getContent("seq_1").rawContent; _queue.prioritize("seq_1"); sec_1_Content.gotoAndPlay(2); As always any help from anyone is greatly appreciated. Thanks in advance.
  4. Great thanks for the code guys.
  5. Thanks for the feedback guys, Is there a way to show the loading progress / btyesLoaded of ONLY the currently prioritized loader? and not the entire que. Or if I want to do that should do I need to use separate loaders?
  6. Hey guys, New user to loaderMax looking for some clarification on the high level concepts of the class. I have a website with a flash banner at the top. The content of the banner can be changed using 4 buttons directly below it. Each button loads a new .swf into the banner. It does not unload the previous content in the event a user wants to return to it. From what i have read on this site so far, I need to create a que of loaders to load my .swfs first, and then in the event handler for each button, prioritize() the associated loader for that button. is that correct? Just trying to get my head around it. Thanks in advance for any help. -A
  7. Awesome thanks. Sorry I didnt find that post myself. -A
  8. Hi guys, Is it possible to use a custom animation for the progress animation in loaderMax? Sorry if this has been asked on the boards before I didn't have any luck finding it. Thanks in advance for any help. -A
×
×
  • Create New...