Packageaway3d.exporters
Classpublic class AC3DExporter
InheritanceAC3DExporter Inheritance flash.events.EventDispatcher

Class AC3DExporter generates a string in the AC3D .ac format representing the object3D(s). Export version format 11. hex b

Public Properties
 PropertyDefined by
  acFile : String
[read-only] Returns the last generated ac file string async from events.
AC3DExporter
Public Methods
 MethodDefined by
  
AC3DExporter generates a string in the AC3D .ac format representing the object3D(s).
AC3DExporter
  
addOnExportComplete(listener:Function):void
Default method for adding a complete event listener The event.data holds the generated string (ac file string) from the AC3DExporter class
AC3DExporter
  
export(object3d:Object3D, scaling:Number = 1):void
Generates a string in the AC3D .ac format representing the object3D(s).
AC3DExporter
  
removeOnExportComplete(listener:Function):void
Default method for removing a complete event listener
AC3DExporter
Property detail
acFileproperty
acFile:String  [read-only]

Returns the last generated ac file string async from events.

Implementation
    public function get acFile():String
Constructor detail
AC3DExporter()constructor
public function AC3DExporter() Init Parameters
Method detail
addOnExportComplete()method
public function addOnExportComplete(listener:Function):void

Default method for adding a complete event listener The event.data holds the generated string (ac file string) from the AC3DExporter class

Parameters
listener:Function — The listener function
export()method 
public function export(object3d:Object3D, scaling:Number = 1):void

Generates a string in the AC3D .ac format representing the object3D(s). Export version format 11. hex b The event onComplete, returns in event.data the generated string.

Parameters
object3d:Object3D — Object3D. The Object3D to be exported to AC3D .ac format.
 
scaling:Number (default = 1) — [optional] Number. if the model output needs to be resized. Default = 1. IMPORTANT: A little missing feature into AC3D parser doesn't support regular line returns as shown in trace panel. And the Trace class or trace panel textfield doesn't respect the returns char values as they are defined during the string construction. Here's what you need to add to your code in order to trace a valid file for AC3D: This example shows how to export a cube to ac3d. private function export():void { ACExporter = new AC3DExporter(); ACExporter.addOnExportComplete(onExportDone); var cube:Cube = new Cube({width:10, height:10, depth:10}); _scene.addChild(cube); ACExporter.export(cube, 1); } private function onExportDone(e:ExporterEvent):void { //trace(e.data); // do not use the trace panel as you would do for ObjExporter. //Wrong returns char set. as a result AC3D fails to parse the file trace("please press once on screen"); stage.addEventListener(MouseEvent.CLICK, setToClipboard); } private function setToClipboard(e:MouseEvent):void { stage.removeEventListener(MouseEvent.CLICK,setToClipboard); System.setClipboard(ACExporter.acFile); trace("paste into a text editor and save as 'myfile.ac'"); }
removeOnExportComplete()method 
public function removeOnExportComplete(listener:Function):void

Default method for removing a complete event listener

Parameters
listener:Function — The listener function
Wiki link
Click to go to the wiki page for 'away3d.exporters.AC3DExporter'

Code examples

Comments