thekinder
April 7th, 2006, 06:30 AM
Hi evrybody,
this is my first post on this forum, I hope you 'll help me.
I'm making my own flash website and I have a sound problem. I explain :
In my main swf on frame 1 I have a movieClipLoader which load a swf containing musics and sounds. So I can make my preload on frame 1
Then, on frame 2 I have my interface, etc ... and I would like to use the sounds loaded in my frame 1 but it does'nt work. Here is my code :
Frame 1
var monClip_mcl = new MovieClipLoader();
var monEcouteurDeClip = new Object();
monEcouteurDeClip.onLoadProgress = function(cible, loadedBytes, totalBytes){
//blablabla .....
};
monEcouteurDeClip.onLoadComplete = function(cible){
//blablabla .....
};
monEcouteurDeClip.onLoadInit = function(cible){
sfx = new Sound (cible);
sfx.attachSound("ambiance1");
sfx.start(); gotoAndStop(_currentframe+1);
};
monEcouteurDeClip.onLoadError = function(cible, codeErreur){
trace("Une erreur est servenue lors du chargement" + codeErreur);
};
monClip_mcl.addListener(monEcouteurDeClip);
monClip_mcl.loadClip("sfxlib.swf", soundClip);
With this code, i read the sound on frame 1
To read sound on frame 2 i wrote this code :
_root.sfx.start();
but it does'nt work.
How to do that ? http://www.flash-france.com/forums/images/smilies/frown.gif
Thanks a lot ....
PS : sorry for my bad english
this is my first post on this forum, I hope you 'll help me.
I'm making my own flash website and I have a sound problem. I explain :
In my main swf on frame 1 I have a movieClipLoader which load a swf containing musics and sounds. So I can make my preload on frame 1
Then, on frame 2 I have my interface, etc ... and I would like to use the sounds loaded in my frame 1 but it does'nt work. Here is my code :
Frame 1
var monClip_mcl = new MovieClipLoader();
var monEcouteurDeClip = new Object();
monEcouteurDeClip.onLoadProgress = function(cible, loadedBytes, totalBytes){
//blablabla .....
};
monEcouteurDeClip.onLoadComplete = function(cible){
//blablabla .....
};
monEcouteurDeClip.onLoadInit = function(cible){
sfx = new Sound (cible);
sfx.attachSound("ambiance1");
sfx.start(); gotoAndStop(_currentframe+1);
};
monEcouteurDeClip.onLoadError = function(cible, codeErreur){
trace("Une erreur est servenue lors du chargement" + codeErreur);
};
monClip_mcl.addListener(monEcouteurDeClip);
monClip_mcl.loadClip("sfxlib.swf", soundClip);
With this code, i read the sound on frame 1
To read sound on frame 2 i wrote this code :
_root.sfx.start();
but it does'nt work.
How to do that ? http://www.flash-france.com/forums/images/smilies/frown.gif
Thanks a lot ....
PS : sorry for my bad english