DirectAnimation Animated Header --Cycler Class DirectAnimation Animated Header --Cycler Class* Microsoft DirectAnimation SDK
*Index  *Topic Contents
*Previous Topic: ColorBvr Class
*Next Topic: DashStyleBvr Class

Cycler Class


public class Cycler extends java.lang.Object {
    // Constructor
    Cycler(Behavior[] arrToCycleThrough, DXMEvent eventToCycleUpon);
    
    //Methods
    public Behavior getBvr();
    

The Cycler object cycles through an array of values when an event occurs. Here is an example that cycles through the colors red, green, blue, yellow, red, green, and so on, each time the left mouse button is pressed:

//Cycle through a series of colors
//Create the array to contain the values
Behavior behavior[4] = {red, green, blue, yellow};
//Construct Cycler object
//Associate values in array with the left mouse button event
Cycler cyl = new Cycler(behaviors, leftButtonDown);
//Set the color equal to the next value in the array
ColorBvr col = (ColorBvr)(cyl.getBvr());

The following example cycles through an array of sounds:

//Create an array of sounds
Behavior[]snds = {snd1, snd2, snd3};
Cycler cycle = new Cycler(snds, leftButtonDown);
SoundBvr currentSnd = (SoundBvr)(cycle.getBvr();


Cycler Constructor

Cycler Class

Creates a cycler object.

Cycler(
  Behavior[] arrToCycleThrough,
  DXMEvent eventToCycleUpon
  );

Parameters
arrToCycleThrough
The array of values cycled through when an event occurs.
eventToCycleUpon
The event that causes the Cycler object to cycle through the array of values.


Cycler Methods

bullet1.gifgetBvr


getBvr

Cycler Class

Retrieves a Behavior object from the array. The behavior that is returned doesn't itself respond to the provided event. The behavior must be running before the events can have any effect.

public Behavior getBvr( );

Return Values

Returns the Behavior object.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page