Outline ·
[ Standard ] ·
Linear+
Flash AS3.0 Preloader problem, Preloader not working as it should
|
TSjunkieG
|
Mar 30 2011, 04:35 PM, updated 15y ago
|
|
Hi all, Another problem while building Flash AS3.0 Preloader. This is the script i got from the net. It was meant for picture file ie. Jpeg i think... QUOTE stop();
stage.addEventListener(Event.ENTER_FRAME, update);
function update(e:Event):void {
var loadedBytes:Number = stage.loaderInfo.bytesLoaded; var totalBytes:Number = stage.loaderInfo.bytesTotal;
progress_mc.scaleX = loadedBytes / totalBytes;
percent_txt.text = Math.floor((loadedBytes / totalBytes) * 100) + "%";
if (loadedBytes == totalBytes) { gotoAndPlay(5) ; stage.removeEventListener(Event.ENTER_FRAME, update); } } When I replace the Jpeg image with movie clip, the preloader gone cacat. I know this after simulating it under flash player. should if its not a movie clip, my preloader will working just fine What did i do wrong? attached is the project file for your perusal. Your assistance is highly appreciated. Please help Attached File(s)
preloader_problem.zip ( 298.66k )
Number of downloads: 8
|
|
|
|
|
|
oelalmas
|
Mar 30 2011, 05:33 PM
|
New Member
|
hi there i am not a flash progrmmer but what you can do is create 2 files one for preloader and the other for your movie clip/swf/jpg etc. it will save you time. http://biochimistu.blogspot.com/2008/03/pr...-gif-files.htmlthen the other as your movie file(eg:test.swf) the link above will help you undestand more....i am still using as2 since it's eqsier to get codes online. as3 is a pain for me to understand here is another link might help http://blog.newmovieclip.com/2007/04/30/mo...g-in-flash-cs3/try kirupa.com (forum) cheers
|
|
|
|
|
|
shinkawa
|
Mar 31 2011, 09:53 AM
|
|
i don have cs3 with me now.
have you check the
gotoAndPlay(5) ;
is it stoping at right place?
|
|
|
|
|
|
TSjunkieG
|
Mar 31 2011, 10:38 AM
|
|
hii shinkawa,
it is stopping at the assigned keyframe which is (5) however the preloader seems not to working properly.
@oelalmas, thanks, im looking at some of the tutorial. Personally I feel too technical for a designer like me. huhuuhhu!
appreciate you guys help!
|
|
|
|
|
|
mclelun
|
Apr 1 2011, 10:54 AM
|
|
looking at the quote, I assume there is no problem with the preloading script. The problem might be in other part. but I cant open your flash file to view it.
|
|
|
|
|
|
TSjunkieG
|
Apr 12 2011, 02:45 PM
|
|
hi mclelun,
do u need me to save it on different version of flash?
|
|
|
|
|
|
shinkawa
|
Apr 12 2011, 05:38 PM
|
|
QUOTE(mclelun @ Apr 1 2011, 11:54 AM) looking at the quote, I assume there is no problem with the preloading script. The problem might be in other part. but I cant open your flash file to view it. +1 this is my preloader code CODE bytes_loaded = Math.round(_root.getBytesLoaded()); bytes_total = Math.round(_root.getBytesTotal()); getPercent = bytes_loaded/bytes_total; _root.loadBar._width = getPercent*100; _root.loadText = Math.round(getPercent*100)+"%"; if (bytes_loaded == bytes_total) { _root.gotoAndStop(3); }
event listener kacau? did the previous movieclip got instance name?
|
|
|
|
|