|
[kml_flashembed movie="http://www.acmewebworks.com/Images/blog/FlashLibDemo/FlashLibDemo.swf" width="600" height="300"/]
|
|
Grant Skinner just posted his FlashLib extension for the Flash 9 alpha IDE / Flash CS3 with a great explanation of how it prepares your library for use in Flex2. He calls em’ "Shake n’ Bake SWF’s", I call em’ buiscuits of joy! Ok enough with the Southern references Why do I think this is SO friggin’ cool?? Because it allows me to VERY easily work with my MovieClip textures for my Papervision3D models – THAT’S WHY. The Xwing above, which we’ve seen on several occasions, now uses a MovieClip ( MovieMaterial ) for the skin rather than an externally loaded JPG or embedded bitmap within the compiled Flex2 app. For this demo, you’ll see that I’ve added some really simple animations. Engine Glows on the back and an orange dash that flows along the body in the front. The orange dash also has a Glow filter applied Now the workflow is rediculously cool. Modify the texture as a MovieClip in the Flash IDE like any other day, use the new FlashLib Create command in the commands list and bam – I have a FlashLib.swf and a FlashLib.as class to compile with my Flex2 app. Usage in Flex2 is straight forward:
[as] import mx.containers.Canvas; import org.papervision3d.core.utils.Collada; public class ColladaSceneLoader extends EventDispatcher public var container:Canvas; private var collada:PaperworldCollada; public function ColladaSceneLoader(target:IEventDispatcher=null) public function getObject():DisplayObject3D public function init(p_file:String, p_scene:Scene3D):void private function loadCollada():void private function handleBitmapLoaded(e:FileLoadEvent):void private function handleImageInit(e:Event):void loadCollada(); private function handleTimerUpdate(e:TimerEvent):void private function handleColladaLoadComplete(e:ObjectReadyEvent):void In the init for the class, I call [as]FlashLib.eventDispatcher.addEventListener(Event.INIT, handleImageInit); [/as] When the INIT event fires handleImageInit creates the instance using FlashLib and then goes on normally to create the MovieMaterial object that can be added to the materials list for the COLLADA scene: [as]private function handleImageInit(e:Event):void loadCollada(); And, as usual, this was JUST in time for something I’m cooking up for FITC – Grant’s timing couldn’t have been more perfect as this little gem brought it all together Check it out over on Grant’s blog: RockOn Rating: |




March 27, 2007 at 8:14 am
[...] i wyciągnięcie definicji klasy. Miło by było gdyby się samo robiło, z pomocą więc przychodzi FlashLib Granta Skinner’a – mała rozszerzenie umożliwiające szybkie i bezbolesne wykonanie w/w zagadnienia. Po instalacji dostajemy dwie nowe komnendy w menu i mozliwość generowania z automatu FlashLib.as – klasy, która zajmie się wszystkimi potrzebnymi rzeczami. Wystarczy podpiąć się pod event’a – szczegóły na stronie Skinnera. Warto też rzucić okiem na DisplayObjectWrapper’a – adapter pozwalający wyświetlić każdego rodzaju DisplayObject jako UIComponent, a więc bezbolesne dodanie go do layoutu flex’owego. Przykład zastosowania FlashLib możecie zobaczyć tutaj. Miłej zabawy ;]. [...]
April 14, 2007 at 10:00 am
[...] Papervision also bring in Collada models, which is an area I’ve looked at before for 3D environments. Being an active open source 3D modelling format, it has great appeal. 3dsMax was also mentioned so I shall probably move in the PaperVision direction for my next tests. What also pushed me towards this toolkit was the demo of the moving textures on the xWing fighter at rockOnFlash and their preview renders from their next release of the renderer. [...]
May 1, 2007 at 5:58 pm
Johnny Royale!!!!!!!!!!!!!!!!!!
May 1, 2007 at 9:49 pm
COREY!!!!!! Where you been man!?