Advanced Flash Components
Search!
Search!
Home >  Components >  Virtual Space (AS 3.0) >  API Documentation
API Documentation
Virtual Space (AS 3.0) V. 1.0 Documentation
Properties
Name Type Description
animationStyle Object Determines whether the Virtual Space should automatically animate without any user interaction, and sets the properties of the animation.
  1. angleX:Number - the amount the Virtual Space should rotate on the x-axis for each iteration of the animation.
  2. angleY:Number - the amount the Virtual Space should rotate on the y-axis for each iteration of the animation.
  3. easing:Object - the easing class to be used (see fl.transitions.easing).
  4. enabled:Boolean - determines whether animation is turned on (true) or not (false).
  5. duration:Number - the amount of time (in milliseconds) for each iteration of the animation. For example, a setting of 3000 would animate the Virtual Space with the given settings every 3 seconds.
  6. loop:Boolean - determines whether the animation will continue after one full rotation around the Virtual Space (true) or not (false).
  7. type:Object - the easing type to be used (see fl.transitions.easing).
Example

myVS.animationStyle = {angleX:45, angleY:0, easing:easeOut, enabled:true, duration:3000, loop:true, type:Strong};
controlsStyle Object Determines how mouse interaction will work with the Virtual Space.
  1. acceleration:Number - the amount that Virtual Space movement should accelerate as the user presses the left mouse button longer. Only works for centered and pointed model types.
  2. continuous:Boolean - determines whether the Virtual Space will flip the angles and continue to animate when the maximum angle is reached (true) or not (false).
  3. invertRotationX:Boolean - determines whether rotation on the x-axis is inverted (true) or not (false).
  4. invertRotationY:Boolean - determines whether rotation on the y-axis is inverted (true) or not (false).
  5. maxAngleX:Number - sets the maximum allowed rotation on the x-axis.
  6. maxAngleY:Number - sets the maximum allowed rotation on the y-axis.
  7. modelType:String - controls the interaction behavior. Options include:
    1. centered - camera remains fixed in the center of the room.
    2. pointed - camera is pointed by mouse
    3. mapped - camera uses mapped angles on Virtual Space bounds
    4. drag - user can drag the Virtual Space
  8. speed:Number - animation speed.
  9. type:String - controls activation type (auto is always on, click means controls are turned on by clicking the component).
Example

myVS.controlsStyle = {acceleration:3, continuous:true, invertRotationX:false, invertRotationY:false, maxAngleX:180, maxAngleY:180, modelType:"centered", speed:1, type:"auto"};
cubeStyle Object Sets the content for Visual Space.
  1. back:* - the path to the image or class name to be used on the back pane.
  2. bottom:* - the path to the image or class name to be used on the bottom pane.
  3. front:* - the path to the image or class name to be used on the front pane.
  4. left:* - the path to the image or class name to be used on the left pane.
  5. right:* - the path to the image or class name to be used on the right pane.
  6. top:* - the path to the image or class name to be used on the top pane.
Example

myVS.cubeStyle = {back:"some_img.jpg", bottom:myClass, front:"some_img.jpg", left:myClass, right:"some_img.jpg", top:myClass};
displayStyle Object Sets the style of the image containers for each side.
  1. alignH:String - horizontal alignment.
  2. alignV:String - vertical alignment.
  3. backgroundAlpha:Number - alpha of the background container.
  4. backgroundColor:Uint - color of the background.
  5. drawBackground:Boolean - determines whether background should be drawn (true) or not (false).
  6. maintainAspectRatio:Boolean - determines whether loaded image should maintain aspect ratio (true) or not (false).
  7. overStroke:Boolean - determines whether a stroke should be shown (true) or not (false).
  8. paddingWidth:Number - the amount of horizontal padding.
  9. paddingHeight:Number - the amount of vertical padding.
  10. strokeAlpha:Number - alpha of the stroke.
  11. strokeColor:Uint - color of the stroke.
  12. strokeThickness:Number
  13. transformAsCube:Boolean - whether to preserve panorama transformations to cube. If set to false, view can be transformed in any rectangle. Panoramas object always shown as cube, but you can change it size by scaling options.
Example

myVS.displayStyle = {alignH:"center", alignV:"center", backgroundAlpha:0.5, backgroundColor:0x000000, drawBackground:true, maintainAspectRatio:false, overStroke:true, paddingWidth:5, paddingHeight:5, strokeAlpha:0.5, strokeColor:0x000000, strokeThickness:2, transformAsCube:true};
errorClip String Class to be displayed when there is an error loading a side.

Example


myVS.errorClip = "myClass";
panoramaStyle Object Set the initial view settings for the Visual Space.
  1. angleX:Number - the initial angle on the x-axis.
  2. angleY:Number - the initial angle on the y-axis.
  3. angleZ:Number - the initial angle on the z-axis.
  4. scaleX:Number - the scale on the x-axis.
  5. scaleY:Number - the scale on the y-axis.
  6. scaleZ:Number - the scale on the z-axis.
Example

myVS.panoramaStyle = {angleX:30, angleY:0, angleZ:-15, scaleX:0.75, scaleY:0, scaleZ:0};
previewClip String The class name to be used to indicate that image loading is in progress.

Example

myVS.previewClip = "myClass";
Methods
Name Return Type Description
setSize( width:Number,
height:Number
)
Void Set the width and height of the Virtual Space view window. Alternatively, you could just set the width and height properties.

Example

myVS.setSize(400, 300);
setDisplay( display:*,
frontFirst:Boolean
=
true
)
Void Gets an image and breaks it into four sides for the Visual Space. The display parameter can be a Class, Class Name, DisplayObject or BtmapData. The default setting for frontFirst is true which will result in a load order of front, right, back, left. A setting of false will result in a load order of left, front, right, back.

Example

myVS.setDisplay(myClass); // myClass contains some image
Events
Name Return Value Description
See errorClip and previewClip Error handling and image loading progress monitoring have been simplified for Virtual Space through the use of the errorClip and previewClip properties documented above.