layer_sequence_destroy

With this function you can destroy (remove from the room) a sequence element. You supply the sequence element ID as returned by layer_sequence_create() or by one of the layer element functions and the sequence will be destroyed.

 

Syntax:

layer_sequence_destroy(sequence_element_id)

Argument Description
sequence_element_id The unique ID value of the sequence element to target

 

Returns:

N/A

 

Example:

var a = layer_get_all_elements(layer);
for (var i = 0; i < array_length(a); i++;)
    {
    if layer_get_element_type(a[i]) == layerelementtype_sequence
        {
        layer_sequence_destroy(a[i])
        }
    }

The above code gets the IDs for all the elements assigned to the layer of the instance running the code. The code then checks to see if any of the returned elements are sequence assets and if they then they are destroyed.