gre.send_event_target

gre.send_event_target(
    event_name,
    target,
    [channel]
)
            

Send an event to a targeted model element (control, layer instance or screen) using the model's fully qualified path. The channel is an optional parameter.


Parameters:
        event_name    A string containing the event to send
        target        A string containing the object to target the event to (see Storyboard IO)
        channel       An optional Storyboard IO channel to send the event on, if not specified the
                      event is added directly into the current Storyboard application event queue
                      if neither the environment variable or global GREIONAME variable are set.

Returns:
        true for success, false for failure and error message string, e.g. "Can't open greio channel my_channel" 

Example:


            

-- Send an event directed at a particular control target:
gre.send_event_target("my_event", "my_layer.my_control")
                        

-- Send an event directed at a particular control on the channel
-- "io_channel_name" and grab the status of the operation

local success, error = gre.send_event_target("my_event",
    "my_layer.my_control", "io_channel_name")
if(success == false) then
    print(error)
    --handle error
end