Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

virus187

macrumors newbie
Original poster
Apr 23, 2009
17
0
Hi All

I have put several wimpy music buttons on one page but when you click on more than one play button they both start playing.

How do i get each button to stop when another is clicked.

go to my website and you will know what i mean. Click on the "preview" play buttons and advise if you can

http://www.beats2buy.com

Thanks
Virus187
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
I do not have a specific answer (i.e. code) for you, just want to get your feedback on this analysis... and a warning... this will get technical...

Seems you have 3 instances of Flash. Each opens its own audio progressive stream, and are essentially independent of each other. Because you're using iWeb, it's not easy to modify code because iWeb itself generates the Javascript and other code each time you add the widget, and that code is spaghetti, usually uncommented and tough to edit.

Plan "A"

Thus, it might be easier to simply find another Flash widget which is a single player that allows multiple audio files to be called (usually within an external XML file) selected by the user. Doing so will change the design, most likely, because selection of the audio file might be in a pulldown menu or similar. The better Flash software allows you to assign individual ID's so you can list and link each audio selection in your HTML, but it ties into the same player.

I know your next question is, do I know of any such Flash audio player which you can use and maintain your existing layout? Answer: No, but now you know what to ask for here on the forum!

Plan "B"

If you want to edit the widget code via iWeb (brave soul) and use the existing Flash and preserve the layout you got now, my advice is to work with Javascript which actually interfaces quite well with Flash.

First, visit this page and read it very, very carefully, over and over if necessary, to get the full impact of it:

http://www.permadi.com/tutorial/flashjscommand/

That excellent page is a simple approach to controlling Flash, i.e. you can make it stop playing by referencing an ID added to the object tag and two other tags added to the embed tag for your Flash. Now each instance of the player can be uniquely identified. At this point you can write Javascript code using the help on the page I linked to ensure the other players, if running, are stopped, when one is selected using the Play() and StopPlay() functions, etc. You'll notice you can also use setVariable() and getVariable() to communicate with your Flash, i.e. to check to see if a variable is set if its playing, if your Flash supports that. And this page is just the simple stuff, see the link on the bottom for more functions.

Example:

You write a function called via onClick when the play button is pressed on one of the Flash objects, it will call a Javascript function you write which might, for example, simply send commands to stop the other two based on the ID passed to that function. That's the easy part, the hard part is integrating this into iWeb horrible code, and my advice is DON'T spend too much time on plan B.

-jim
 

virus187

macrumors newbie
Original poster
Apr 23, 2009
17
0
Thanks Mac Rumour User!

All i want is a simple nice looking play and stop flash button (not player) that links to my audio files on my server to preview my beats before people buy them,....Has anyone got any good FLAs or sites to suggest where I can get free buttons? NOT PLAYERS!
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
Thanks Mac Rumour User!

All i want is a simple nice looking play and stop flash button (not player) that links to my audio files on my server to preview my beats before people buy them,....Has anyone got any good FLAs or sites to suggest where I can get free buttons? NOT PLAYERS!

Is there a reason you ignored completely my response, which asked for your feedback? Did you not understand something?

Technically it's a "player" only when its playing - the word does not infer it's a widget that must look like a radio, a tuner with an EQ or whatever and it might not even display at all! Player means it's just a streaming audio widget, in this case one for each beat, each referenced by ID in the Flash HTML and controlled via Javascript functions you write triggered by your own stop/play buttons. This can be applied to ANY free/open source Flash widget/player - which means your choices are greatly expanded, actually. You realize that now, right? The problem is iWeb makes it alot tougher than it should be if you want to customize. That's all.

Have a good one! :)

-jim
 

virus187

macrumors newbie
Original poster
Apr 23, 2009
17
0
Thanks for the advice Jim, Sorry for being rude I didnt really understand your methods and thought they may be abit long winded to something that may be easier to do

Thanks
Virus187
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
Most iWeb users are looking for plug/play and copy/paste solutions, and this might not be one of this situations, is the point. Most iWeb users would not even have noticed the audio streams can collide so I credit you for that. But if you can't find that miracle widget that resolves your issue, my plan "B" is really quite simple. It just happens to be new to you since iWeb does this thing for you and the Wimpy site is mostly copy/paste and upload. My intent was to fully inform you about that, prior to getting into code.

I'm sure by now you know that the Wimpy button itself uses Javascript with Flash, just like my plan "B". I visited their support page and found a section on how to setup multiple buttons. Not sure if that will resolve your issue or not, but please go here to find out and see "Using more than one button" on that page.

Whatever happens -- we're here to help.

-jim
 

virus187

macrumors newbie
Original poster
Apr 23, 2009
17
0
Thank you very much for taking time out to help me!!

I will check this out now! t
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.