| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Custom User Title
Join Date: Apr 2003
Location: Brighton
Posts: 589
|
preloader
hey guys. ok im alright at flash know the basics but F*CKing B*llocks (complete beginner) at actionscipting. i cant figure out why this preloader aint working. i think i got the scripting wrong from the GotoAndPlay blah blah blah can someone give me a point on where i went wrong and how to improve. Thank you for your time. http://homepage.ntlworld.com/dickson.mok/preload2.zip Dixon
|
|
|
|
|
|
#2 (permalink) |
|
Ur mother's ur brother?
Join Date: Jun 2003
Location: Liverpool
Posts: 880
|
you could try labelling the content frame "Last Frame" and then instead of the first lot of code you have in your preloader, just put... ifFrameLoaded ("Last Frame") { gotoAndPlay("content",1); } worth a try? in what way did the current one not work? ::: TC Magazine :::
|
|
|
|
#3 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,933
|
I happened to be playing around with preloaders yesterday (I'm also a know-nothing when it comes to Flash). I noticed that some function/scripts are deprecated in Flash MX, more specifically, the ifFramesLoaded method was listed as deprecated. I ended up using the following (more modern?) method: if (_framesloaded>=_totalframes) { gotoAndPlay("Scene 2", 1); } else { gotoAndPlay(1); } Not sure if this has an impact on the problem you're experiencing Dixon, but when I see words like deprecated next to some methods (i.e. ifFrameLoaded), it makes me think twice about whether it's going to work if published as a later version number. Just a thought. |
|
|
|
#4 (permalink) |
|
I Call Shenanigans™
Join Date: Feb 2003
Location: Manchester, England.
Posts: 9,740
|
You could use the preloader component, very easy but also cheating a bit : http://www.kirupa.com/developer/mx/p..._component.htm |
|
|
|
#5 (permalink) |
|
Christ on a bike
Join Date: May 2003
Posts: 3,311
|
Couldn't open dixons .fla but I've been using this sorta thing (obviously its somewhat different in that it displays a percentage value of what has loaded) onClipEvent (enterFrame) { loading = _parent.getBytesLoaded(); total = _parent.getBytesTotal(); percent -= (percent-((loading/total)*100))*.25; per = int(percent); percentage = per+"%"; loadBar._width = per; if (percent>99) { _parent.gotoAndStop(2); } } Think it was pinched from Kirupa or similar. Might give the _totalframes malarky a go tho, seems neat. |
|
|
|
#6 (permalink) |
|
Balinese Buddah Sensei
|
yah, I use the same one as tomson, although I usually have some sort of bar on the screen showing the percentage, for this example we'll pretend that our loading bar on the screen is 255 pixels long... and I'm a code centralization whore so..... it would look like: loader.onEnterFrame = function(){ loaded = getBytesLoaded(); total = getBytesTotal(); percent = (loaded/total)*100; loader._width = (percent*2.55); if (percent >=100){ gotoAndPlay("content"); } } audentes fortuna iuvat
Flatcat |
|
![]() |