manve1 Posted January 24, 2013 Share Posted January 24, 2013 When i use combo boxes and i have few problems with sound, as i am playing 2 sounds and i check which item was selected in the combo box. If i play one sound, then try play another sound, it just play's the one that was started to play firstly. I mean it doesn't change to different music type Link to comment
manve1 Posted January 25, 2013 Author Share Posted January 25, 2013 addEventHandler('onClientGUIClick', buttonRadioPlay, function( ) if (guiComboBoxGetItemText(genreBox, 'Dance/Dj')) then if (sound) then stopSound( sound ) end sound = playSound( Dance_Dj ) elseif (guiComboBoxGetItemText(genreBox, 'Classic')) then if (sound) then stopSound( sound ) end sound = playSound( Classic ) end end ) Every thing is defined, i just don't want to post the website link. Link to comment
Blaawee Posted January 25, 2013 Share Posted January 25, 2013 addEventHandler('onClientGUIClick', buttonRadioPlay, function( ) if (guiComboBoxGetItemText(genreBox, 'Dance/Dj')) then if (sound) then stopSound( sound ) end sound = playSound( Dance_Dj ) elseif (guiComboBoxGetItemText(genreBox, 'Classic')) then if (sound) then stopSound( sound ) end sound = playSound( Classic ) end end ) Every thing is defined, i just don't want to post the website link. well you didn't wrote the type of the sound and it should be a string like this : sound = playSound( 'Dance_Dj.mp3' ) Link to comment
manve1 Posted January 25, 2013 Author Share Posted January 25, 2013 im using a variable? something like: local a = 7 local b = 2 outputChatBox( 'A = '.. a ..' and B = '.. b, source, 255, 255, 255 ) Link to comment
Blaawee Posted January 25, 2013 Share Posted January 25, 2013 im using a variable?something like: local a = 7 local b = 2 outputChatBox( 'A = '.. a ..' and B = '.. b, source, 255, 255, 255 ) o.k then : guiComboBoxGetItemText ( element comboBox, int itemId ) comboBox: The combobox containing the item you're interested in itemId: The index of the item that's mean the number of item Link to comment
manve1 Posted January 25, 2013 Author Share Posted January 25, 2013 it works with words aswell, after changing to numbers same problem #Edit: The first one on top I mean like: Dance/Dj will play always whatever i chose in that combo box, BUT if i change to Classic to be on top of Dance/Dj the classic will always play Link to comment
Smart. Posted January 25, 2013 Share Posted January 25, 2013 it works with words aswell, after changing to numbers same problem #Edit: The first one on top I mean like: Dance/Dj will play always whatever i chose in that combo box, BUT if i change to Classic to be on top of Dance/Dj the classic will always play Did you use guiComboBoxGetSelected ? Link to comment
manve1 Posted January 25, 2013 Author Share Posted January 25, 2013 Smart. Sorry i didn't post that i figured this out, but yeh, i realized this morning i forgot to do it with guiComboBoxGetSelected Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now