PackageTop Level
Interfacepublic interface IRvFreeSpin3D

The interface class for a FreeSpin3D model.



Property detail
RviAutoRunproperty
RviAutoRun:Boolean  [read-write]

Handles the model's AutoRun state. If AutoRun is off, there's no key/mouse interactivity, no auto-rotation and if the model is animated - the animation stops.

Implementation
    IRvFreeSpin3D function get RviAutoRun():Boolean
    IRvFreeSpin3D function set RviAutoRun(value:Boolean):void

See also

RviAutoXproperty 
RviAutoX:Number  [read-write]

Handles an automatic rotation along X axis.

Implementation
    IRvFreeSpin3D function get RviAutoX():Number
    IRvFreeSpin3D function set RviAutoX(value:Number):void

See also

RviAutoYproperty 
RviAutoY:Number  [read-write]

Handles an automatic rotation along Y axis.

Implementation
    IRvFreeSpin3D function get RviAutoY():Number
    IRvFreeSpin3D function set RviAutoY(value:Number):void

See also

RviBacksideFrameFlagproperty 
RviBacksideFrameFlag:Boolean  [read-write]

Handles the Backside flag.

Implementation
    IRvFreeSpin3D function get RviBacksideFrameFlag():Boolean
    IRvFreeSpin3D function set RviBacksideFrameFlag(value:Boolean):void
RviDisplayListproperty 
RviDisplayList:Boolean  [read-write]

Handles the storing of the display list. This flag should be false when changing the texture at runtime.

Implementation
    IRvFreeSpin3D function get RviDisplayList():Boolean
    IRvFreeSpin3D function set RviDisplayList(value:Boolean):void
RviDoPreparationproperty 
RviDoPreparation:Boolean  [read-write]

Handles the display list functionality. The setter is effective only before running RviInit().

Implementation
    IRvFreeSpin3D function get RviDoPreparation():Boolean
    IRvFreeSpin3D function set RviDoPreparation(value:Boolean):void

See also

RviKeyInteractiveproperty 
RviKeyInteractive:Boolean  [read-write]

Handles the model interaction with the keys on the keyboard.

Implementation
    IRvFreeSpin3D function get RviKeyInteractive():Boolean
    IRvFreeSpin3D function set RviKeyInteractive(value:Boolean):void

See also

RviModelIdproperty 
RviModelId:String  [read-write]

Handles the id name of the model. The setter is effective only before running RviInit().

Implementation
    IRvFreeSpin3D function get RviModelId():String
    IRvFreeSpin3D function set RviModelId(value:String):void

See also

RviMouseInteractiveproperty 
RviMouseInteractive:Boolean  [read-write]

Handles the model interaction with the mouse.

Implementation
    IRvFreeSpin3D function get RviMouseInteractive():Boolean
    IRvFreeSpin3D function set RviMouseInteractive(value:Boolean):void

See also

RviOnCompleteproperty 
RviOnComplete:Function  [write-only]

Sets a function to be called when loading the model completes. The function is effective only before running RviInit().

Implementation
    IRvFreeSpin3D function set RviOnComplete(value:Function):void

See also

RviRotationMatrixproperty 
RviRotationMatrix:Array  [read-write]

Handles the rotation matrix of the model.

Implementation
    IRvFreeSpin3D function get RviRotationMatrix():Array
    IRvFreeSpin3D function set RviRotationMatrix(value:Array):void
RviSmoothTextureFlagproperty 
RviSmoothTextureFlag:Boolean  [read-write]

Handles the smoothing of the model's texture.

Implementation
    IRvFreeSpin3D function get RviSmoothTextureFlag():Boolean
    IRvFreeSpin3D function set RviSmoothTextureFlag(value:Boolean):void

See also

RviVectorForwardproperty 
RviVectorForward:Array  [read-only]

A vector of x,y,z coordinates in 'forward' direction.

Implementation
    IRvFreeSpin3D function get RviVectorForward():Array

See also

RviVectorLeftproperty 
RviVectorLeft:Array  [read-only]

A vector of x,y,z coordinates in 'left' direction.

Implementation
    IRvFreeSpin3D function get RviVectorLeft():Array

See also

