Frame

With the Frame functions, you can retrieve values from frames and you can add and remove frames in your scene.

The following is a list of the Frame functions:

current
insert
numberOf
remove
setCurrent

Example

This example is called as soon as a scene is opened.

function sceneOpened()

{

// this part of the function launches the newScene function if

// the scene has only one frame

if (frame.numberOf() == 1)

newScene();

}

 

function newScene()

{

// this function opens a dialog box named Create New Scene, which

// allows users to enter the number of frames to add to the scene

var d = new Dialog;

d.title = "Create New Scene";

var nbFrames = new SpinBox;

nbFrames.label = "Number of Frames";

nbFrames.minimum = 1;

nbFrames.maximum = 300;

nbFrames.value = 60;

d.add(nbFrames);

 

if (d.exec())

{

var oldNbFrames = frame.numberOf();

frame.insert(0, nbFrames.value - oldNbFrames);

}

}

Related Topics 

Scripting Reference