ID:262292
 
Code:
obj
boomBox
icon = 'Boom Box.dmi'
icon_state = "Boom Box"
Click(S as sound)
alert("You will be able to play your own kind of music (note: ONLY MID OR WAV you can play sorry)")
switch(alert("What do you wish to do?",,"Play Music","Stop Music"))
if("Play Music")
view(30) << sound(S,1)
view(30) << "[usr] has played a song."

if("Stop Music")
view(30) << sound(null)
view(30) << "[usr] has stop the music"


Problem description:
The problem is when i click on the boom box a alert box would apper so far so good and tehn i click on "Play Music"
nothing would happen.
I want a screen appering so you can get your music.
Please help me


Click() doesn't work like normal verbs, so you can't use the arguments in the same way. You'll need to prompt the player for a file using input(...) as sound|null.
obj
boomBox
icon = 'Boom Box.dmi'
icon_state = "Boom Box"
Click()
alert("You will be able to play your own kind of music (Note: You can only play .mid's, .midi's, and .wav's.)")
switch(alert("What do you wish to do?","Play Music","Stop Music"))
if("Play Music")
var/S = input("What song do you wish to play?") as null|sound
view(30) << sound(S,1)
view(30) << "[usr] has played a song."
if("Stop Music")
view(30) << sound(null)
view(30) << "[usr] has stop the music"


That should work. Knowing inout commands is vital for Click() procs. This is basically what the last post says, except coded for you.