RviVectorUpproperty 
RviVectorUp:Array  [read-only]

A vector of x,y,z coordinates in 'up' direction.

Implementation
    IRvFreeSpin3D function get RviVectorUp():Array

See also

RviViewModeproperty 
RviViewMode:String  [read-write]

Handles the view mode (precise or absolute) The setter is effective only before running RviInit().

Implementation
    IRvFreeSpin3D function get RviViewMode():String
    IRvFreeSpin3D function set RviViewMode(value:String):void

See also

RviZScalingFactorproperty 
RviZScalingFactor:Number  [read-write]

Handles an automatic scaling along the Z axis.

Implementation
    IRvFreeSpin3D function get RviZScalingFactor():Number
    IRvFreeSpin3D function set RviZScalingFactor(value:Number):void

See also

xproperty 
x:Number  [read-write]

Handles x coordinate.

Implementation
    IRvFreeSpin3D function get x():Number
    IRvFreeSpin3D function set x(value:Number):void

See also

y
z
yproperty 
y:Number  [read-write]

Handles y coordinate.

Implementation
    IRvFreeSpin3D function get y():Number
    IRvFreeSpin3D function set y(value:Number):void

See also

x
z
zproperty 
z:Number  [read-write]

Handles z coordinate.

Implementation
    IRvFreeSpin3D function get z():Number
    IRvFreeSpin3D function set z(value:Number):void

See also

x
y
Method detail
RviAddBehavior()method
IRvFreeSpin3D function RviAddBehavior(NewBehavior:IRvFreeSpin3DBehavior):void

Adds a behavior class to the model.

Parameters
NewBehavior:IRvFreeSpin3DBehavior — a class behavior.

See also


Example
The following code creates a behavior which constantly increases the x coordinate of the model.
   public class CRvBehavior implements IRvFreeSpin3DBehavior
   {
      private var my3DModel:IRvFreeSpin3D;
   
      public function RviInit(Object:IRvFreeSpin3D):void 
      {
         my3DModel = Object; 
      }
      public function RviAct():void 
      {
         my3DModel.x++;
      }
      public function RviRemove():void { };
      public function RviAddData(iData:Object):void { };
   }
   

The following code adds the behavior to the model.
   public class CRvAddingBehavior
   {
      public function CRvAddingBehavior(my3DModel:IRvFreeSpin3D)
      {
         var behavior:IRvFreeSpin3DBehavior = new CRvBehavior();
         my3DModel.RviAddBehavior(behavior);
      }
   }
   

RviAddBehaviorFunction()method 
IRvFreeSpin3D function RviAddBehaviorFunction(CallBack:Function):void

Adds a behavior function to the model.

Parameters
CallBack:Function — a function behavior.

See also

RviAddModel()method 
IRvFreeSpin3D function RviAddModel(ModelId:String, TextureName:String = null):Boolean

Adds a model to the component to create a cycle of animation.

Parameters
ModelId:String — The model's name.
 
TextureName:String (default = null) — The texture's name.

Returns
Boolean — whether the model was successfully added or not.

See also


Example
The following code adds 3 models to the component to make a walking boy animation cycle:
   for (var i:uint = 0; i < 3; ++i)
   {
      my3DModel.RviAddModel("BoyWalk_"+i, "BoyWalk");
   }
   

RviAttachData()method 
IRvFreeSpin3D function RviAttachData(Data:Object):void

Attaches a data object to the model.

Parameters
Data:Object — the attached data object.

See also


Example
The following code attaches a string data to the model.
   var data:Object = new Object();
   data.str = "This is a textual attached data.";
   my3DModel.RviAttachData(data);
   

RviBytesLoaded()method 
IRvFreeSpin3D function RviBytesLoaded():int

Returns
int — the number of bytes loaded.

See also

RviBytesTotal()method 
IRvFreeSpin3D function RviBytesTotal():int

Returns
int — the total bytes to be loaded.

See also

RviCheckDisplayObjectCollision()method 
IRvFreeSpin3D function RviCheckDisplayObjectCollision(MovieClip:DisplayObject, ShapeFlag:Boolean = false):Boolean

Checks if the model collides with another object.

Parameters
MovieClip:DisplayObject — An object to check collision with.
 
