Graphics

 View Only
  • 1.  Scripting Question

    Posted 05-17-2014 20:23
    I'm trying to reconfigure a scene to make it cleaner, but I need some scripting help.

    I currently have a scene with a "date bug" on it. There is a script that asks if there should be a date bug, and the options are either Y or N.

    If it's a Y, then the date bug is visible. If it's N, then the date bug is not visible.

    I'm wondering if there's a way to tell it to be visible if there is any text inputted into the Date text field, and keep it hidden if there's nothing in the Date text field.

    Thanks!


  • 2.  RE: Scripting Question

    Posted 05-18-2014 19:41
    Some thing like this in OnOnline would do what you describe (change the object names as appropriate):



    dim datebug as xpBaseObject

    dim datefield as xpTextObject

    self.GetObjectByName("quad1", datebug)

    self.GetObjectByName("text1", datefield)

    datebug.visible = Len(Trim(datefield.text)) > 0



    #XPression


  • 3.  RE: Scripting Question

    Posted 05-18-2014 19:47
    Awesome. Thank you, I will try that.

    Thanks!

    #XPression


  • 4.  RE: Scripting Question

    Posted 05-19-2014 14:47
    Brian:

    Just curious why you used the Trim( function? I've used it without many times for just about this same application with no problems.

    #XPression


  • 5.  RE: Scripting Question

    Posted 05-19-2014 14:54
    I suppose using the trim function would eliminate any extra spaces at the beginning of the date that the user inputs. That gives me an idea for my regular lower thirds because I have reporters and producers routinely putting a space at the beginning on accident.

    #XPression


  • 6.  RE: Scripting Question

    Posted 05-19-2014 15:27
    yes, I figured if someone accidentally put only a space in the field they might think it was empty and that the bug wouldn't show up.. So, I figured it was best to trim spaces out.

    #XPression