Music Players

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 24th, 2003, 13:21
New Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
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

  #2 (permalink)  
Old Oct 24th, 2003, 15:39
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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!
  #3 (permalink)  
Old Oct 24th, 2003, 17:04
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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:

Code: Select all
mySound = new Sound();
mySound.attachSound("sound_ID");
where sound_ID is the link identifier for your sound

And two buttons. Start and stop.

Start:

Code: Select all
on (release) {
    mySound.start(0,999);
}
where 0 is the starting place in the sound, in seconds and 999 is the number of loops.

Stop:

Code: Select all
on (release) {
    mySound.stop();
}

You can download the FLA file HERE.
Hope this helps!
  #4 (permalink)  
Old Oct 24th, 2003, 20:30
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Sirkent, I had to go to class, but I knew you would come to save the day :wink:
Closed Thread

Tags
music, players

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 01:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43