ShapeFlag:Boolean (default = false)

Returns
Boolean — the result of the collision's detection.

See also


Example
The following code checks for collision between my3DModel and a DisplayObject with the instance name "displayObject" from the stage.
   my3DModel.RviCheckDisplayObjectCollision(displayObject);
   

RviCheckFreeSpin3DModelCollision()method 
IRvFreeSpin3D function RviCheckFreeSpin3DModelCollision(Fs3dMovieClip:IRvFreeSpin3D, ShapeFlag:Boolean = false):Boolean

Checks if the model collides with another model.

Parameters
Fs3dMovieClip:IRvFreeSpin3D — A second model to check collision with.
 
ShapeFlag:Boolean (default = false)

Returns
Boolean — the result of the collision's detection.

See also


Example
The following code checks for collision between my3DModel and another3DModel.
   my3DModel.RviCheckFreeSpin3DModelCollision(another3DModel);
   

RviCheckPixelCollision()method 
IRvFreeSpin3D function RviCheckPixelCollision(X:Number, Y:Number, ShapeFlag:Boolean):Boolean

Checks if the model collides with a x,y pixel values.

Parameters
X:Number — A pixel property on X axis.
 
Y:Number — A pixel property on Y axis.
 
ShapeFlag:Boolean

Returns
Boolean — the result of the collision's detection.

See also


Example
The following code checks for collision between my3DModel and the mouse cursor.
   var modelParent:Sprite = Sprite(my3DModel).parent as Sprite;
   my3DModel.RviCheckPixelCollision(modelParent.mouseX,modelParent.mouseY, true);
   

RviDuplicate()method 
IRvFreeSpin3D function RviDuplicate(CloneTexture:Boolean = false):IRvFreeSpin3D

Duplicates the model with all its properties.

Parameters
CloneTexture:Boolean (default = false)

Returns
IRvFreeSpin3D — the duplicated model.

Example
The following code duplicates the model.
   var duplicatedModel:IRvFreeSpin3D = my3DModel.RviDuplicate();
   

RviGet2dHeight()method 
IRvFreeSpin3D function RviGet2dHeight():Number

Returns
Number — the 2d-height of the Model in its current position.

See also

RviGet2dWidth()method 
IRvFreeSpin3D function RviGet2dWidth():Number

Returns
Number — the 2d-width of the Model in its current position.

See also

RviGetAttachedData()method 
IRvFreeSpin3D function RviGetAttachedData():Object

Returns
Object — the data object attached with RviAttachData().

See also


Example
The following code retrieves the data which was attached to the model at the example of RviAttachData().
   var attachedObject:Object = my3DModel.RviGetAttachedData();
   var attachedText:String = attachedObject.str;
   trace(attachedText); //output: This is a textual attached data.
   

RviGetBounds()method 
IRvFreeSpin3D function RviGetBounds(BoundsObj:DisplayObject):Rectangle

Parameters
BoundsObj:DisplayObject — The object whose bounds are returned.

Returns
Rectangle — the bounds of the 3d-Model.
RviGetFrameX()method 
IRvFreeSpin3D function RviGetFrameX():Number

Returns
Number — the current frame along the X axis.

See also

RviGetFrameY()method 
IRvFreeSpin3D function RviGetFrameY():Number

Returns
Number — the current frame along the Y axis.

See also

RviGetMaxProgress()method 
IRvFreeSpin3D function RviGetMaxProgress():Number

Returns
Number — the max progress index (max frame).

See also

RviGetModelId()method 
IRvFreeSpin3D function RviGetModelId():String

Returns
String — the model id name.
RviGetObjectsCount()method 
IRvFreeSpin3D function RviGetObjectsCount():Number

Returns
Number — the number of objects in the model.

Example
The following code sets the colors of all the objects in the model to red.
   for (var i:uint = 0;  i < my3DModel.RviGetObjectsCount(); ++i)
   {
      my3DModel.RviSetColor(0xff0000, i);
   }
   

RviGetOriginalDimensions()method 
IRvFreeSpin3D function RviGetOriginalDimensions():Array

Returns
Array — the original dimentions of the model.
RviGetPolygonNumber()method 
IRvFreeSpin3D function RviGetPolygonNumber():Number

