Graphics

 View Only
  • 1.  Counter Widget linked with Sound Effect

    Posted 02-03-2016 18:38
    Hello,

    I need to attach a sound effect to a counter widget so it triggers every time I increment the counter. Is this possible?

    Thanks in advance.


  • 2.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 18:45
    Yes, put your sound on a new scenedirector, then on the "onsettext" of your textobject that receive your widget's data, get your scenedirector and play it...
    #XPression


  • 3.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 18:53
    Thanks - what is the exact script to get the scene director and play it?
    #XPression


  • 4.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 21:27
    I tried what is below and it works for the first 'ding' but I need to really have it 'ding' on each increment. I just don't know the proper script for 'ding on each increment'.
    I'm sure it is very simple, but scripting isn't my forte. Help me learn, please.

    dim sd as xpSceneDirector

    scene.GetSceneDirectorByName("Audio", sd)

    if text="1" then

    sd.Play

    else if text="0" then

    sd.Stop

    sd.Position = 0

    end if
    #XPression


  • 5.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 21:58
    Why is there a condition ? Just do a sd.playrange(0,XXXX) where XXX is the lengrh of your sound.
    #XPression


  • 6.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 22:03
    Thanks Vinz, the playrange useful down the road. However, I have a separate scene director that contains my audio 'ding'. I'm using a counter widget that I increment on-air and each time it increments I need to trigger that scene director. I can get it to trigger on the first increment using the simple script above, however I need it to trigger the scene director every time I increase the number while it is on-air. I'm sure it is some 'greater than' something that I just don't know! Thanks!
    #XPression


  • 7.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 22:09
    If you put this code in "onsettext", you'll hear the ding each time te value is changed (up down or reset).

    If you don't want that, put an empty textobject to contain your old value. And in your script, do a condition to check if new value is greater than the old one. If yes, do a ding, update the old value. If no, just update the old value...
    #XPression


  • 8.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 22:32
    Oh so easy!!
    Thanks Vinz - works perfectly.

    Now, just curious. Is there a way to play a scene director on a countdown timer when the value=0?
    #XPression


  • 9.  RE: Counter Widget linked with Sound Effect

    Posted 02-03-2016 23:39
    Same technic, with a new condition, if new value = 0 AND old value > 0
    #XPression


  • 10.  RE: Counter Widget linked with Sound Effect

    Posted 02-22-2016 22:21
    Rather than a script, we use visual logic and do a block that fires an animation if the value of our timer <.01.>
    #XPression