I have some buttons that have a sound on mouse over and they may get to bug someone so is there a way to have a button to turn them off and back if needed?
Professional Software Development Tools
I have some buttons that have a sound on mouse over and they may get to bug someone so is there a way to have a button to turn them off and back if needed?
Going to ask how can I show the time on the window?
As to the sound, just add a button with Audio.TogglePlay action. This would play/pase your audio channel.
I did not understand your second post....
Yossi
Sure, here you go.![]()
Well I have 7 or 8 buttons that each have their own mouse over sound so would need to turn them all on and off .see screenshot
I was wondering if you can display the time on the window someplace?
Hi. In the example above the sound is toggled for all buttons, which should work as you want. See attached for a project which shows the time...![]()
To get rid of the mouseover and click sounds, make sure the properties pane is visible, select the buttons and set the HighLightSound and ClickSound to None. See attached image.
I think that is what you were asking, not how to turn off the sounds at runtime.
Last edited by Dermot; 11-14-2009 at 09:34 PM.
Dermot
I am so out of here
Thanks for the help Corey , guys.
No problem.![]()
Here is a function that I wrote that can be used to mute all button objects sound. It will find all the buttons on a page and change the properties so that their sound is set to none.
I realize that the function would toggle everything on the page so here is one just for the button object. This function does not handle custom sounds but shouldn't be too hard to get it to do so.
use ToggleAudio(true) to enable sound on the buttons and ToggleAudio(false) to disable audio on button objects.Code:function ToggleAudio(bAudio) -- Set local variables local tbObjects = {}; local tbProps = {}; local Object = nil; local vSound = nil; local tbObjectType = {}; tbObjectType[0] = Button; --Determine if audio should be on or off and set variables --so turn sound on or off as appropriate if bAudio then vSound = SND_STANDARD;--used for object properties nVol = 100;--used for video and mediaplayer --Audio.SetVolume(CHANNEL_ALL, 255);--sets audio globally for channels else vSound = SND_NONE; nVol = 0; --Audio.SetVolume(CHANNEL_ALL, 0); end --get the objects on the page if there are objects then proceed tbObjects = Page.EnumerateObjects(); if tbObjects then for i,v in tbObjects do --for each item in the table get the type Object = tbObjectType[Page.GetObjectType(v)]; --if the object existed in the table above then if Object then --get the properties for the object tbProps = Object.GetProperties(v); --set the sound properties to the variable determined above tbProps.HighlightSound = vSound; tbProps.ClickSound = vSound; --set the properties back to the object Object.SetProperties(v, tbProps); end end end end
Tigg
Last edited by TJ_Tigger; 02-07-2006 at 07:07 AM.
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Ok here is another that keeps track of custom sound buttons.
Code:function ToggleAudio(bAudio) -- Set local variables local tbObjects = {}; local tbProps = {}; local Object = nil; local vSound = nil; local tbObjectType = {}; tbObjectType[0] = Button; --Determine if audio should be on or off and set variables --so turn sound on or off as appropriate if bAudio then vSound = SND_STANDARD;--used for object properties nVol = 100;--used for video and mediaplayer --Audio.SetVolume(CHANNEL_ALL, 255);--sets audio globally for channels else g_tbSndCustom = {}; --used to store custom sounds vSound = SND_NONE; nVol = 0; --Audio.SetVolume(CHANNEL_ALL, 0); end --get the objects on the page if there are objects then proceed tbObjects = Page.EnumerateObjects(); if tbObjects then for i,v in tbObjects do --for each item in the table get the type Object = tbObjectType[Page.GetObjectType(v)]; --if the object existed in the table above then if Object then --get the properties for the object tbProps = Object.GetProperties(v); --Store custom sound information in a table if bAudio == false and (tbProps.HighlightSound ~= SND_STANDARD or tbProps.ClickSound ~= SND_STANDARD) then g_tbSndCustom[v]={}; if tbProps.HighlightSound ~= SND_STANDARD then g_tbSndCustom[v]["HS"] = tbProps.HighlightSound end if tbProps.ClickSound ~= SND_STANDARD then g_tbSndCustom[v]["CS"] = tbProps.ClickSound end end --set the sound properties to the variable determined above if bAudio and g_tbSndCustom[v] then -- If Both are true then the item contains custom sound if g_tbSndCustom[v]["HS"] then tbProps.HighlightSound = g_tbSndCustom[v]["HS"] end if g_tbSndCustom[v]["CS"] then tbProps.ClickSound = g_tbSndCustom[v]["CS"] end else tbProps.HighlightSound = vSound; tbProps.ClickSound = vSound; end --set the properties back to the object Object.SetProperties(v, tbProps); end end end end if bAudio then ToggleAudio(false); bAudio = false; else ToggleAudio(true); bAudio = true; end
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine