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:
local success, error = gre.send_event("my_event", “io_channel_name”)
if(success == false) then
    print(error)
    --handle error
end
            

-- Send to the event directed at a particular control target:
gre.send_event("my_event", "my_layer.my_control")