PDA

View Full Version : mp3hotspot.swf - click to start?


visionman
11-15-2010, 02:14 PM
Hi,

Is there any way of adding an mp3 file to a pano that doesn't start automatically once hotspots are loaded?

I have worked out how to toggle sound on/off, but I want to be able to start/stop the audio, which is not the same thing.

Here's my code so far (it places an audio start button (audio_off.png) on a larger graphic panel (wheelpanel.png) ...

<box id="wheelorange" linked="nave" url="hotspot_orange.png"
onLoad="scale=0.375; scale=0.1,4000,bounce" alpha="0.85"
visible="1" pan="-96" tilt="28" alignX="-0.5" alignY="-0.5"
segmentsX="15" segmentsY="15" orientation="sphere" depth="10" scale="1"
onClick="wheelpanel.visible+=1;wheelaudio.visible+=1;wheel. visible=0;window.visible=0;
wheelorange.visible=0" onOut="wheel.visible=1"/>

<spot id="wheelpanel" url="wheelpanel.png" static="1" scale="1" align="CM" salign="CM" staticX="0" staticY="0" visible="0" alpha="0.85" depth="40" onClick="wheelpanel.visible=0;wheelaudio.visible=0;wheel.vi sible+=1;wheelorange.visible+=1;window.visible+=1" onOver="" onOut="" />

<spot id="wheelaudio" url="audio_off.png" static="1" scale="1" align="CM" salign="CM" staticX="-148" staticY="-126" visible="0" alpha="0.85" depth="41"
onClick="makeSoundGoOn"
makeSoundGoOff="track1.soundVolume=0;onClick=makeSoundGoOn;"
makeSoundGoOn="track1.soundVolume=1; onClick=makeSoundGoOff;"
onOver="" onOut="" />

<spot id="track1" url="mp3hotspot.swf" file="test.mp3" linked="nave" repeat="30000" pan="0" tilt="0" enableSoundPanning="0" soundRadius="360" />

This is the end result, combining the 2 graphical hotspots ...

http://www.360vision.co.uk/uploads/audio.jpg


Any help greatly appreciated.

Thanks

Visionman

panomaster
11-15-2010, 05:00 PM
Leave empty url attribute of mp3 player spot and then set it dynamically. Try to do something like this:

<spot id="track1" url="" file="test.mp3" ...

and

<spot id="playButton" ... oncllick="track1.url=mp3hotspot.swf" />

allSaints
11-15-2010, 11:20 PM
I fooled around a bit with the mp3hotspot plugin to make it listen for commands like "play", "pause" and "stop".

There is a test page (http://wirestam.com/panos/Flash/soundspot/soundtest1.html) that you can take a look at (or listen to). If it seems interesting I will fix a zip file and add it to my plugin page.

Tommy

visionman
11-16-2010, 08:18 AM
Tommy - you are a star!! :D

That is exactly what I need. Thanks so much - perfect.

Visionman

visionman
11-16-2010, 08:19 AM
Leave empty url attribute of mp3 player spot and then set it dynamically. Try to do something like this:

<spot id="track1" url="" file="test.mp3" ...

and

<spot id="playButton" ... oncllick="track1.url=mp3hotspot.swf" />

Many thanks Panomaster. I am no code expert, but this looks interesting and will give it a try. Tommy's tweaked plug-in looks like it might just be the ticket though.

Cheers

Visionman

Paddy2a
11-16-2010, 08:39 AM
Tommy,
Yes please for that zip file/plugin.
This is exactly what I need to produce also.
Perfect timing, thanks again.
Paddy

allSaints
11-16-2010, 09:09 AM
Like panomaster says above, you can also use the original mp3hotspot.swf plugin and set the url="..." attribute. This will unload and load the hotspot each time, but nobody will notice that.

Here (http://wirestam.com/panos/Flash/soundspot/soundtest2.html) is the same test page but with mp3hotspot.swf. The only practical difference from my version is that you can't pause the sound.

Tommy

visionman
11-16-2010, 10:34 AM
Tommy,

I think it would be really useful to pause the audio too, so if you have time, it would be great to be able to use your adapted plug-in.

Thanks again

Visionman

allSaints
12-08-2010, 05:37 PM
I have added the soundspot plugin to my plugin page.

In addition to supporting the play, pause and stop commands, the plugin also checks the onComplete="..." attribute, in which you can specify FPP commands to be executed at end of file. This of course makes it possible to load any number of sound files that can play in sequence.

Plugin page is here (http://wirestam.com/panos/Flash/plugins/soundspot.html).

Test page is here (http://wirestam.com/panos/Flash/soundspot/soundtest1.html).

Tommy

YMA
12-14-2010, 02:12 PM
Hi Tommy,

Is it possible to add buttons forward / rewind or a bar indicating the progress of music and can act on the bar to fast forward or rewind music.
Like this.

Thanks again.

Mam

allSaints
12-14-2010, 02:57 PM
Hi Mam,

yes, of course it's possible. There are lots of Flash mp3 players around, and they all probably use the same Flash Sound and SoundChannel classes as this plugin does. It's quite easy to check how far the playback point has progressed in your mp3 file. When the sound is paused, the plugin saves this value - to be able to continue playing from that point later on.

But... this plugin is not supposed to be a complete mp3 player with all the controls needed. If I do include these controls, I will be flooded by emails that want them to look different, have different placements or work in a different manner. On the other hand, if I extend the external command set that the plugin already supports - to use other hotspots for control - people would probably find it too complicated to setup with several hotspots working together.

So - that's the dilemma every plugin builder faces... :rolleyes:

Tommy

YMA
12-14-2010, 08:01 PM
Hi Tommy,

I understand your point of view ...
You're already doing an enormous job for the community .... free and more ...
You are really a "Saint".

Thanks.

Mam