Returns
Number — the number of polygons in the model.
RviGetProgress()method 
IRvFreeSpin3D function RviGetProgress():Number

Returns
Number — the current progress index (current frame reading).

See also

RviGetProgressAsPercents()method 
IRvFreeSpin3D function RviGetProgressAsPercents():int

Returns
int — the percentage of the bytes loaded.

See also

RviGetRenderMode()method 
IRvFreeSpin3D function RviGetRenderMode():String

Returns
String — the render's mode.
RviGetResolutionX()method 
IRvFreeSpin3D function RviGetResolutionX():Number

Returns
Number — the resolution along the X axis

See also

RviGetResolutionY()method 
IRvFreeSpin3D function RviGetResolutionY():Number

Returns
Number — the resolution along the Y axis

See also

RviGetTexture()method 
IRvFreeSpin3D function RviGetTexture(ObjectIndex:Number):BitmapData

Gets the model's BitmapData.

Parameters
ObjectIndex:Number — The index of the object in the model.

Returns
BitmapData — The data of the texture.

See also

RviGetXAngle()method 
IRvFreeSpin3D function RviGetXAngle():Number

Returns
Number — the angle on X axis.

See also

RviGetYAngle()method 
IRvFreeSpin3D function RviGetYAngle():Number

Returns
Number — the angle on Y axis.

See also

RviInit()method 
IRvFreeSpin3D function RviInit(CallbackFunction:Function = null, ModelName:String = "", ViewMode:String = "", RotateAPI:String = ""):Boolean

Initiates properties of the model before loading is started. This function is called only if AutoRun is set to false.

Parameters
CallbackFunction:Function (default = null) — A function to be called when loading completes.
 
ModelName:String (default = "") — A model's name.
 
ViewMode:String (default = "") — A view mode. Two possible values are: 'Absolute' (default) and 'Smooth'.
 
RotateAPI:String (default = "") — Data.

Returns
Boolean — whether or not the loading succeeded.

Example
The following code initiates the model with the callback function called 'Start', a model called 'audi' and with a 'Smooth' view mode.
   my3DModel.RviInit(Start,"audi","Smooth");
   

RviIsAbsoluteViewMode()method 
IRvFreeSpin3D function RviIsAbsoluteViewMode():Boolean

Returns
Boolean — whether the view mode is absolute or not.
RviIsModelReady()method 
IRvFreeSpin3D function RviIsModelReady():Boolean

Returns
Boolean — whether the model is ready or not.
RviLoadModel()method 
IRvFreeSpin3D function RviLoadModel(ModelName:String = "", ModelPath:String = "", CallbackFunction:Function = null):void

Loading a model.

Parameters
ModelName:String (default = "") — A model's name.
 
ModelPath:String (default = "") — A models's file's path.
 
CallbackFunction:Function (default = null) — A function to be called when loading completes.
RviLoadTexture()method 
IRvFreeSpin3D function RviLoadTexture(TexturePath:String, ObjectIndex:Number, Width:Number = 0, Height:Number = 0):void

Loads a bitmap texture at the given path as the model's texture.

Parameters
TexturePath:String — A bitmap's file.
 
ObjectIndex:Number — An index of a model's object to relate to.
 
Width:Number (default = 0)
 
Height:Number (default = 0)

See also

RviRemoveBehavior()method 
IRvFreeSpin3D function RviRemoveBehavior(Behavior:IRvFreeSpin3DBehavior):Boolean

Removes a behavior class which was added by RviAddBehavior()

Parameters
Behavior:IRvFreeSpin3DBehavior — The behavior to be removed.

Returns
Boolean — whether the behavior was found and removed or not.

See also

RviRender()method 
IRvFreeSpin3D function RviRender():void

Renders and draws the model.


Example
The following code sets the rotation of the model and then renders it.
   my3DModel.RviSetRotation(10,10);
   my3DModel.RviRender();
   

RviReplaceTextureBitmapData()method 
IRvFreeSpin3D function RviReplaceTextureBitmapData(BmpData:BitmapData, ObjectIndex:Number):void

Sets a BitmapData as the model's texture.

