This was tested and works:
Code:
sequence_destroy(layer_sequence_get_sequence(sequence));
In the documentation it's there, just a bit cryptic. layer_sequence_create() does not create the same thing as sequence_create(). In fact, sequence_create()'s result can be fed into layer_sequence_create() (And probably should be) to establish the same link you currently have using an asset sequence in layer_sequence_create(). In either case, where layer_sequence_create() is used, if you want to delete the sequence, you will need to call layer_sequence_get_sequence() on it to get the actual sequence back to feed into sequence_destroy() (you CAN, however, call sequence_destroy() on the result of sequence_create() directly).
This is an educated guess:
Conversely, layer_sequence_*() functions should only work on the result of layer_sequence_create() (And not the result of sequence_create() directly without first using layer_sequence_create() on sequence_create()'s result to use with the layer_sequence_*() functions).
Full disclosure:
I have not actually done anything with sequences, yet! The above was gathered solely from the documentation (And testing the proposed solution).
..........................................................................................................
Thanks for you comment and time. Greatly appreciated!!
Hmmm. When I try.......
sequence_destroy(layer_sequence_get_sequence(seqOne));
It errors.
sequence_destroy() - can't delete a sequence created in the IDE at object GML_object_o_controller (line 11).
Okay I understand what the manual and you are saying. If I use instance_sequence_create then I will need its sequence ID to destroy it.
Create the sequence:
seq1ID = layer_sequence_create("seq",320,180,seq_1)
IF button is pressed event:
//get the sequence ID.
hell= layer_sequence_get_sequence(seq1ID)
//Now I can destroy it using the sequence ID.
sequence_destroy (hell);
............................
Of course that doesn't work. It gives the same error. My mind is seq1ID is my sequence ID so why am I getting the ID of a ID?
So I try layer_sequence_get_sequence (seq_1);
Getting the ID directly from the sequence but that gives the same error. But that I kind of understand because its the name of the sequence not the running sequence Id.
And when I create a sequence I am making a "sequence object"? I can't understand what that is.
Seems like a simple thing that is beyond my faculties.
The manual.
With this function you can destroy a sequence object that has been created dynamically. You supply either the sequence object struct (as returned by the function
sequence_create()) or the sequence ID (as returned by the function
layer_sequence_get_sequence() or from the sequence instance struct property sequence). This function should be used whenever a dynamically created sequence is no longer required to free up the memory associated with it.