Archive for July, 2008
PaperCube without Flex and only pure AS3
Because of that comment were i was asked if the papercube will be run without Flex but also with XML-files, so i looked what is the difference between Flex Datahandling and pure AS3-Datahandling with XML. There is no big difference. Of course the Main-Classes (Document-Classes) can’t extend the UIComponent-Class and must extend the MovieClip-Class to be visible on Stage. The main difference is to handle the XML-Data. The refactored class looks like this.
package net.borishorn.pv3d.data
{
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import net.borishorn.pv3d.events.PaperEvent;
public class PaperData extends Sprite
{
public var sides:XMLList;
public function PaperData()
{
getData();
}
private function getData():void
{
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, resultHandler);
loader.load(new URLRequest("xml/papercube.xml"));
}
private function resultHandler(event:Event):void
{
try
{
sides = new XMLList(event.target.data);
sides = sides.children();
dispatchEvent( new Event(PaperEvent.XML_DATA_LOADED, true, false));
}catch (e:TypeError)
{
trace("There was something wrong");
trace(e.message);
}
}
}
}
The whole package will be found here
No commentsFive3D is now managing Bitmaps
Yes, it’s true my favourite 3D-Engine Five3D is now competing with bitmaps and videos. All you need to do this is grabbing the new 2.1 Package of Five3D and if you plan to build some crazy apps with Flex you have to include the Flash CS3-Classes into your Flex Build Path, because Five3D 2.1 needs to import fl.motion.Color ( don’t ask me why, ask Mathieu)

When you succeded with that step everything is ready for takeoff and you can start. My first try to bring some bitmaps into the vector-world of Five3D is this piece. The inspiration came across by a photo by my buddy Sören Rogoll who take a picture from my closer backyard.
When you click the button and the ships appear, you see bitmaps in Five3D.
var ship:Bitmap3D = new Bitmap3D(new Images.mary().bitmapData); scene3D.addChild(ship);
This line adds a Bitmap3D into the DisplayList. Now you access to rotationY, rotationX, rotationZ and the z-Index. Combine it with the smooth 3D Vectors. There is a big potencial in Five3D.
3 comments