Parameters
BmpData:BitmapData — The data of the bitmap.
 
ObjectIndex:Number — An index of a model's object to relate to.

See also

RviReset()method 
IRvFreeSpin3D function RviReset():void

Resets the model rotation to the original values.

RviRotate()method 
IRvFreeSpin3D function RviRotate(DeltaX:Number, DeltaY:Number):Boolean

Starts auto rotating the model by a given offset.

Parameters
DeltaX:Number — The delta by degrees, on X axis.
 
DeltaY:Number — The delta by degrees, on Y axis.

Returns
Boolean

See also

RviRotateModelX()method 
IRvFreeSpin3D function RviRotateModelX(Delta:Number):Boolean

Rotates the model along the X axis of the model.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviRotateModelY()method 
IRvFreeSpin3D function RviRotateModelY(Delta:Number):Boolean

Rotates the model along the Y axis of the model.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviRotateModelZ()method 
IRvFreeSpin3D function RviRotateModelZ(Delta:Number):Boolean

Rotates the model along the Z axis of the model.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviRotateStageX()method 
IRvFreeSpin3D function RviRotateStageX(Delta:Number):Boolean

Rotates the model along the X axis of the stage.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviRotateStageY()method 
IRvFreeSpin3D function RviRotateStageY(Delta:Number):Boolean

Rotates the model along the stage Y axis.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviRotateStageZ()method 
IRvFreeSpin3D function RviRotateStageZ(Delta:Number):Boolean

Rotates the model along the stage Z axis.

Parameters
Delta:Number — Number of degrees to rotate by.

Returns
Boolean

See also

RviScaleModel()method 
IRvFreeSpin3D function RviScaleModel(Scale:Number):void

Scales the model by multiplying its size with the given number.

Parameters
Scale:Number — A number to multiply the model by.

See also

RviSetAnimationFrames()method 
IRvFreeSpin3D function RviSetAnimationFrames(From:uint = 0, To:uint = 0):void

Sets frames to create a cycle of animation.

Parameters
From:uint (default = 0) — The first animation's frame cycle.
 
To:uint (default = 0) — The last animation's frame cycle.

See also

RviSetColor()method 
IRvFreeSpin3D function RviSetColor(Color:Number, ObjectIndex:Number):void

Sets the model's texture to the given color.

Parameters
Color:Number — The requested color.
 
ObjectIndex:Number — An index of a model's object to relate to.

See also

RviSetLightProperties()method 
IRvFreeSpin3D function RviSetLightProperties(RelativeLight:Boolean, BackfaceLighting:Boolean, Ambient:Number, BackfaceDimFactor:Number):void

Sets light properties to the model. This function is effective only in color mode.

Parameters
RelativeLight:Boolean — The relative light.
 
BackfaceLighting:Boolean — The backface lighting.
 
Ambient:Number — The ambient.
 
BackfaceDimFactor:Number — The backface dim factor.
RviSetModelRotation()method 
IRvFreeSpin3D function RviSetModelRotation(AngleX:Number, AngleY:Number, AngleZ:Number):Boolean

Sets the rotation of the model to specific angles on all 3 axes.

Parameters
AngleX:Number — The angle on X axis.
 
AngleY:Number — The angle on Y axis.
 
AngleZ:Number — The angle on Z axis.

Returns
Boolean — true, if the rotation was successful. Otherwise - false.

See also

RviSetOrientationFrom()method 
IRvFreeSpin3D function RviSetOrientationFrom(FreeSpin3D:IRvFreeSpin3D):Boolean

Sets the model's orientation by another model.

Parameters
FreeSpin3D:IRvFreeSpin3D — A model whose orientation is copied.

Returns
Boolean
RviSetProgressMovieClip()method 
IRvFreeSpin3D function RviSetProgressMovieClip(ProgressMovieClip:MovieClip):void

Attaches a preloader MovieClip to the model while the model is being loaded.

The MovieClip must have some kind of animation on the MovieClip's main timeline, so the progress bar can start at the beginning of the animation and finish at its end.

Parameters
ProgressMovieClip:MovieClip — The preloader MovieClip.

See also


