Whereabouts in the .fla do you put the pre-loader?
#1
Posted 30 January 2007 - 10:19 AM
one before) -
But my question is...
How do you actually get it into your .fla file...like...is it a Movie
Clip...or a separate .swf...? Does it go in the main timeline? How do you
get it in there?
Regards
Crosbie
#2
Posted 30 January 2007 - 10:59 AM
How do you have your website built? Are you using a shell that contains the navigation and then loading the content into a holder movieclip? If so, the movieClipLoader class would work well for you. If not, then I'll show you a way to do it at the start of every swf you load up. Sucks to do it that way because if you need to make a change to the loader, youll have to make it in every swf. I'll try to keep it simple for you.
Edit:
Threw together a quick loader for you during lunch...I doubt I'll have time to do anything tonight. Anyways, I'll give you a quick overview of the code.
stop(); // Stops the movie from progressing (dont want it to play until its loaded)
// onEnterFrame will keep firing until the entire movie is loaded, then it is deleted.
this.onEnterFrame = function():Void{
var mcClipToLoad:MovieClip = this; // equals this because it is the movie the code is placed in for the preloader.
var mcLoader:MovieClip = this.loader_mc; // the loader movieclip that I made...top quality graphic skills there, eh? lol...
var mcLoaderText:MovieClip = mcLoader.loadText_mc; // movieclip that holds the text % display
var nTBytes:Number = mcClipToLoad.getBytesTotal(); // gets the total size of the swf to load
var nLBytes:Number = mcClipToLoad.getBytesLoaded(); // gets the current download progress
var nPer:Number = (nLBytes/nTBytes) * 100; // divide current download progress by the total filesize to get the downloaded percent.
// trace(nPer); // for debugging purposes
mcLoaderText._alpha = nPer; // sets the alpha of the loaderText mc...its my fancy animation of the loader :)
mcLoaderText.perTxt.text = Math.round(nPer) + "%"; // rounds the nPer variable to the nearest whole number
if(nPer >= 100){ // if nPer is higher than or equal to 100, the swf has finished downloading and can continue to play.
delete this.onEnterFrame; // removes the onEnterFrame so your movie can progress.
mcClipToLoad.gotoAndPlay("start"); // label I put on the timeline...its where I would like my swf to start playing.
}
}
I attached the .fla so you can see exactly how this works. I had to throw an image in there to give it somthing to download when I tested it
All this goes on the first frame of the movie...so its easy to drop into any files you currently have. I suggest you replace my crappy graphics tho...I am a developer, which means things like social skills and graphic design are lacking! Make sure you update the variables that point to the loader movie clips if you want stuff to work.
Post back if you have any trouble...good luck.
Attached Files
Edited by Pax, 30 January 2007 - 01:23 PM.
#3
Posted 30 January 2007 - 06:48 PM
With regards to your question, I'm not sure what type of website
I've built - It started off as a keyframed animation which became my
website - i.e. home page, sound track in the background & 6 buttons
which on release go to next frame, etc.
My layers:
Actions (btn.onRelease etc)
Labels (Home, Mission, etc
Sound (MP3)
Content (MC in Fr.1). Text with button actions to go to next frame)
Buttons (6 of these)
Street (background)
252 frames in total (42 frames x 6 layers?)
Not sure if I've answered your question correctly.
Looks like I'm going to be up most of the night!!!
Cheers and many thanks
Crosbie
#4
Posted 30 January 2007 - 07:23 PM
#5
Posted 01 February 2007 - 07:11 PM
trying to see where I've gone wrong...
I imported my .swf (my website) into Frame 2 of the Loader layer.
Clicked 'Test movie', then 'Simulate download'.
The percent bar loads...then my movie whizzes through the timeline
without stopping at the home page - all in about 2 seconds. No
sound and no Button actions either.
Before that, I'd attempted to build a simple loader from scratch...just
to try and get an understanding of the mechanics of how to make
one - Janet & John style - the bar worked nicely....but my movie
didn't show up at all!
And before that one...I made a loading bar that just stuck to the
website - nothing would move.
Do I have to adjust the code at all to correspond to the code in my
movie? btw, what does nPer mean?
Sorry for the daft questions,
Regards
Crosbie
#6
Posted 01 February 2007 - 09:17 PM
change the "mcClipToLoad" to the instance name of hte mc you'd like to load, and the "start" to the labelname you want it to go and play. If you'd like to post your .fla I can take a look at it and show you what the problem is.
#7
Posted 03 February 2007 - 07:36 AM
and the "start" to the labelname you want it to go and play.
thanks...I tried this. The problem is I'm not sure what the instance name of the MC is.
I can now make a basic preloader (par excellence!!!) and I now understand a tiny bit
of the code...but when I insert my movie into the main timeline...test movie etc, none
of the buttons function...nothing animates. I just get a static.
I think one of the problems is when I import my .swf it seems to get wrecked in the
Library. It splits it up into little bits and some of the symbols and audio clips aren't there.
So, I tried another way...by inserting a Scene (for the preloader) into the original .fla...
same result...the preloader works...but my movie appears as a static...nothing happens.
***If you'd like to post your .fla I can take a look at it and show you what the problem is***.
I'd really appreciate this...do I have to post it to the forum? It's still on its leash!!!
Regards
Crosbie
#8
Posted 03 February 2007 - 12:50 PM
Crap! sorry mate, had a bit of a typo there...mcClipToLoad is the clip you've placed the preloader in, adn the label should be on that timeline.
If you can find somewhere to post your fla I can take a look at it...posting a zip on the forum would work if you are comfortable with that...if not, email it to me...my email should be in a profile or somthing somewhere....
Try to do it as soon as you can...I leave Thurs. night to go snowboarding in Banff (hurah!) So, I'm assuming you dont want to have to wait for me to get back after that for a bit of help
#9
Posted 05 February 2007 - 09:31 AM
Tried a couple of PM's...but my IE program doesn't seem to be
working within the P2L site...tried a 3rd time from another lap-top
but couldn't find a way of attaching the .fla...
Will try again this avo.
Crosbie
#10
Posted 06 February 2007 - 04:13 PM
mcClipToLoad.gotoAndPlay("start");
to
mcClipToLoad.gotoAndPlay("home");
Make a new layer, and add another keyframe in on the first frame, and paste the preloader from the above zip file.
That should make it work. Post a screenshot of the timeline if it doesnt work.
#11
Posted 06 February 2007 - 08:29 PM
Thanks for looking at this for me Pax...I've got almost all of it working bar 2 things: (I've highlighted in red the bit that I may not have followed correctly.)
After the ActionScript bit, this is what I've done:
1.Inserted new layer called 'preloader'
2.Imported "loader_mc" and "loadText" mc into Library (the ones from your zipped .fla)
3 Dragged "loader_mc" onto stage (this contains "loadText" mc right?) into 1st Keyframe of preloader layer.
4.Test movie: Output panel shows all the bytes loading.
5.View>Simulate download: Movie loads but percents don't move in the loading bar on the screen. Just stays at 100%.
6.Movie loaded ok.
7.Movie on screen - and green bar on bandwidth profiler - whizzes thru' timeline once then goes back to beginning and then plays ok.
Cheers
Crosbie
There should be a screen shot attached with this post
BTW...I can see Banff looming...this can wait 'til you're back!!
Attached Files
#12
Posted 07 February 2007 - 09:19 AM
Crosbie, on Feb 6 2007, 08:29 PM, said:
7.Movie on screen - and green bar on bandwidth profiler - whizzes thru' timeline once then goes back to beginning and then plays ok.
Seem to have lots of free time this morning. The project I'm on at work takes about 10 min every time I compile an fla. Gives me some P2L time.
In regards to your problems, yes loadText is inside the loaderMc, but make sure instance names are there. Names get removed sometimes when you copy and paste.
To stop it from playing through the whole movie, put stop actions at the last frame of each section. So on the 5th or so frame after each label, put a keyframe on the actions layer with a stop action in it. This should fix the problem.
#13
Posted 07 February 2007 - 04:48 PM
...was really stumped at one point 'cos the loading text still looked blank even after
I'd put in the instance name...but then on a second glance...I realised it was that
Alpha function that you'd put in...sort of fading in at 15%...and it was all working.
Thanks for helping me with this...I really appreciate it...
Hope it's good snowboarding in Banff...don't be away for too long...!!
Cheers
Crosbie
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
