Old 22-01-2004, 20:07   #1 (permalink)
dixon
Custom User Title
 
dixon's Avatar
 
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
  Reply With Quote
Old 22-01-2004, 20:33   #2 (permalink)
JiRaffe
Ur mother's ur brother?
 
JiRaffe's Avatar
 
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 :::
  Reply With Quote
Old 23-01-2004, 02:45   #3 (permalink)
Bill Posters
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.
  Reply With Quote
Old 23-01-2004, 03:54   #4 (permalink)
oli
I Call Shenanigans™
 
oli's Avatar
 
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
__________________
Linked In :: Last.fm :: Twitter
..................
  Reply With Quote
Old 23-01-2004, 03:55   #5 (permalink)
tomson
Christ on a bike
 
tomson's Avatar
 
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.
  Reply With Quote
Old 23-01-2004, 15:16   #6 (permalink)
flatcat
Balinese Buddah Sensei
 
flatcat's Avatar
 
Join Date: Jul 2003
Location: Vancouver, British Columbia
Posts: 765
Send a message via MSN to flatcat Send a message via Skype™ to flatcat
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
  Reply With Quote
Old 23-01-2004, 20:35   #7 (permalink)
dixon
Custom User Title
 
dixon's Avatar
 
Join Date: Apr 2003
Location: Brighton
Posts: 589
thx guys for all the help!
i finally got it working
__________________
Dixon
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8