Can somebody give me a source how would I get Away3d work in Flex? I
didn't manage to get it work myself.
Thanks
To build this *.swc u need to start a new "Flex library project".
For more infos on *.swc just take a look at your Flex manual.
I need to know how can I add Away3d View3d to flex application.
I tried like this but it doesn't work:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import away3d.objects.*;
import away3d.core.material.*;
import away3d.core.proto.*;
[SWF(backgroundColor="#222266", frameRate="60", width="600",
height="400")]
public var view:View3D;
public var sphere:Sphere;
public function HelloAway3D()
{
view = new View3D();
view.x = 300;
view.y = 200;
this.addChild(view);
sphere = new Sphere(new WireColorMaterial(0xFF7700,
0xCC4400), {radius:250, segmentsW:12, segmentsH:9, y:50});
view.scene.addChild(sphere);
view.camera.lookAt(sphere);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void
{
view.render();
sphere.rotationY = getTimer() / 100;
}
]]>
</mx:Script>
</mx:Application>
I uploaded Ralph's example source files to the list. I created Away3D
version of it but my code is ugly at the moment. Luckily, It works as
expected. Let me know if you have any problems.