Example
The following code sets a MovieClip with an instance name of 'progressMc' as the progress bar of the model.
   mMyFs3d.RviSetProgressMovieClip(progressMc);
   

RviSetRenderingLoop()method 
IRvFreeSpin3D function RviSetRenderingLoop(Loop:Boolean):void

Looping the model. If rendering loop is off, there's no key/mouse interactivity, no auto-rotation and if the model is animated - the animation stops.

Parameters
Loop:Boolean — Determines if the loop starts or stops.

See also

RviSetRenderMode()method 
IRvFreeSpin3D function RviSetRenderMode(RenderMode:String):void

Sets the render's mode.

Parameters
RenderMode:String — The render's mode ("Smooth"\"Wireframe"\"Flat")
RviSetRotation()method 
IRvFreeSpin3D function RviSetRotation(FrameX:Number, FrameY:Number):Boolean

Sets the model's rotation state to the position defined by the arguments.

Parameters
FrameX:Number — The frame number on X axis.
 
FrameY:Number — The frame number on Y axis.

Returns
Boolean

See also

RviSetRotationByDegrees()method 
IRvFreeSpin3D function RviSetRotationByDegrees(AngleX:Number, AngleY:Number):Boolean

Sets the model's rotation state to the position defined by the arguments.

Parameters
AngleX:Number — The angle of rotation on X axis.
 
AngleY:Number — The angle of rotation on Y axis.

Returns
Boolean

See also

RviSetStageRotation()method 
IRvFreeSpin3D function RviSetStageRotation(AngleX:Number, AngleY:Number, AngleZ:Number):Boolean

Sets the rotation of the stage to specific angles on all 3 axes.

Parameters
AngleX:Number — The angle on X axis.
 
AngleY:Number — The angle on Y axis.
 
AngleZ:Number — The angle on Z axis.

Returns
Boolean

See also

RviSetTexture()method 
IRvFreeSpin3D function RviSetTexture(BitmapName:String, ObjectIndex:Number):void

Sets a name of a bitmap class as the model's texture.

Parameters
BitmapName:String — The name of a bitmap class.
 
ObjectIndex:Number — An index of a model's object to relate to.

See also

RviSetTextureFlag()method 
IRvFreeSpin3D function RviSetTextureFlag(TextureFlag:Boolean, ObjectIndex:Number):void

Switching between color mode and texture mode. When in color mode - the texture data is saved.

Parameters
TextureFlag:Boolean — Whether it is in texture mode or not.
 
ObjectIndex:Number — An index of a model's object to relate to.

See also

RviSetTextureFromDisplayObject()method 
IRvFreeSpin3D function RviSetTextureFromDisplayObject(Display:DisplayObject, ObjectIndex:Number, Width:uint = 0, Height:uint = 0):void

Sets an object from the stage and tiles it as the model's texture.

Parameters
Display:DisplayObject — An object to be used as a texture.
 
ObjectIndex:Number — An index of a model's object to relate to.
 
Width:uint (default = 0) — The width to tile the object to in the texture.
 
Height:uint (default = 0) — The height to tile the object to in the texture.

See also

RviSetTextureName()method 
IRvFreeSpin3D function RviSetTextureName(TextureName:String):void

Changes the base name of the texture. This function is effective before running RviInit().

Parameters
TextureName:String

See also

RviSetWireframeLinesStyle()method 
IRvFreeSpin3D function RviSetWireframeLinesStyle(Thickness:Number = 1, Color:Number = 0x0000FF, Alpha:Number = 1, PixelHinting:Boolean = false, ScaleMode:String = "none"):void

Sets the line's style of the model's wireframe.

Parameters
Thickness:Number (default = 1) — The line's thickness.
 
Color:Number (default = 0x0000FF) — The line's color.
 
Alpha:Number (default = 1) — The line's alpha.
 
PixelHinting:Boolean (default = false)
 
ScaleMode:String (default = "none")
RviUseExternalTexture()method 
IRvFreeSpin3D function RviUseExternalTexture(TexturePath:String, TextureType:String = "swf"):void

Loads a texture from an external source, not from the library, This function is effective before running RviInit().

Parameters
TexturePath:String — The path of the requested texture.
 
TextureType:String (default = "swf") — The texture filename extension.

See also