With this function you can set the playhead position of a sequence element to a specific frame. You supply the sequence element ID as returned by layer_sequence_create() or by one of the layer element functions along with the new position to set. Note that the position is in frames and if you set a value greater than the total number of frames (or less than 0) then the actual final playhead position will depend on the type of sequence playback that has been selected, following these rules:
Setting the head position in this way will not stop playback and the sequence will simply continue from the new playhead position unless it is paused.
layer_sequence_headpos(sequence_element_id, position)
Argument | Type | Description |
---|---|---|
sequence_element_id | Sequence Element ID | The unique ID value of the sequence element to target |
position | Real | The position within the sequence (in frames) to set the playhead position to (can be a decimal value) |
N/A
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_headpos(a[i], 0)
}
}
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 their playhead position is set to 0.