This is a discussion on "Music Players" within the Flash & Multimedia Forum section. This forum, and the thread "Music Players are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Music Players
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Music Players
Im making a music player like on http://www.therevolutionsmile.com/ but i dont know how to make the links so that when theyre clicked the music stops etc
|
|
|
|
|||
|
Well.. I can tell you how they might have done it...
It looks like they made it a seperate movie clip from the original movie. In that movie clip they included what you see as a graphic. Inside that graphic is where you would find the stop, play, and Previosu/Next Buttons. You have to add the graphic step or the buttons will not be interactive, which means the action script you add to them won't work. It's much easier for me to build an example then express it in words, so I will build a .fla file and post it for your downloading pleasure. Unless of course Sirkent gets here, he's the man when it comes to flash! |
|
|||
|
Ok, here's a step-by-step walkthrough that assumes you don't know any actionscript whatsoever! If you do, skip down to the bottom to see the code!
Import your flash file by using File>Import. Now open the library (F11 or Window>Library) and find your item. Right-click on it and choose "Linkage". Tick "Export for Actionscript" and it will tick "Export in first frame" for you in Flash MX. Give the sound an identifier too. I chose "sound_ID" to make this example easy for you to follow. Ok all that and you can now close the library if you like. Now go to an appropriate place in your flash file. Remember, the sound is going to be exported in the first frame of your movie. Find an appropriate frame in your flash file. Right-click it and choose "Actions". You'll see a tree-like menu (The actionscript library) on your left. First expand "Actions" and "variables" and double-click "set Variable". Type any name under "Variable", I chose "mySound" and for value, expand "Objects", "Movie" then "Sound" and double click "new Sound", which should then become your value. Tick "Expression" for your value "new Sound()". Now expand "Methods" under sound and double-click "attachSound". Enter "mySound" (or whatever value you used) as the object and "sound_ID" or whatever you used as the parameter. Please make sure that the parameter is in quotes!! Otherwise flash will look for the variable sound_ID not the object. You'll notice you also have "start" and "stop" methods which you can use, with the newly created sound object to start and stop your sound. If your button is in the same place as your code, all you need to do it use mySound.start(0,99999); where 0 is the offset (the number of seconds through the sound you want to start at) and 99999 is the number of loops you want the sound to perform. Set a high value like 99999 if you want it to loop "forever". Stop can be used in a similiar way: mySound.stop(); It takes no parameters. <hr noshade size="1"> So you should end up with the following on your first frame:
And two buttons. Start and stop. Start:
Stop:
You can download the FLA file HERE. Hope this helps! |
![]() |
| Tags |
| music, players |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Music fun... | MrMadison | Webforumz Cafe | 63 | Jul 14th, 2007 07:49 |
| Add Any Music You Want??? | ilovemylamp | Flash & Multimedia Forum | 0 | Feb 21st, 2007 06:30 |
| flash music player that plays music throughtout | saxy46 | Flash & Multimedia Forum | 5 | Aug 23rd, 2006 14:24 |
| music | Hate_Phones | Web Page Design | 8 | Nov 20th, 2005 21:56 |
| Now Music | u2orange | Entry, Nominations and Voting | 6 | Oct 8th, 2003 07:33 |