Edward Posted June 1, 2008 Share Posted June 1, 2008 Hi, I am trying to set up a preloader that will be used while I am loading movies in to a blank movie clip. I think my actionscript makes sense, and it works when I test it through Flash, but doesn't work when I view it online. Can anyone see where I am going wrong? When a button on my movie is clicked, it tells the 'container' movie to play. Here are the actions I have within 'container': Frame 1: stop(); Frame 5: loadMovie('print_test.swf', this.print_page_03_container); Frame 7: var bytes = this.print_page_03_container.getBytesTotal(); var bytes_loaded = this.print_page_03_container.getBytesLoaded(); if (bytes_loaded == bytes) { //_root.gotoAndPlay(2); gotoAndStop(9); } else { gotoAndPlay(6); } On Frame 9 I have the word 'loaded' so I can see when the timelines arrives there. The problem is, when I view it online, I gets to frame 9 even though print_test.swf hasn't fully loaded. Perhaps it is checking if the container (this.print_page_03_container) has loaded, rather than the actual movie inside it too (print_test.swf)? Quote Link to comment https://forums.phpfreaks.com/topic/108238-solved-help-with-a-preloaded-for-loadmovie/ Share on other sites More sharing options...
rondog Posted June 4, 2008 Share Posted June 4, 2008 look into using movieClipLoader..its has listeners tied to it like, onLoadStart, onLoadComplete and onLoadProgress. Basically set it up like this: var mcl:MovieClipLoader = new MovieClipLoader(); var mclL:Object = new Object(); mcl.addListener(mclL); mcl.loadClip("print_test.swf",target) //target is where you want it to load. Next you can do: mclL.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { amount = Math.floor(((bytesLoaded/bytesTotal)*100)); percent_text.text = amount; //assuming you have a text field called percent_text it will display the % loaded } Quote Link to comment https://forums.phpfreaks.com/topic/108238-solved-help-with-a-preloaded-for-loadmovie/#findComment-557944 Share on other sites More sharing options...
Edward Posted June 5, 2008 Author Share Posted June 5, 2008 Excellent, I will give that a try, thank you! Quote Link to comment https://forums.phpfreaks.com/topic/108238-solved-help-with-a-preloaded-for-loadmovie/#findComment-558101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.