Sound Preloader Problem
Hi,
I created a flash MP3-player for my band. Worked great, the nice function was that you could drag the slider to any given point in the track and the song would continue from that point (relaese).
Once i tested it online, it didn't work anymore. Logic, 'cause the events couldn't happen > not loaded. So i build in a preloader first. Now it worked again, but anyhow i define the preloader, now the the slider function refuses to work. I already spend days (believe me) on this matter trying to figger it out.
Is there anybody out there how wants to help me out ( for rock'n'roll's sake)
you can check it out here: http://www.carlosband.com/music/audioplayer.swf
If you want to look at it, use the butts in the list (play, pauze... don't work yet, neither do the playlist butts). The little green square is the (supposed to be) draggable stuff. If you drag it, you can see it move, but it will jump right back (even before release).
Much appreciated Koen
FlashKit > Flash Help > Flash MX
Posted on: 10-07-2003, 09:04 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loop Sound ( Sound Class Preloader By Moock)
how can i loop the sound if i use the sound class preloader by collin moock?? here its the code :
ActionScript Code:
Sound.prototype.checkLoadProgress = function() {
var kbLoaded = Math.floor(this.getBytesLoaded()/1024);
var kbTotal = Math.floor(this.getBytesTotal()/1024);
var percentDone = isNaN(Math.floor(kbLoaded/kbTotal*100)) ? 0 : Math.floor(kbLoaded/kbTotal*100);
this.onBytesLoaded(this.getBytesLoaded(), this.getBytesTotal(), kbLoaded, kbTotal, percentDone);
};
Sound.prototype.clearLoadCheck = function() {
if (this.loaderID) {
clearInterval(this.loaderID);
}
};
Sound.prototype.preloadSound = function(url, isStreaming) {
this.clearLoadCheck();
this.loaderID = setInterval(this, "checkLoadProgress", 200);
this.loadSound(url, isStreaming);
};
music = new Sound();
music.onLoad = function(success) {
this.clearLoadCheck();
if (success) {
loadMsg_txt.text = "Done loading.";
} else {
loadMsg_txt.text = "Load failed.";
}
};
music.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded) {
loadMsg_txt.text = "Loading: "+kbLoaded+" of "+kbTotal+"
"+percentLoaded+" percent complete.";
};
music.preloadSound("song.mp3", true);
thanks in advance
Does Sound Need A Preloader?
Does sound need a preloader? I have a sound in my movie that sounds scrambled and skips back. It doesnt play smoothly and I think it is not having time to fully load before playing. Please tell me how to do it right.
http://jay.moore.home.mindspring.com/hatchingmusic.htm
Sound In Preloader?
I have a preloader working just fine. However, i thought it could use some background music. The code i'm using is the simple 2 frame method--> Frame One:if (Number(_framesloaded)>=Number(_totalframes)) {
gotoAndPlay ("Movie", 1);
}
Frame Two:gotoAndPlay (1);
When I attach a sound, it does that "infinate echo thing" because flash is starting the sound over and over on top of itself everytime it goes back to frame one.
How can i get around that?
Sound Preloader...
Hi...
I'm trying to do a preloader to the loading of an External MP3 file.
I've done a FLA to do this...
In it I've putted the script to create the sound and to load it.
I've then used a Button wich I've then converted into a MovieClip... in this new MovieClip... I tried to (in 2 frames) check how the loading of the MP3 was and make the update of the values in two text boxes I putted in the _root MovieClip.
(the button, when pressed, plays the music, if it's loaded already, and also shows the amount of bytes already loaded - this works fine)
Where is my problem? The MovieClip I created (converted from the button) is not giving me any results and I really don't know why... can any of you take a look on the FLA file? I've putted it here:
http://www.fe.up.pt/~fjorge/soundCheck.fla
Thanks for all the help!!
Sound With A Preloader
I want to make a preloader that displays a short animation and loops a sound unitil the movie is loaded. Then the sound is silenced and the movie goes to the next scene. Ideally the animation would fade out with the sound when the movie is loaded.
Can anyone point me in a good direction to learn how to do this?
Thanks
Sound With Preloader Help Please :)
I have a movie which I have created a preloader for. Ive unchecked "export in first frame" for all my sounds so that the preloader loads.
I'm attaching my sounds in an external swf like this:
mySound=new Sound(this);
mySound.attachSound("v1");
mySound.start();
And I need to access them in another movie. I've created two empty movie clips, one to load the sounds into and one to contain the actions. The one containing the actions looks like this:
onClipEvent (load) {
_root.introsound.loadMovie("intro_sound.swf");
_root.loadSound=1;
}
and I'm trying to play the sounds like this:
Code:
stop();
//myFace.gotoAndStop(1);
//mySound = new Sound(myFace);
//mySound.attachSound("v1");
//mySound.start();
mySoundPosition=_root.introsound.mySound.position;
_root.introsound.mySound.start(mySoundPosition,0);
//mySound.onSoundComplete = function() {
//myFace.gotoAndStop(60);
//};
//myFace.gotoAndPlay(1);
//stop();
The commented bits are how I was doing it before. So that is how I need to still to work really - playing while myFace plays.
I got most of the code from www.kennybellew.com. I saw another post with that as a suggestion but as you can see I'm having a few problems getting it working for my movie
Sound Preloader
Hi,
Sorry if this has been covered before, have look through the forum but still having problems.
I want to load mp3's from a movie and use a preloader. Have tried the following code:
mySound = new Sound();
mySound.loadSound("track1.mp3",false);
mySound.onLoad=function()
{
mySound.start();
}
onEnterFrame=function()
{
trace(mySound.getBytesLoaded());
};
But the getBytesLoaded method always gives 543280, the complete file size?, as if it has loaded instantly. Have tried other variations, loading into an empty movie clip, but still cant get it to work. Would appreciate any help.
Any suggestions?
Sound Preloader
sooooo, i am loading an external MP3 file via the loadSound method. how would i go about making a preloader for this sound? is there a listener for it? or do i use getBytesLoaded?
also, i've already made a preloader for an external SWF that is loading in via the loadClip method. that works perfect. is there anyway i can make sure the external Swf and sound begin to play at the same time? i have some sound that's synched with animation. the master movie loads in the external SWf and the sound. so the sound is separated from the external SWF. any ideas help. especially on the first paragraph's issue. thanks in advance.
Preloader With Sound
Hi all,
How can I have music for a preloader? Coz I have tried to use a music file for my preloader and it is in a loop. It keeps on repeating so fast that it sounds like a jumbled piece. I want to a put sound in my preloader and want to show it in a clean way that when the sound gets over and if the preloader is still working then it should play from the start and should not make the music a noise. Hope I am clear with my question.
regards,
Xeeschan
Sound Preloader
How can create a preloader for an externally loaded sound? I use the loadsound action to play the external mp3 file but I need a proloader to show it load??
Sound Preloader
How would I manage to create a preloader for a sound file? I just want it to be for a temporary site and all I want it to do is load the sound and play it as soon as it is downloading. What do I do? Where do I start?
Sound Preloader Bar
is any way to make a preload bar for loadSound command where:
//actions:
w = new Sound();
w.attachSound("crossroads");
w.start(0, 100);
x = new Sound();
y = new Sound();
z = new Sound();
//where button 1:
on (release) {
x.stop();
x.start(0, 5);
}
for button2:
on (release) {
stopAllSounds();
x.loadSound("music2.mp3", true);
}
?
I can not make it to work...
Help In Preloader And Sound
i want to insert this preloader to my movie http://www.kirupa.com/developer/mx/p...age_loader.htm so i already have movie i created new layer by name preloader than copy and paste that frame to preloader layer's first frame and check it it doesn't show any thing just gray bar.
Than i removed 1 big sound and uploaded it to yahoo and check it but it show just grey bar and my effects.
And yes i have more layers there and i some effects with 1st frame with preloader.
Is that is why that i am using other effects to with preloader?
and yes there was option in sound in flash 5, option of event start or stop music, So how i do that in flash mx?
and i inserted 1 sound by flash mx and it's volume is too much low but flash 5 have perfect 1 so how can increase volume of sound?
Sound Preloader
How can create a preloader for an externally loaded sound? I use the loadsound action to play the external mp3 file but I need a proloader to show it load??
Sound Preloader
How would I manage to create a preloader for a sound file? I just want it to be for a temporary site and all I want it to do is load the sound and play it as soon as it is downloading. What do I do? Where do I start?
Preloader For Sound?
Hey guys!
I have placed my sound on level 99, so my sound constantly plays in the background.
Im wondering if there is a way i can create a preloader for this sound?
These sounds are external swf's!
I hope you understand what i mean!
Hang on i just thought of sumpin, is it the same way you do a preloader for an external swf??
or is it diffrent?
Coz if it is, i now how to do it!!
Preloader 4 Sound
Hey guys, im just wondering, if i have my sound loaded onto level 99, how do i create a preloader for it?
And lets just say i have a box interface, i would like to have the preloader showing on the top left hand corner!!
Any suggestions?????
Preloader Of Sound
I have to music files a lit bit big that I need to load into my movie but it's taking too long to start.
is there any way to put these file's loading with my preloader .When the user is waiting for the page it loads the sounds also and when I play the songs it plays without problem?
How do Ido this??
Pleeseaaa!
Sound Preloader
Can someone help me?
I have 5 mp3's, and I want my flash movie to load the sound one after the other? the script is loading it simultaneously as an already loaded sound is being played.
Preloader With Sound Help
I have a preloader set up here with this simple one page site:
www.paintingdoors.com
Take a look if. There is a preloader there and although it is a small SWF and loads fast, on a dial up the preloader won't fire visually but will work in code.
Code:
if (_framesloaded >= _totalframes) {
gotoAndStop("Scene 1",1);
} else {
progressbar._xscale = int((getBytesLoaded()/getBytesTotal())*100);
}
//progressbar. is the instance name of a simple bar i made in the middle of the stage. a progressbar MC named as such//
frame 2:
gotoAndPlay("Scene 2, 1") and so on...
I know the preloader bars work. The thing is when it loads and automatically plays a background sound, the bar never shows:
Scene 2:
BGsound=new Sound();
BGsound.attachSound("background");
//declared identities//
also:
on (rollOver) {
gotoAndPlay(2);
_root.BGsound.start(0,999);
}
//attached to the rollover of the box on the stage//
Now, it all works fine, just that the loader bar, (scene 1) won't show up and at best it shows up occasionally right as it is finishing, then flips to the next scene. As it should, I just dont like the white box there at the beginning.
Is there something I can do about this???
Some flaw in FLash or my idea.
LMK
thanks
How Do You Do A Preloader For A Sound?
I want to put an MP3 into flash and have a bar preloader for it, while it's loading and then loop it once it's loading.
Obviously you can't do the normal "if frame 20 loaded go to and play 5", because sound doesn't work that way. So how can i create a bar preloader for a sound?
Thanks.
Sound Preloader
Hello all and good day!
I have set up an .fla to show how I have my sound files set up (4 songs, each initialized and such in a separate frame and each loaded from an external mpg). I'm wondering what the most efficient way would be to have a preloader show the progress of each of the loaded sounds. I may have the frames set up an inefficient way for my purposes, and if so, please let me know (this is my first time putting multiple sounds in a movie with play, stop, forward and back btns). Here's the .fla:
http://www.adrialdesigns.com/audioTest.fla
Please let me know if any more explanation is needed, although the fla should be pretty self-explanatory. Thanks all!
Sound/preloader
ok, i've addes a mp3 to the library and use the following code to play:
var geluid:Sound = new Sound();
geluid.attachSound("loop1.mp3");
btn_muziek_aan.enabled = false;
geluid.start();
geluid.onSoundComplete = function(){
geluid.start();
}
as you can see it's a loop, but that's not the problem. For this to work I had to use the linkage option, and export it to actionscript and frame 1. I have a problem with exporting to frame 1, becouse on that frame, my preloader wants to begin, but instead, the mp3 is fully loaded before the preloader starts, leaving me with a preloader that loads just a few kb.
Turning "export to frame 1" off couses the mp3 to not play at all. Is there a way to export to frame 3? or something else?
Sound With Preloader
Ok I posted about this before but got no response. Posting again incase anyone thought that me talking to myself was actually someone replying
I have a movie which I have created a preloader for. Ive unchecked "export in first frame" for all my sounds so that the preloader loads.
I'm attaching my sounds in an external swf like this:
mySound=new Sound(this);
mySound.attachSound("v1");
mySound.start();
And I need to access them in another movie. I've created two empty movie clips, one to load the sounds into and one to contain the actions. The one containing the actions looks like this:
onClipEvent (load) {
_root.introsound.loadMovie("intro_sound.swf");
_root.loadSound=1;
}
and I'm trying to play the sounds like this:
Code:
stop();
//myFace.gotoAndStop(1);
//mySound = new Sound(myFace);
//mySound.attachSound("v1");
//mySound.start();
mySoundPosition=_root.introsound.mySound.position;
_root.introsound.mySound.start(mySoundPosition,0);
//mySound.onSoundComplete = function() {
//myFace.gotoAndStop(60);
//};
//myFace.gotoAndPlay(1);
//stop();
The commented bits are how I was doing it before. So that is how I need to still to work really - playing while myFace plays.
I got most of the code from www.kennybellew.com. I saw another post with that as a suggestion but as you can see I'm having a few problems getting it working for my movie
Preloader/sound Query
I have a flash intro which needs to have its music/loop downloaded before it can play. I would like to show the bytes loaded of the music only, as the intro outstreams the playhead easily.
I have been using the getBytesTotal command but this grabs the bytes of the whole movie. When this is used it loads the sound and goes straight into the intro without even showing the percentage etc
Also, just to make matters a bit more challenging, it needs volume control with a slider, that can be controlled in the main movie. Which I have done, but just wondered if this will affect the overall solution.
Please help, its friday and I have been hurting parts of my brain which have never been used trying to sort this out
Simple Sound Preloader?
i want to import one .wav file and dont want to play untill whole of the audio is downloaded and also want to show the status preloader of the file(as there would be only the sound file and a button).I tried making a MC with first frame stoped and having the sound from 2nd frame and playing it through tell target action.But the preloader dosnt work.??? I am controlling the preloader by the getBytesTotal() and getBytesLoaded() function.How do i show the status of the sound file and how should i play it(start/stream/attachSound()???
Attatch Sound Preloader
Hi, thanks for looking at my post.
Before you tell me this, i already know theres a tutorial that says how to do preloaders with the attatch sound command but its not what i want.
in my site i am goind to load an external swf which is basically some sound controls and the sound itself. the reason i want to load it seperatly is to keep my main preloading time short. firstly, this is a minor problem but its kinda annoyin me, i have a button that starts the sound using the mysound.start() command. how do i make it loop? in the help files it says mysound.start(loop) or something along those lines, but it doesnt say exactly and i cant get it to loop. i want a constant loop to go on.
ok now to the hard stuf.
the sound controls swf has two scenes, the first has a preloader and the second is the controls and where the sound will play. firstly, is there any point in me making a preloader in the first scene, and to preload in level one in the main flash file, which would save some time with the attatched sound thing but it could also have some problems.
in the preloader in the first scene, it currently preloads the whole of the sound (which is most of the swf) first, before anything else, so the preloader doesnt work, as you will al know the attatch sound thing does. is there any way to build a preloader that will make it preload the sound properely, and not in the way it does at the moment?
i appreciate any help i get with this......
cheers
Aaron
PRELOADER And SOUND LINKAGE HELP
OKay here's the thing,
i'm trying to preload a a movie, which has the sounds setup to be exported to symbols (LINKAGE);
now when i don't link the sounds; the preloader works freakin sweet
but when i link the sounds the preloader takes up half the load, so the preloader animation and loadbar doesn't show up at all till it's like at 50% i.e.
if the file is 94kb then the loader(in the bandwidth profiler) shows up as 47k so nothing shows up on the screen until those 47kb loads up.. and then the preloader is at least 50% done by that time....
i need help, to get around this
here is the code as it is in my actions layer:
------FRAME 1----------
loadpercent = "0%";
loadBytes = "0 of " + Math.round((_root.getBytesTotal() / 1024) * 1) / 1 + " Kb";
-----FRAME 2----------
loadPercent = (Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"%");
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1)/1+" Kb of "+Math.round((_root.getBytesTotal()/1024)*1)/1+" Kb");
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
loadPercent = "100%";
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1)/1+" Kb of "+Math.round((_root.getBytesTotal()/1024)*1)/1+" Kb Loaded");
gotoAndPlay ("main", "start");
}
-------FRAME 3------------------
gotoAndPlay(2);
the loadpercent and loadbytes display within text boxes and the loadbar works through _xscale
please help me.. how can i get the preloader to only be the 2-4k that it is, and display the full loadbar with sound linkage active.. HELP!!!!
Preloader / Sound Object
I got some problems with my preloader:
I've insert a preloader-scene before my main scene. In this preloader-scene I have following code:
if (_framesloaded<_totalframes) {
gotoAndPlay(_currentframe-1);
}
now this worked perfectly until I stopped dragging soundfiles into frames but making sound objects instead:
frame1 of main scene:
loopSound = new Sound();
loopSound.attachSound("loopAcid");
loopSound.setVolume(70);
loopsound.start(0,999);
Since the code for the preloader isnt in frame 1, but the sound objects are loaded in frame 1 though, the preloader starts after all sound is loaded instead of before.
Can anyone tell me how I could make the soundobjects load after my preloader starts - on command ie?
(using Flash MX)
Streamed Sound + Preloader ?
hello,
i developed a Audio control Panel for a studio. A main page (Level 0) where are diffrent button's load a new movie in level 1.
all the movies whicj will be loaded in level 1 are just simply swf's with sound, which u can listen online.
I put a preloader in front of the sound frames and the sound is set as "stream". (size of each swf file (which includes just a sound) is about 800 kb)..
question is: do i need the preloader? and will the preloader count until the last frame is loaded even if the sound is set as streamed?? or can i put the preloder away and just tell on the page that the puffer time is 5 sec. |??? ... streamed means puffertime 5sec. need to be loaded to be played right?? so that menas i dont need a preloader right ???
need some help or advice, thanks dennis
http://www.55-studio.com
Attached Sound And Preloader
I have noticed that when i have a attached sound from the library, the preloader starts after that sound is loaded and it works properly only for the main movie size not the both sound and movie.
for example if my movie is 1 MB and my sound is 600K, using preloader. browser starts loading the 600K without using the preloader just with a blank screen...right after the 600K is done. the preloader starts for the 1MB of the main file....anyidead why? before i just dump the sound into the main timeline.
Preloader Problem With Sound
Hi All,
I have a movie with 2 scenes, the first scene is a preloader, the second is Scene 1.
Both scenes only have 1 frame of content (scene 1 is a music player with a large MP3 in it).
PROBLEM: The preloader flashes by at only when everything has loaded. I'm using the getBytesLoaded/Total method (not frames), but the preloader never shows.
The code I've gotten from an excellent tutorial on this site, and works when I put it in a multi frame/graphically intense presentation, but not with this simple 2 scene, 2 frame flick.
Preloader Code:
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;
myTextField.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";
}
I've kept the play(); in here, but I've also used the correct syntax for going to a different scene.
My graphic has the instance name of "bar".
I've also tried putting all this into one scene, but still have the same problem.
Any help would be appreciated.
Thanks,
Z
[FMX] MP3 Preloader And Sound Object
Hi all,
Houston? I have a problem... (no, really? hmmm... yes!)
Excuse my broken English (I will try to be clear).
I'm creating a MP3 jukebox for my website, a Movie Clip (MC) named "miniJuke". A function "preloadSound" is called, and should preload my sound object. But it doesn't work : I get a NaN until the movie is fully loaded and then I get 100.
Here is my code :
Quote:
// the sound preloader function, where "pieceOfCake"
// is the path to find my MP3
function preloadSound(pieceOfCake){
this.createEmptyMovieClip ("tempLoader",this);
tempLoader.onEnterFrame = function() {
var bl = mySound.getBytesLoaded();
var bt = mySound.getBytesTotal();
var p = isNaN(bt)?0 : Math.floor(bl*100/bt);
if (p < 100){
_root.miniJuke.percent.text = p;
trace ("that works ?");
}else{
mySound.start (0,99);
mySound.isPlaying = true;
tempLoader.removeMovieClip();
}
};
mySound.loadSound(pieceOfCake,false);
};
"percent" is a textfield, "mySound" is the sound object.
The "trace" instruction (that works?) is never displayed, so, i think than "p" is never lower than "100".
How to preload "mySound" correctly ?
I really need help.
Thx.
Preloader For Sound Loops
Does anyone know how to put preloaders for sound loops I have about 10 sounds for each page. and want them to have a preloader so people will know their is music loading.
Sound Object And Preloader
How do you use the Sound Object without having to wait for the sound to load before the preloader of the movie is visible ?
Preloader For .swf Sound File
please help...
how do i make a preloader for a externally loaded .swf that is a sound file? I am loading the sound loop .swf into a empty movie clip via loadMovie. none of the preloaders i have seem to work.
I just need the % to show.
Thank you
Preloader For Sound Objects
HI ALL
I am using sound objects and have the linkage properties as "Export for Action script" and "Export in the First Frame".
The problem is that the preloader doesnt work if i have those 2 setttings selected, if i just have "Export for Action script" selected, the preloader works, but the sound doesnt load.
ANY SOLUTIONS????????
THANKS
Preloader For Sound Scene
Hey there
Can anyone tell me or maybe help me with my preloader. The loading scene has to load the entire movie, before it goes to scene 1 where my sound is. But for some reason the loader doesent work ("Loading" scene).
Hope anyone can help me.
Jakob
Sound Object On Preloader
Hello all,
I have a sound object issue that has me stumped. I have a simple bar preloader that loads an flv. That works fine. I want to have a sound play while the flv preloads. So I used the Sound class. On the 1st frame I have
mySound = new Sound ();
mySound.attachSound ("bcl");
mySound.start (0, 1);
This works, the sound plays and everything, but it plays as long as the preloader is playing. I only want the sound to play once. I thought the 2nd argument for the start() method was a value to set how many times it plays.
I think it has something to do with my preloader code:
Frame 1:
var percent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() *100));
if(percent == 100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);
}
Frame 2:
gotoAndPlay(1);
Since the preloader code is telling Flash to go back to frame one, which is where the Sound object code is, so it repeats until the movie is loaded. How do I get the sound to only play once while preloading?
What am I missing? Any help is greatly appreciated.
Greg
Preloader Loading Sound More Than Once
ive made a preloader in scene2 of my movie using the tutorial on http://www.kirupa.com/developer/mx/p...epreloader.htm
but when i publish the swf and open it the sound that i have playing in scene1 loads a lot of times at the same time. the code i have for the sound is
excellent=new Sound();
excellent.attachSound("excellent01");
_root.excellent.start(0,999);
the sound etc is fine untill i put the preloader in.
I think i might know what the problem is.. on the actions layer in the preloader the code which i have in frame2 which is: this.gotoAndPlay(1);
copies itself into all the other frames in the actions layer.
Im not sure if this is what the problem is but it looks to be and does anyone know how to fix this? or know why this is happening
cheers for any help
Sound Loop In Preloader
I have a preloader with a small movie clip inside. I thought I could also use a sound in it,, but it appears that the sound loops itself on and on while loading and my idea was to play it only once; how to make it that way?
Dynamic Preloader Sound.
Hi,
I was just wondering if it's possible to create a preloader that has dynamic sound? So I guess what I mean is that it plays at the same pace as the preloader. So if it loads slowly, then the sound plays slowly, if it loads up quickly then then sound plays quicker.
I'm thinking it's impossible to do...Anyone got any ideas on the subject?
Thanks,
Mat.
Preloader => No Sound In Main MC
Hi flashkit members ^^
I have got a swf file called PG3.swf which works fine both online and on my comp. This file includes music and sounds.
I did a preloased for it, here is the preloader code :
Code:
this.attachMovie('ld', 'ldmask', 0);
ldmask._x = -Stage.width;
LDGFX.setMask('ldmask');
ldmask.onEnterFrame = function() {
this._x = -Stage.width+(((Stage.width-32)*this._parent.introct.getBytesLoaded())/this._parent.introct.getBytesTotal());
};
//Starts loading
this.createEmptyMovieClip("introct", '1');
loadMovie("PG3.swf", this.introct);
onEnterFrame = function () {
// Over ?
if ((this.introct.getBytesTotal() == this.introct.getBytesLoaded()) and this.introct.getBytesTotal()>300) {
ldtxt.removeMovieClip();
ldfond.removeMovieClip();
ldGFX.removeMovieClip();
ldmask.removeMovieClip();
delete (this.onEnterFrame);
}
};
The loading bar is ok, everything is ok BUT the PG3.swf doesn't make any sound nor music when running!
Sum up :
PG3 : Sound OK
Preloader => PG3 : no Sound
By the way, I don't ever use _root so it's not the problem ^^
Preloader: No Sound When I Use LoadClip()
Hey
I made a preloader for my game which loads game.swf, but there is just no sound when the game is loaded. In game.swf I use attachSound() and directs it to the linkage name. It works when I just play the game.swf-file but not with the preloader-file?
Any idea of what I do wrong? Maybe I shoud import the library?
Thanks
Backround Sound For Preloader.
I had a preloader working great.
Now I want to have the ambient sound loop which I downloaded for the site also run behind the preloader.
What is the best way to do this?
The main movie is three frames.
Frist frame has.
ActionScript Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.outer1._xscale = getPercent*100;
this.middle1._xscale = getPercent*100;
this.inner1._xscale = getPercent*100;
this.butter1._xscale = getPercent*100;
this.butter1._rotation=getPercent*360;
this.outer1._yscale = getPercent*100;
this.middle1._yscale = getPercent*100;
this.inner1._yscale = getPercent*100;
this.butter1._yscale = getPercent*100;
this.loadBar._alpha = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
bgSound = new Sound(this);
playValue="Play";
bgSound.attachSound("sound1");
if(secondloop!=1){bgSound.start(0,99);}
secondloop = 1;
The problem with this was that the preloader waited till the sound file was loaded to start showing itself.
Now I'm trying it by putting a sound in a movie clip but I'm unsure how to include this movie clip into the three frame solution so that I can have the sound play consistently in the background.
Cheers
Robert
Sound And Preloader Problems
Hello, I need some help with correct playing of Mp3 in my flash site. When I test it local on my computer, everything is ok, but when it´s uploaded to FTP and played within a browser, there are few problems:
1. Firstly, the sound has an offset, which I don´t want to. The sound starts playing approximately 1-2 sec later. I´am affraid it´s problem of computer/internet speed etc., which cannot be repaired.
2. My preloader doesn´t work after adding sound to timeline, however, sound isn´t in the first frame. All content is loading automatically (flash space is black), then quickly runs manual preloader. You can view it by clicking link below.
In current fla, the sound is added to timeline of movieclip from library. I´ve tried start it by ActionScript, but it´s the same. I haven´t tried to load it by AS from URL (function loadSound() ), because I think the preloader might be not functional, like in this situation.
Thanks for solving.
Site here: http://www.rafanda.cz/flash/
FLA here: http://www.rafanda.cz/flash/web.rar - 43MB zipped (yet available)
Edited: 01/04/2007 at 04:32:16 AM by Anamorphy
|