Music With Preloader
Any contributions most welcome.
I have a movie clip, of only 356 bytes at this point, commencing with a preloader.
As part of the preloader a music file of 1.6mB loads via "loadMovieNum("music.swf", 1);"
The problem I have is the preloader only recognises the 356 bytes?
The preloader flashes on the screen, then sits there blank while the music file loads.
How can I get the preloader to recognise there needs to be about 1.6mB of download to complete.
Cheers
gmcallis
FlashKit > Flash Help > Flash General Help
Posted on: 02-08-2006, 07:25 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Music Preloader
Hello, I want to make a preloader that loads the music after the main site is completed loading. How is this done?
Preloader With Music
hi all,
You guys tell me how can we do this that in the first 2 frames the preloader should load the sound which I want in the background. Then after loadiing it completely it should start playing it and then jump to frame 10 where I have another preloader for the intro. In this way my music loop will be running in the backgorund and the preloader of the intro will be working fine as well. It should not preload the entire movie coz if it happened then it won't play the music in the preloader but will directly play the intro. How can we do this by actionscript? I guess I am clear with my scenario.
regards,
Bg Music With Preloader
I'm having some trouble here... I'm trying to create a site with background music. However, I want people to be able to select which song (out of 3 songs) will play. All that is simple enough. However, with the preloader of the entire movie/website, I am trying to preload all 3 songs. The songs are mp3 format. I am using loadSound(); to load the songs...
_root.backgroundSound1=new Sound();
_root.backgroundSound1.loadSound(Song1.mp3);
_root.backgroundSound2=new Sound();
_root.backgroundSound2.loadSound(Song2.mp3);
_root.backgroundSound3=new Sound();
_root.backgroundSound3.loadSound(Song3.mp3);
Everything works fine. So you can basically ignore the introduction above. My problem is this... Loading 3 separate songs is a pain and a half for users. The load time is enormous. The way it's set up right now, users would have to wait for their comps to download all three songs before the movie starts playing. That's not a huge issue for people on T3 lines, but it's a pretty long wait for anyone with dsl/cable, not to mention the time it would take for someone on dialup.
Any suggestions/alternatives? Help is much appreciated.
Thanks in advance,
Hailer
Preloader For Music
Hi every1, I did post this q. in the past but I did not understand what to do, so here I go here.
I want to load music into a site, it is not with the main swf but a single swf, I have a preloader in 1 scene and the music in other scene, the preload time is 32 sec. but for a reason I dont see the preloader during the preload of the swf.
Can any1 help ???
Thanks,
Diego
Here is the .fla file
www.djaitt.com/musicBar.fla
Preloader Music...
How do I add music to a preloader? i tried putting the music on the same frame as the preloader and it didn't work.. and i tried putting it on a new layer in the same frame # as the preloader but satill doesn't work...
any suggestions??
Music And Preloader Problem.....
OK this is the problem.....
I put the preloader on the Flash site (170kb). Site has a music which turns on automaticly when 2. frame loads. This is the script on second frame:
stop();
firstSound=new Sound();
firstSound.attachSound("firstSound01");
_root.firstSound.start(0.05,9999);
playing=true
I put the preloader on the first frame and everything else on the second. But when I press ctrl+enter and try it with 'show streaming' my preloader shows up after 64kb of loading on the first frame. So I looked at the graph and saw that my first EMPTY frame (exept preloader) has 64kb. I tried everything to make that 1. frame smaller and find the solution, the solution was to turn off option 'export in first frame' for my music file in 'linkage' properties of that music file in library.
When I turn off that option my preloader works fine and 1. frame is about 4 kb, preloader is there all the time of loading...... but my music won't load when the site (2. frame) is loaded ?!?!?
How to make that preloader work fine and make it show all the time of loading and make the music play on the 2. frame ??????
Music And Preloader Problem.....
OK this is the problem.....
I put the preloader on the Flash site (170kb). Site has a music which turns on automaticly when 2. frame loads. This is the script on second frame:
stop();
firstSound=new Sound();
firstSound.attachSound("firstSound01");
_root.firstSound.start(0.05,9999);
playing=true
I put the preloader on the first frame and everything else on the second. But when I press ctrl+enter and try it with 'show streaming' my preloader shows up after 64kb of loading on the first frame. So I looked at the graph and saw that my first EMPTY frame (exept preloader) has 64kb. I tried everything to make that 1. frame smaller and find the solution, the solution was to turn off option 'export in first frame' for my music file in 'linkage' properties of that music file in library.
When I turn off that option my preloader works fine and 1. frame is about 4 kb, preloader is there all the time of loading...... but my music won't load when the site (2. frame) is loaded ?!?!?
How to make that preloader work fine and make it show all the time of loading and make the music play on the 2. frame ??????
Music Preloader Problem
Hey,
-i'm having a problem with a preloader for sound...there is an attached FLA.. THe music does load in, but it is not playing when it finishes loading like it is supposed to. For some reason, you have to click the on/off button now to get it tot work.. Plus, there's a preloader that's supposed to show the load status.. Once the sound is fully loaded, it should auto-play, the preloader should disappear, and the music on/off button should appear..
any ideas?
if you dont wanna check the FLA, here's the script. THis is all on Frame one of the main movie
Code:
//bgMusic
bgMusic = new Sound();
bgMusic.loadSound("http://www.psiconmedia.com/audio/darkTunnel.mp3", false);
//variable for music playing or not
var playing = false;//bgMusic Preloader
//music preloader
this.onEnterFrame = function() {
_root.music._visible = false;
_root.musicLoader._visible = true;
mTotal = _root.bgMusic.getBytesTotal();
mLoaded = _root.bgMusic.getBytesLoaded();
mPercent = (Math.ceil(mLoaded/mTotal)*100);
//_root.musicLoader.mFiller._xscale = mPercent;
if (mPercent<100) {
_root.musicLoader._visible = true;
_root.musicLoader.mFiller._xscale = mPercent;
} else if (mPercent>=100) {
_root.musicLoader._visible = false;
_root.music._visible = true;
_root.bgMusic.setVolume(130);
_root.bgMusic.start(0, 999);
_root.playing = true;
delete this.onEnterFrame;
}
};
thanks,
-myk
Music Problems With A Preloader
hello all, hoping you could help me out. I'm a college senior and I'm just getting started with flash. I'm making a webpage for a friends band and I have some of their music in a intro. The music works fine for the intro alone. Because the file is big I added a preloader and now the music won't work. I emailed one of my profs and he had the same problems sometimes but didn't know what the solution was so suggested asking the flashkit forum. So if anyone can help me out, that'd be great.
Music Lags Even Though I Have A Preloader
i have made a simeple intro for my dad's restaurant's website. there is music in the background, i have a preloader that works fine, but my movie lags when it is playing, it sometimes skips a few frames. I think it is because of the music. Any thoughts?? I downloaded the song from a cd and then used real time player to import it into flash.
my intro is at www.geocities.com/reshamrd
Streaming Music With Preloader
I have created quite a large site at elevateyourworld.com so I put a preloader on it. I want a music on off button, how can I have the music streaming when they click on it and not have to make the preloader load the music too? (it makes it take like a minute to load) any suggestions?
Problem With Preloader And Music
Hi!
I have this code that I got it from ActionScript 2.0 Dictionary.It is suppose to preload externals mp3 files.
var songTrack = new Sound();
checkProgress = function(soundObj) {
var bytesLoaded = soundObj.getBytesLoaded();
var bytesTotal = soundObj.getBytesTotal();
var percentLoaded = Math.floor(bytesLoaded/bytesTotal * 100);
pLoaded = "%" + percentLoaded + " Loaded";
soundBar._xscale = percentLoaded;
}
songTrack.onLoad = function () {
clearInterval(poll);
}
songTrack.loadSound("plastic.mp3",true);
var poll = setInterval(checkProgress,10000,songTrack);
but the time line passes through and doesnt show the progress bar neighter the percentage.
IF I put a stop() at the end I can see the percentage but it's too slow.
What I want is to load my 2 mp3 files before the movie starts so I can play them in my main movie.
Right at the 5th frame of my main scene I have a script to start the sound.
onClipEvent(load) {
mp1._alpha = 100;
mp1.play();
mp2._alpha = 0;
mp2.stop();
soundurl = "plastic.mp3";
mySound = new Sound();
mySound.onLoad = function(success){
if(success){
this.start(0, 999);
}
}
mySound.loadSound(soundurl, false);
}
This is the code before I use the mp3 preloader.I need to find a way to play it
without any interruption.
can YOu guys help me out?PLEASE,I've trying this for so long.
Eduardo Tavares
My project : www.eduardotavares.com.br/main.html
Problem With Preloader And Music
I can't get my flash to work if I have both... I am using this code for the preloader in Frame 1:
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);
}
Frame 2 is:
gotoAndPlay(1);
And this code for the music in Frame 3
mySound = new Sound();
mySound.attachSound("hui_dao_guo_qu");
var soundPlaying = false;
sound_btn.onRelease = function () {
if(soundPlaying) {
mySound.stop();
soundPlaying=false;
} else {
mySound.start();
soundPlaying=true;
}
}
Here is the problem:
If i set the linkage for the mp3 to Export in First Frame. then the preloader wont work.
If I set the linkage to not export in first frame, the preloader works but the song wont play!
ARG! Any help would be appreciated...
Music And Preloader Problem.....
OK this is the problem.....
I put the preloader on the Flash site (170kb). Site has a music which turns on automaticly when 2. frame loads. This is the script on second frame:
stop();
firstSound=new Sound();
firstSound.attachSound("firstSound01");
_root.firstSound.start(0.05,9999);
playing=true
I put the preloader on the first frame and everything else on the second. But when I press ctrl+enter and try it with 'show streaming' my preloader shows up after 64kb of loading on the first frame. So I looked at the graph and saw that my first EMPTY frame (exept preloader) has 64kb. I tried everything to make that 1. frame smaller and find the solution, the solution was to turn off option 'export in first frame' for my music file in 'linkage' properties of that music file in library.
When I turn off that option my preloader works fine and 1. frame is about 4 kb, preloader is there all the time of loading...... but my music won't load when the site (2. frame) is loaded ?!?!?
How to make that preloader work fine and make it show all the time of loading and make the music play on the 2. frame ??????
Music Clip In Preloader
I have a pre loader in my site that loops frame 2 and 3 untill site is loaded.
I have added another layer called music and put a sound clip that is about as long as the loading process, but because the preloader loops the sound clip keeps looping frame 2 and 3.
Once the pre loader is done frame 5 starts the movie at which point I want the sound to stop.
please help
Nick
Preloader Woes With Music/soundfiles
Hi everyone,
I've made a SWF file which uses sounds that have to export in the first frame.
The only external preloaders I've seen load the movie into a blank clip in the first frame.
This is, I assume, so that you can check the bytes loaded of a clip.
When I do this, however, my movie ceases to function unless
I change all of its code to _level0.CLIPNAME.etc...
so, I grit my teeth and changed all of the _root code to _level0.CLIPNAME code... then, it all worked except none of the sounds would play!!!
so,
is there a way that I can make a preloader function if I load the SWF onto the _root of my preloader? if not, how the heck will I get any of it to function?
Preloader For Multiple Swf Music Files
ok i guess i didn't eplain well enough the first time, here it goes again, bear with me i typed it for an email so excuse the "you's"
i am very stumped with a problem i have and i was hoping you could help. My dilema is that i am making a music player with around 51 songs, but the songs are about 2to 5 mb each so i wanted to add a preloader for them, the first part of this prroblem is that i am using a swiftmp3 equalizer so i am pretty sure that you have to use a loader.loadmovie function to make the equalizer work, correct me if i am wrong, secondly i am trying to make a preloader for multiple .swf's so that all can use the same one, as you can see it would get very time and space consuming with 51 songs but it is hard to interpret all this coding as i am a complete noob when it comes to action scripting. I don't even know what a MyCache is. I have a preloader made but i can't seem to get it to work for what i am trying to do. Here is what i want to happen:
Click on a number >
Display Loading Bar for external swf >
Once loaded display song info and have working equalizer
So basically i want a version of your external preloader that works for 51 songs that also work for the SwiftMP3 equalizer bars. Since i am such an idiot when it comes to hand coding i was hoping you could help me out alot,
Music Player Preloader Gone Mental
I know there is like 1 million threads on preloaders but this is just mentalist I made a real simple preloader that just says the percent laoded but it doesnt come up just waites ages for it to finish loading and then the music player frame comes up.
Music Screwing Up Preloader - Urgent
I managed to succsesfully make a preloader whoo!!!! been trying for ages but then the second I add music to play on a button click on frame 3 which it goes to whenn loading is finished, the laoder stops working and then when u view it it just spends ages loading with a blank screen and then when its fnsihed loading just goes stright to frame 3. I think I figured out that it was because in the linkage for the music I had "export in first frame" ticked but then when I untick it, the music doesnt work anymore
Urgent help needed suposed to have finished this ages ago
Preloader For Loading Music Dynamically...
Hi,
I am interested in making a preloader for sound I intend to load dynamically into flash. I broswed the kirupa tutorial written by Pom on loading techniques, and certainly looks the best way to load in sound.
I am not sure how I would go about making a preloader for sound that I am loading in - by preloader I mean like displaying percentage or a bar realtive to progress- if this is possible. I don't want to stream it.
This is slightly similar to loadmovie and I made a preloader for that by using an "OnClipevent". How would I do this for music I am loading Dynamically?
could I use the sound object, target the mp3 into a movie clip and then use basically the same code?
I could add the music to a .swf then just load in the .swf but that is kind of "messy"
Problems With Preloader And Music Exporting
I'm making a flash to sample music for some family on the other side of the world and came across 2 problems.
I'm using Flash 8, but I think I was using MX scripts for the preloader and Flash 5 for the play/stop buttons.
Preloader:
Ok, when I view my Preloader with the Bandwidth profiler and then Simulate a download, it shows the gray bar with the text and all of that like normal. BUT, the bar shows up full and the text says NaN%. When I look at the Bandwidth profiler, I see it's clearly doing its job preloading the flash, but the bar and text doesn't show it. I'm using the Basic Flash preloader off of http://www.gotoandlearn.com The code I'm using is:
On the first Actions Frame:
var amountloaded:Number = _root.getBytesLoaded()/_root.getBytesTotal();
preloader._width = amountLoaded * 200;
loadText.text = Math.round(amountLoaded * 100) + "%";
Second frame:
if(_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay(3);
}
else {
gotoAndPlay(1);
}
For the sound I have two buttons, a play button with this code:
if(_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay(3);
}
else {
gotoAndPlay(1);
}
and a stop button with this code:
on (release) {
stopAllSounds();
}
And I have a sound file in my Library. I used to have the WAV file set with the linkage name and had "Export on First Frame" checked when I set it to "Export for Actionscript". When I did it like that, it used to play the sounds really well, BUT it conflicts with my Preloader, which is INCREDIBLY ESSENTIAL!!!!
But if I uncheck the "Export in First Frame" box, the sound cannot be heard at all. And when I check the bandwidth profiler, the music file doesn't even show up at all!
Any help explaining any of the above would be appreciated so much!!!
Help: Song Preloader In XML Music Player (MX)
Hey all
I have attached an FLA (MX) of an XML music player I am working on. I did not create the music player, but have been tweaking it.
Basically, I just want a preloader of some kind (any kind!) to indicate that a song is being loaded when a user clicks on a track. As it is now, there is nothing to indicate this, and so it seems to the user that the music player has locked up. I don't care if it's a percentage bar or simply the word "loading" blinking on and off.
I have dug around the code and it seems that there is a preloading component in place, but for whatever reason it's not working. And I am not too sharp with AS, so I am not sure where to start to begin making a new one (or fixing what is there).
Any help is appreciated.
Thanks.
Help: Song Preloader In XML Music Player (MX)
Hey all
I have attached an FLA (MX) of an XML music player I am working on. I did not create the music player, but have been tweaking it.
Basically, I just want a preloader of some kind (any kind!) to indicate that a song is being loaded when a user clicks on a track. As it is now, there is nothing to indicate this, and so it seems to the user that the music player has locked up. I don't care if it's a percentage bar or simply the word "loading" blinking on and off.
I have dug around the code and it seems that there is a preloading component in place (
"player" movieclip, actions layer, frame 3), but for whatever reason it's not working. And I am not too sharp with AS, so I am not sure where to start to begin making a new one (or fixing what is there).
I was having trouble with attachments, so here is the FLA to download in case the other doesnt work:
http://braillemedia.com/player_dm_songsviolin_sm.fla
Any help is appreciated.
Thanks.
Music Player Preloader Gone Mental
I know there is like 1 million threads on preloaders but this is just mentalist I made a real simple preloader that just says the percent laoded but it doesnt come up just waites ages for it to finish loading and then the music player frame comes up.
Music Screwing Up Preloader - Urgent
I managed to succsesfully make a preloader whoo!!!! been trying for ages but then the second I add music to play on a button click on frame 3 which it goes to whenn loading is finished, the laoder stops working and then when u view it it just spends ages loading with a blank screen and then when its fnsihed loading just goes stright to frame 3. I think I figured out that it was because in the linkage for the music I had "export in first frame" ticked but then when I untick it, the music doesnt work anymore
Urgent help needed suposed to have finished this ages ago
Music Does Not Play.And Preloader Does Not Work
Could You take a look at my project and see why the song is taking too long to start and how to solve this problem?
The sound is supose to start when the girl starts to dance.
this is the code I am using on her MC:
onClipEvent(load) {
mp1._alpha = 100;
mp1.play();
mp2._alpha = 0;
mp2.stop();
soundurl = "plastic.mp3";
mySound = new Sound();
mySound.onLoad = function(success){
if(success){
this.start(0, 999);
}
}
mySound.loadSound(soundurl, false);
}
and Again my preloader does not work anymore even loading the sound externally.
PLEASE What should I do?
I've struggling in this project for 3 weeks and I cant get any help.
Integrating Background Music Into Preloader
I'm new to Flash and ActionScript. I have recently completed some online training and I'm working on my first site.
http://www.installingdealers.com
I have the BG music stored in a SWF called bgmusic.swf located in the same directory as the main SWF. Here is the code I'm using for the preloader...
Code:
onClipEvent (enterFrame) {
_parent.loaded = _parent.getBytesLoaded();
_parent.total = _parent.getBytesTotal();
if (_parent.getBytesLoaded() == _parent.getBytesTotal()) {
_parent.nextFrame();
}
}
I'd like for the external bgmusic.swf file to load prior to moving the playhead to frame 2. I tried putting the bg music on a layer within the main FLA but I had other issues that I couldn't sort out. After turning off music, the music would restart when I clicked a link that took me back in the timeline.
Thanks in advance! :D
Problems With Music Player Buttons And Preloader
ok i have made 52 movieclips for each one i want to make a button, so there are 2 layers inside each movie clip i was thinking that if i put this in the movie clip where the buttons are but the action scripting i got from this guy i think won't work because it says _root and doesn't this mean that these buttons would have to be in first movie clip? here is the A/s for the movie clips that i am gonna use
MovieClip.prototype.Pressed = function() {
this.onPress = function() {
newThis = this;
_global.oldThis.play();
this.gotoAndStop(2);
};
};
_root.box1.Pressed();
_root.box2.Pressed();
_root.box3.Pressed();
_root.box4.Pressed();
then in each button in frame one i would put
stop();
and in the second frame i would put
stop();
_global.oldThis = this;
Also i am having problems with the preloader there is no problems with teh action scripting but i uploaded the player with one song linked to an external swf and the preloader didn't show up(this was when there was firework buttons there and i changed to movieclips so that the image would show for each song after click until you click a different song)
So if some one could please take a look at the attached fla and make it so the loader shows up and just do one or 2 buttons so i could use them as an example i would appreciate it very much and if you don't want to do that then just tell me how to fix these problems by takin a look at the fla, i am also gonna try and attach 2 swf files so that you can externally link them so you can see if the preloader works.
Thanks a bunch
Joe
[F8] Preloader Loading Problem/ Synching Of Music On MC
Here is my problem, my mc works perfectly on when I run it off and play the swf off of my computer, but then I put it online, and the music isn't synchronized anymore... any ideas? Any help? it is not supposed to play until the whole file is downloaded, so I don't know what to do.
I was having problems with the scenes and the preloader at first...
here is the script for my preloader:
PHP Code:
totalBytes = getBytesTotal();
loadedBytes = getBytesLoaded();
percentage = Math.ceil((loadedBytes / totalBytes)*(100));
if (totalBytes == loadedBytes) {
discus.gotoAndStop(1);
gotoAndPlay(3);
} else {
gotoAndPlay("scene 3", 1);
}
Thanks!
HELP Preloader Doesn't Preload Mc's That Will Load Music,AS Etc..
i have about 10 mcs in the stage that will load music in volume0 cause i'm gonna start them later..
my preloader used to work well before i add those mcs and some other stuff that will load in stage (swfs etc)
now i can see the preloader just in 99% and then the movie starts!
i tried a lot of preloaders with no luck ,the same thing happens
i'm sure that is because of the mcs with the music and the AS that calls swfs to load on the stage
so the preloader doesn't see a lot of stuff in the main movie timeline (where the preloader goes) and get confused...
what to do??
it was a well made preloader with mask but right now i don;t care much ,i need something to preload the 600kb content..the visitor will see just a blank movie (as it loads) and will go
i had a tricky program in the past (swf lock&load) that does external preloaders
it worked,preloaded the main movie BUT ALL the sounds that supposed to load in mcs disappeared
so i'm sure that the problem is there..
what should i do?
How To Change Buttons On Music Player Depending On Whether Music Is Playing Or Stoppe
When my music is playing, I want my play button to be blackened in. When the music is stopped, I want my stop button to be blackened but my play button to go back to it's original state.
Right now, when my cursor is over the button, it will change the rollover state. That's easy to do.
How can this be accomplished...do i need multiple layers?
Can I Loop A Specific Section Of Music In Flash After The Music Intro Plays?
Hi! My question involves looping audio in flash. I already know how to make a section of audio in an audio-editing program that loops and make it loop continuosly in Flash. What I would like to do now is take an audio clip that has an intro section and a "body" section and after the intro has played, loop back to the beginning of the "body" section continously. I assume it would involve sending it back to a specific millisecond?
Anyway, can anyone help me out with this one? Or is it even possible?
Thanks,
aswhitehead
How To Make MC Clip Play When Music Starts, Stop MC When Music Stops
Hey,
I've got a audio player on my flash website and I want to have a audio spectrum analyser (those little squares that move up and down randomly) start playing when the user starts playing music and then stop when they stop the music.
Is there a simple way to do this?
Cheers
Max
Display Music's Details As The Music Playing?
Hi
I saw something similiar at Flashkit - Sound FX, when you click on it, you would be able to play the music yet at the same time, display the music "detail", when the it high tone, the display go up high when the tone is low, the display go down?(Hope im not wrong in describing it)
http://www.flashkit.com/soundfx/Interfaces/
Can someone teach me how it work? Thanks
Preload Music And Fade In Music
Hi, i'm looking for a script that preloads my music. once it's loaded it should start playing the music with a fade in.
Anybody can help me with this. My actionscript-skills are very poor.
This is the code that i'm using for the moment, without preload and fadein. It uses a random of 3 tracks.
Loops = new Array("track01.mp3","track02.mp3","track03.mp3");
choice = random(Loops.length);
mySound = new Sound();
mySound.loadSound(Loops[choice], true);
thx
scarlac
How Do I Make A Fast And Easy Preloader Or A Hard Cool Looking Preloader
how do i make a preloader?? ive went thru many toutorials and they dont make sense to me i want a cool looking preloader if i can but if not!! a preloader that is jest flashing the words "loading" would be nice to know how to make....
im kinda new to flash MX and all Flash programs so could u explain verry well???
Preloader Not Showing In The Beginning? Did I Make The Preloader Wrong?
alright, it seems that my preloader does not show until the movie is about 85% loaded, and then after that it works fine. but how do i get the preloader to show from the begining? here is the site...
http://www.trikenit.com/6n/preloader.html
and here is the fla for the preloader
http://www.trikenit.com/6n/preloader.fla
if anyone could help me out with my preloader i would be so very grateful. thank you in advance.
Preloader For Importing Swf - Join To Initial Preloader On Level0
Hi all,
I have looked on many forums in order to sort this problem but can't quite get there.
I have a main movie (presentation.swf) which is a presentation which runs for about three minutes. After about a minute into the presentation it imports a swf (base.swf - placed onto level1) into the movie which then jointly runs together in realtime with the _root level0 movie. It all works fine. I have created a preloader on the root movie (presentation.swf - level0) which is OK but I can not work out how I can add the second swf (base.swf) onto the initial preloader. The problem is that I have lost the fla file of the base.swf file so can not add a preloader or any extra actionscript onto the base.swf file.
I have tried to see if by checking if level1 is loaded
Code:
if (_level1.getBytesLoaded() == _level1.getBytesTotal()){
_root.gotoAndPlay(20);
}
I have also tried to create a third swf which imports both the presentation.swf and base.swf but failed to produce anything.
The preloader that I have works well by its self. The code is shown below
Frame 4
Code:
_root.loadPercentage.text = "0";
_root.loadedBytesText.text = "0";
_root.ofLoadedBytesText.text = Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000;
Frame 5
Code:
_root.loadPercentage.text = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() * 100));
_root.loadedBytesText.text = Math.round(((_root.getBytesLoaded() / 1024) * 1000) / 1000);
_root.ofLoadedBytesText.text = Math.round(((_root.getBytesTotal() / 1024) * 1000) / 1000);
// START OF WORKING OUT TIME REMAINING
counter = counter + 1;// the counter incrementing 12 times (12 - set by stage)a second
seconds = counter/12;// Converting the counter into Seconds
timeMinRemaining = Math.floor(((seconds/(Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100))*100)-seconds)/60);
timeSecRemaining = Math.floor((seconds/(Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100))*100)-seconds) - (timeMinRemaining * 60);
_root.TextTest1.text = timeMinRemaining;
if (seconds == Math.round(seconds)) {
if (timeMinRemaining == 0) {// If No minutes remaining then display only minutes remaining
_root.minRemainingText.text = "";
_root.minRemainingLabel.text = "";
_root.secRemainingText.text = timeSecRemaining;
_root.secRemainingLabel.text = "sec";
} else {// If MORE THAN 0 minutes remaining then display minutes and seconds remaining
_root.minRemainingText.text = timeMinRemaining;
_root.minRemainingLabel.text = "min";
_root.secRemainingText.text = timeSecRemaining;
_root.secRemainingLabel.text = "sec";
}
}
if (_root.getBytesLoaded() == _root.getBytesTotal()){// REDIRECT TO START OF SCENE
_root.loadPercentage.text = "100";
_root.loadedBytesText.text = Math.round(((_root.getBytesLoaded() / 1024) * 1000) / 1000);
_root.ofLoadedBytesText.text = Math.round(((_root.getBytesTotal() / 1024) * 1000) / 1000);
gotoAndPlay("PreloadComplete");// The preloader was used, therefore goto Close of Preloader
}
Frame 6
Code:
gotoAndPlay(5);
Please I would appreciate your help
Thanks
Preloader Issue - Code Is Correct, But Preloader Is Flakey
I'm using Flash MX 2004 to develop a flash-based website.
There is one main movie, and several external .swf's that are loaded into the main movie as needed.
All movies have a basic preloader, created as follows:
All movies have 2 scenes.
The first scene contains the preloader, which is 3 frames in total.
Frame 1 contains the following script:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
Frame 2 contains the following:
this.gotoAndPlay(1);
Frame 3 is blank.
There is a 2nd layer which contains a dynamic text box which calls the variable "loadText".
This preloader works great in the main movie. The main movie contains buttons which call external SWFs to be loaded into a holder MC on the main movie's timeline. When I load an external SWF into my main movie, the preloader doesn't show up at first. At about 60%, the preloader FINALLY shows up and counts the last 40% before the movie plays.
After several attempts, I noticed that the problem is not with the code itself, but might have something to do with the amount of data loaded into frame 1 of my movies.
Using the debugging tool, and looking at the graph that Flash provides when previewing a movie, I noticed that my main movie contains about 5kb of data in Frame 1, and as mentioned above, the preloader works just fine.
When previewing each of my external SWFs separately, I noticed that the amount of data on Frame 1 of those movies is much greater - 101kb.
After searching the help files, I read somewhere that Flash MX 2004 loads certain data into the first frame of the movie by default, and I'm guessing that THAT is what's causing the preloader not to show up instantly.
Would appreciate any help in clarifying this issue, as the site is completely done except for this preloader problem.
TIA.
Large Movie Preloader /External Preloader Question...
I have a fairly large movie (about 380KB) with a status bar preloader in the first frame. The problem is that I load a few of the MC's in the movie into ScrollPanes and then don't work unless I export them on the first frame (these MCs make up about 200KB). Therefore, there is no flash shown until it has loaded up about half way.
I tried to use an External Preloader, but that loaded the MC on level 1, and no buttons or functions within the entire movie worked properly.
My question is, is there a way to either use the external preloader and swap (or reload) the movie on level 0, or does anyone know a way to load the MCs on another frame other than 1, but before they load to the Scroll Pane? Any other ideas would also be appreciated.
Thanks!
Complex Preloader - Load Multiple Movies W/ One Preloader
Hello to all!
I haven't asked a good question in quite a while so here's one.
I know how to create a general preloader fairly well. What I want to do is take it one step further.
I want a preloader with a status bar...but here's the caveat...I want it to load multiple external movies instead of just one. So it would load one after another and show the status of each.
I can't think of a site off the top of my head, but it would show loading and then it would load...say audio player...shows text "Loading Audio Player" and then shows loading progress...and then...image loader...shows text "Loading Image Loader" and then shows loading progress, etc.
You get the point.
Any takers?
Thanks.
Fuse And Preloader: ZigoEngine.register() Slows Preloader
Here's something I came across and am wondering if anyone ran into this issue and found a workaround.
- My entire SWF is 200kB in size.
- I have a preloader on the first frame of my movie and its an animation which is about 24kB big.
- The rest of the content is on the third frame of my movie and also on the third frame is where I register the ZigoEngine.
Now, here's what's happening:
- The preloader doesn't show right away. There appears to be some 65kB-70kB added on the first frame when I register the ZigoEngine for Fuse.
- When the preloader shows, it's already at around 44%-50%
- If I remove the code where I do the registration, the preloader loads fine.
I am guessing the overhead is happening because the registration is global. But, is there a way I can fix this or is it impossible considering the nature of the Fuse registration call?
Preloader-moving On To An Actionscript Based Preloader
Most of the sites I have designed have just used an "if frames are loaded preloader". However, I want to get a more effecient preloader by using the _framesloaded and _totalframes properties of the movie to give a more accurate preloader . I was wondering if anyone knew where I can find a good tutorial or see an example of an FLA that uses this style actionscript based preloader.
Please let me know so I can start working on figuring this out!
Thanks Dave
Actionscripted Preloader Content ....egomedia Preloader
I have aquired a preloader, it is the egomedia preloader by unclickable. I have the .fla if required...problem is that the content is an actionscripted animation. Now how the hell do I add actions to the .fla to make it operate as a preloader..The .fla basically is not a preloader but just a animation there are no references in the code to ifframesloaded etc..I would appreciate some help ..like I say I have the fla and could mail it to whoever..All someone could do is pop the actionscript in for me and explain to me how it works..thanks in advance
How Can I Make A Second Preloader Play If A File Is In The 1st Preloader?
OK I'm going to try to explain this
I have a preloader on my main movie to preload external files. This preloader preloads the external files and places them into a empty movie clip.
What I would like to do is have 2 preloaders if the 1st preloader was used, I would like the second preloader to be used there on after.
I'll try to explain what is happening I have 3 buttons to load 3 external files on a blank MC if a external file is present on the MC I what to use a second preloader. I need to use a second preloader because the first preloader is a progress bar that goes across the whole MC. If a external file is on the main I want to use a smaller progress bar.
If you have any suggestions I would appreciate your help
Thanks
Preloader Inside Preloader Type Thing
Hi,
I've got like a main page that has a preloader in a different scene. And in the main page I call loadMovie on first frame that load external swf that has same structure - preloader scene with a main scene (content for the main page) ... but the first preloader seems to wait to load the actual page and the external swf before if finishes. Why is the first preloader not just preloading for the home page and then once u are there the other preloader kicks in and loads the content??? Also the preloader seems to have a wait till 20 % before it actually appears on the screen how is that?
code is
frame 1
-----------------------------
total_bytes = _root.getBytesTotal();
kb = int (total_bytes/1000)
loaded_bytes = _root.getBytesLoaded();
kb_loaded = int (loaded_bytes/1000);
remaining_bytes = total_bytes-loaded_bytes;
kb_remaining = int (remaining_bytes/1000);
percent_done = int((loaded_bytes/total_bytes)*100);
bar.bar2.gotoAndStop(percent_done);
ifFrameLoaded ("main", 1) {
gotoAndPlay ("main", 1);
}
--------------------------------
frame 2
gotoAndPlay(1);
Cheers
|