View Full Version : Sound change when change view..
christophe
05-09-2007, 05:27 PM
Hi all !
Is it possible to stop a mp3 player and start a new one when i click on a hotspot to make change atmosphere of the pano ?
Actually i use mp3player at a static position and the first sound is long like something as 20sec and loop without ending, if i change the view, i would like to make it shut up and start another. Is it possible or am i dreaming too strongly ?
Maybe the way by using mp3player is not the good one !
Could you help me ?
Thanx for it ;)
christophe
05-09-2007, 05:32 PM
....euh.....something more, my turning loadMeter.swf doesn't works
<parameters>
loaderText =
layer_1 = loadMeter.swf
layer_2 = hotspots.swf
</parameters>
and of course i puted it in the folder... somebody knows something about it ?
Thanx again !
christophe
05-10-2007, 11:37 AM
it's ok for loadMeter.
But my question about sound is still without answer.
:( thanx :wink:
Denis
05-14-2007, 09:47 AM
Most simple way is to use linked and different music spots:
<spot id="music1" url="mp3player.swf?file=1.mp3" linked="pano1" />
<spot id="music2" url="mp3player.swf?file=2.mp3" linked="pano2" />
<spot id="music3" url="mp3player.swf?file=3.mp3" linked="pano3" />
Sound "1.mp3" will be loaded only for panorama with "panoName=pano1".
You can use you own swf file with sound (animation, controls) instead of mp3Player.swf.
Another way is to change url parameter manually using any panorama event:
<spot id=""music" url="panoMusic.swf" />
<spot id="go1" onClick="loadMovie(newpano.swf); music.url=pano2Music.swf" />
More complex way (if you want to change music after panorama loading):
<global music1="music.url=music1.swf">
<spot id="music" url="panoMusic.swf" />
<spot id="go1" onClick="loadMovie(newpano.swf); global.onTransitionEnd=music1" />
Also you can use timer parameter to change music from time to time. And so on and so forth. :)
christophe
05-14-2007, 08:50 PM
Thank you Denis !
I will try it.
It seems so easy when i read the code...! :)
I will let you know...
christophe
05-30-2007, 04:43 PM
Hi,
I've tried a lot of ways but only one works....with a little problem !
<global onLoad="mp3player.swf" [...]>
<spot id="1" url="sound1.swf" linked="pano1" />
<spot id="2" url="sound2.swf" linked="pano2" />
The sound turn in loop, it's ok !
The problem is that the first sound still turn in background when the second sound is playing.
How can i stop the first one when the second is starting ?
I've already done the way by opening a new url but i lose the transition...no good way !
Thank you.
and very big congratulation for your new work, Denis !
Denis
05-31-2007, 08:11 AM
I gave you a solution 2 posts above (third variant). :)
Explanation:
Spot click starts to load a new panorama and changes global.onTransitionEnd to predifined function.
When panorama is loaded global.onTransitionEnd calls music1() to change sound to music1.swf.
You need three different functions (music1, music2 and music3).
christophe
05-31-2007, 09:23 AM
Ok, i did how you said.
<global music1="music.url=sound1.swf" music2="music.url=sound2.swf" [...]>
<spot id="music" url="sound1.swf" />
<spot id="entree" [...]onClick="pano.leash=free;loadPano(?panoName=new&panHome=-25&tiltHome=-25&zoomHome=0.9,300); global.onTransitionEnd=music2" />
Then it works exactly like i did before.
The first sound need to finish the loop to stop, if the first sound is during 30sec then at the 2nd pano we have the both of 2 sounds until the first loop is finished.
Am i right ? I hope no !
Tell me that I forgot something...
Denis
05-31-2007, 10:18 AM
Indeed. I have the same result...
This is a problem of Flash Player 9. There is no forced unload, the garbage collector unloads the previous sound in unknown time.
One of the solution is to use remove handler in version 2.1, you can see source plugins/flvplayer.fla (for Flash CS3 only). For AS1/AS2 sounds it requires an additional programming (LocalConnection and so on).
I need to update the mp3 player, looks like the best solution is to handle all sound files in the single application...
christophe
05-31-2007, 10:37 AM
Damn ! Game over !
thank you nevertheless
:wink:
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.