Developer version

Installation

If you use Adobe Flash CS3 IDE open 3DBoxRotator.mxp file from component's archive. Component should be installed by using the Adobe Extension Manager. You need to have this software installed before continuing with the component setup. You can download the Extension Manager from the
Adobe site. After installing you will find 3D Box Rotator component in Components window (Window -> Components) in the NepxComponents folder. Drag it to your project library. Component installed for Adobe Flash CS3. Complete!

If you use the Flex SDK MXMLC compiler, you need to add the 3DBoxRotator.swc to project as linked library.

First run

You can find this example in samples/FirstRun/ directory in the component's archive.

Install 3DBoxRotator and 3DBoxController components and drag they to library. Create one BitmapData clip (SampleBitmap) and three Sprite clips (Symbol 1, Symbol 2, Symbol 3) with 300x80 size like in FirstRun.fla file. Set class name for each clip, respectively: SampleBitmap, Symbol1, Symbol2, Symbol3 (Library -> Symbol -> Right mouse click -> Linkage -> Class field). Type this code:

import ru.nepx.boxRotator.BoxRotator;
import ru.nepx.boxRotator.AutoRotatorType;
import ru.nepx.boxRotator.controllers.BoxRotatorController;

var box:BoxRotator = new BoxRotator(); //create the component with default settings
box.x = 300;
box.y = 180;
box.width = 130;
box.height = 80;

//adding items
box.addBitmapItem(new Bitmap(new SampleBitmap(130, 80))); //add the Bitmap to box
box.addInteractiveItem(new Symbol1()); //add the Sprite to box
box.addInteractiveItem(new Symbol2());
box.addInteractiveItem(new Symbol3());

box.draw();

addChild(box);

var controller:BoxRotatorController = new BoxRotatorController(box); //create controls for box
addChild(controller);

//start slide show with default timeout 1 sec
box.startAutoRotation(AutoRotatorType.ASCENDING, 1); // way 1
controller.selectAutoMode(AutoRotatorType.ASCENDING, 1); // way 2 via controller
			

Learn FirstRun sample for getting more information.

Settings

Install settings via the special BoxRotatorSettings class. Use instance of this class as argument in BoxRotator class constructor. Example with default settings:

var settings:BoxRotatorSettings = new BoxRotatorSettings();

settings.perspectiveCoeff = 300;
settings.rotateDirection = RotateType.VERTICAL;
settings.rotateTransition = "easeInOutQuad";
settings.rotateTime = 0.6;
settings.enableRotateChangeDistance = true;
settings.rotateChangeDistance = 20;

var box:BoxRotator = new BoxRotator(settings);
		

Making own interactive item

As I already said we may use any InteractiveObjects (flash.display.InteractiveObject) such as MovieClip, Sprite, TextField, etc. For example, Stock Exchange sample (samples/StockExchange/):

box.addInteractiveItem(new StockBox("Nasdaq", 2183.34));
		

If you use the dynamic content (changes, animations, etc.) I recommend you to use two functions: activate and deactivate. StockBox.as file:

public function activate():void {
	_preloader.start();
	startPriceChanger();
}

public function deactivate():void {
	_preloader.stop();
	stopPriceChanger();
}
		

These two functions call during show or hide sides: when side hides call the deactivate function, which stops price changing in StockBox class. The activate function works similarly . It will save CPU efficiency, Flash will work only with front side.

Learn Stock Exchange sample for getting more information.

Note: These functions are not compulsory.

Eugene Nepomnyaschy (my site).