sequence_keyframe_new

With this function you can create a new track keyframe struct, supplying the type of track that the keyframe will be applied to, which will be one of the following constants:

Constant Description Value
seqtracktype_graphic This is a graphics (sprite) asset track. 1
seqtracktype_audio This is an audio asset track. 2
seqtracktype_instance This is an instance asset track. 14
seqtracktype_sequence This is a sequence asset track. 7
seqtracktype_clipmask This is a clip mask group asset track. 8
seqtracktype_clipmask_mask This is a clip mask sprite asset track used for generating the clip mask. 9
seqtracktype_clipmask_subject This is a clip mask sprite asset track that is being masked. 10
seqtracktype_group This group folder asset track. 11
seqtracktype_colour This is a colour data parameter track. 4
seqtracktype_real This is a real number value parameter track. 3
seqtracktype_message This is a broadcast message track. 15
seqtracktype_moment This is an event/moment track. 16
seqtracktype_bool Not used currently. 5
seqtracktype_string Not used currently. 6
seqtracktype_spriteframes Not used currently. 13
seqtracktype_empty Not used currently. 12

 

The function will return a track keyframe struct which can then have data added to it before being assigned to a track struct.

 

Syntax:

sequence_keyframe_new(type);

Argument Description
type The type of keyframe to create, a constant, listed above.

 

Returns:

Struct

 

Example:

myseq = sequence_create();
var mytracks = array_create(1);
mytracks[0] = sequence_track_new(seqtracktype_graphic);
var graphickeys = array_create(1);
graphickeys[0] = sequence_keyframe_new(seqtracktype_graphic);
graphickeys[0].frame = 0;
graphickeys[0].length = 1;
graphickeys[0].stretch = true;
graphickeys[0].disabled = false;
var graphickeydata = array_create(1);
graphickeydata[0] = sequence_keyframedata_new(seqtracktype_graphic);
graphickeydata[0].spriteIndex = spr_Platform;
graphickeydata[0].channel = 0;
graphickeys[0].channels = graphickeydata;
mytracks[0].name = "TestGraphicTrack";
mytracks[0].keyframes = graphickeys;
myseq.tracks = mytracks;

The above code creates a new sequence and then creates a graphic asset track and sets some keyframe data on the track. This track is then assigned to the instance.