Blog

a great conversation starts with a great topic

Recent Blog Entries

  • 1-4 of 4
  • Memory Management in Flex3
    Entry posted Feb 17 by bengfarrell

    I just got back from the TUE and RDAUG monthly meetup.  Adrian gave a good, short, thought provoking presentation on what UX is not, but we both agreed that the real highlight was Brad Murphy's presentation on how Flex and Flash handle memory management.

    Brad Murphy is a Flex/Flash engineer over at rPath.  Frankly, I was a little shocked to see the amount of detail and time they care to dig into the Flex framework.  I can only assume they must be building one heck of a solid product there given the way all 4 rPathers came across tonight.

    In some ways it was a little disturbing - given how bad the underlying Flex 3 framework handles basic memory management.  I can definitely see why Brad had to become the expert he did.  Personally I've only worked on smaller projects myself, and I'm surprised to see that when things scale up, Adobe recommended practices seem to be the ones that bite you the most.

    At the very bottom of things is addEventListener.  This very basic Flash method, used on any object to listen to any event and call a custom function, is the start of the trouble.  Most AS3 and Flex developers realize that it is typically bad practice to NOT use weak references.  Unfortunately, weak references are off by default, and the simple Adobe examples don't bother to turn weak references on by setting the very last parameter in addEventListener to true.

    I knew this, but what I didn't know was that the entire Flex 3 binding system is based on a system where Adobe never bothered to use weak references.

    Brad pointed out more stuff in Flex that works against your projects like states, modules, repeaters, and more.  All stuff that Adobe lines their examples with but turn out to be quite bad if using them nonchalantly without regard to memory management in larger applications.

    The silver lining, of course, is that I heard some pretty great things about Flex 4 tonight - even that the binding issues have been taken care of.

    Anyway, thanks Brad and the rPath team.  I'm enclosing Brad's presentation in PDF form.  We look forward to reading Brad's upcoming blog posts on memory management, and invite him to post here if he likes.

  • Welcome Peak City Film Festival goers!15.0
    Entry posted 09/28/09 by bengfarrell

    If you are reading this and you are an RDAUG member, keep reading to find out about a new opportunity we have to network with film and video makers in the area!  If you are not an RDAUG member, nice to meet you! We are the Raleigh Durham Adobe User Group.  We are an official Adobe User Group, and get some very nice Adobe benefits like t-shirts, stickers, software prizes, training, etc.

    We started out as a Macromedia user group about 10 years ago, but when Adobe bought Macromedia, we suddenly had a lot more to discuss. 

    Our group has a lot of awesome folks who are experts on creating rich internet applications with Flash, Flex, and general web development skills.

    The type of subjects that don't often come up here are film, video, postproduction, sound design, motion design, etc.  That's where you folks come in. I'd like to welcome professional or amateur Adobe users who specialize in creating moving pictures.  Please sign up, feel free to use our forums, get your events or job listings posted, or just take advantage of whatever support we can give you.

    Lastly, come on out to a meeting!  We usually have one a month.  I will warn you, the topics can get technical.   This is why the Peak City Film Festival is helping round up a couple film/video type presentations for us in the near future.  I also encourage anyone with a cool topic or project to contact me to present at one of our meetings.  The techie folks will love it, and they'll be in awe of the cool things you can produce with Premiere or After Effects.

    We're also having a December Show and Tell where people can stand up for 5-15 minutes and show off their work.  We'll be giving away an Adobe software prize to those who present.

    If you DON'T know what the Peak City Film Festival is, it's a family-oriented film festival happening in Apex from Novermber 20-22.

    http://www.peakcityfilmfestival.org/

    We hope to see you at RDAUG soon!

  • Physics for Flash AS3
    Entry posted 11/28/08 by bengfarrell

    I’ve been playing a bunch with physics engines for the last few weeks.  Physics engines basically serve to give your Flash Sprites some mass and body.  Your physics world can update your graphics so they can bounce off each other, bounce off walls, fall to the forces of gravity, and succumb to other forces all in a semi-realistic manner.

    My exploration first took me from Papervision3D to WOWEngine.  Papervision3D is, of course, the popular realtime 3D engine for Flash.  It doesn’t have anything to do with phyics - but WOWEngine seems to be the hot dicussion for bringing physics into your 3D world.

    WOW works like this….

    Imagine a 3D world that you never see.  Yep, thats it.  That’s what the WOW does.  It’s the 3D world that never gets visualized in any way shape or form.  Of course, the 3D world in question has complete information about all objects in the world and how they interact with their surroundings and forces surrounding them.

    It’s actually a nice little setup - you get to keep your Papervision3D or regular 2D world separate from your physics world.  So you have 2 different worlds - each operating independently of each other.  The way you tie them together is with a single handler ENTER_FRAME handler where you cycle through all the physics bodies and update your display with the proper x, y, z, or rotational properties.  The 2 worlds make it easy because you could use any 3D engine, 2D engine, or whatever engine you want and glue them together - there’s no dependencies, no skinning, no nothing - so it’s pretty handy, and a quick concept to grasp.  2 worlds - gotcha!

    The problem is that the WOWEngine isn’t that great of a physics engine (yet!).  Another unfortunate problem is that its the only Actionscript Physics engine that handles 3D.  So if you use 3D, you’re kind of stuck using this or writing your own.

    WOWEngine is based off of another engine called APE (Actionscript Physics Engine).  APE is a 2D physics engine that seems to actually be pretty good.  The problem with WOW, is that it has such potential, and works pretty well, but hasn’t implemented the richer features of APE yet.  The author definitely plans to, it’s on the roadmap, but I’m impatient need it now!

    The killer feature that makes a great physics engine in my opinion is Rigid Body Dynamics - which APE has and WOW lacks.  To explain rigid body dynamics a little bit, let me tell you a little bit about my initial experimentation.

    My big “hello world” application was basically making a few balls drop from the sky and hit the ground.  I initially tested in 2D, and just ignored the Z axis.  So we’re talking normal Flash Sprites here.  So the balls hit the ground, bounced off of each other, all pretty cool - and what you’d expect from a physics engine.

    Next I tried the same thing with squares.  Still cool, but not quite right.  That’s because I still had to treat each square as a generic ball particle.  With no Rigid Body Dynamics - I couldn’t build a little fortress with my cubes!  That’s because without being able to define a polygon or even a cube, whatever graphics you have…..just sort of act like balls and slide off each other.

    So that’s the my big problem.  Someday WOW will be awesome, but not yet for my purposes.

    Next I checked out Foam.  Foam is a 2D Physics engine for Actionscript 3.  Foam is actually pretty sweet!  I didn’t spend long on it, though.  The reason is that after I experimented with WOW, I didn’t really like how Foam worked.  It seemed to handle Physics well - but it seemed to integrate the graphics and physics world too much for me.  I think I preferred them seperate - especially in a situation where maybe I want to use a different graphics engine.  I didn’t get far into Foam, but it seemed more like that Foam would take over your stage and you’d skin the physical bodies.  Before I went into this physics thing, it’s how I expected things to work - but I just couldn’t dig in after playing with WOW.

    So again I moved on…

    Finally I hit Box2DAS3.  This is the one I settled on - it has it’s problems, but if you can overcome it, then I do think it’s the best.  Box2DAS3  is a Actionscript 3 port of Box 2D.  Box 2D is an opensource physics package for C++.  In fact, Box2D has evolved to become Bullet - a 3D version of the physics engine.  Hopefully we’ll see Bullet 3D someday soon.

    Box2DAS3 supports all the great features a good physics engine should….well OK OK, I’m not an expert - it supports all the great features I *think* a good physics engine should.  It also follows my beloved 2 worlds philosophy that I liked from WOW/APE.  For me it’s perfect….

    ….well almost perfect.  I think it has one flaw.  The flaw is that it’s a C++ port, and not really specific to Flash.  If I went back in time and warned myself of this, I would’ve been pretty dismissive and said “So what?  Code is code!”.

    Well first of all it seems like classes have the bare minimum of comments - so you just kind of get the picture what everything does.  And it’s really not clear what each class or package does - unless you know….um…how to write a physics engine.  So it’s a little bit of a catch-22.  Like a simple body is name b2Body.  To create a body you need to create a shape definition (b2ShapeDef), convert that to a shape, and then convert the shape to a body, and then add the body to the world.  And it seems there’s only one way to add a body to a world, and that’s through a reference to the world, even though when you create a body from scratch, there’s a world parameter - but it doesn’t seem to work.  Well, I’m rambling.  Needless to say it’s confusing for a newbie - and on top of that there are things like manifolds and AABB - all things I don’t understand but there to get in the way and hamper learning.

    But, if you study the examples they give you - you start to get a feel for how things work.  And once I did that - I stumbled a little, especially on design patterns - but got things working pretty well.  My design pattern quandry was that the framework was very incompatible with an inheritance based design - it was really going against the grain when I tried to use inheritance in my design.  What you really need to realize, is that a Factory type of design pattern works much better.

    I ended up creating a base class like you would in Papervision3D.  The base class extends the stage and creates a common physics world setup as part of that stage.  Your main class would inherit this “physical stage” and contain the main stuff you want to program (hopefully keeping references to b2bodies and b2worlds to minumum, just cause it’s hard to understand!).

    On the side - I have a physical object factory static class.  Here’s I’d call createPhysicalBall or something like that, and poof, it’d create me a ball….passing back seperate references for the graphics and the phyiscal body.

    So that’s how I roll with the physics.  It adds some great realism to the boring old games.

  • Adobe MAX Announcements
    Entry posted 11/24/08 by bengfarrell

    copied from molaro.wordpress.com - orginal post by Phil Molaro

    It seems like this is a big year at Adobe MAX. There are a lot of new and exciting packages, tools, and frameworks being announced. Here’s the quick list:

    Bolt, Adobe’s new Eclipse based development tool for ColdFusion developers
    http://labs.adobe.com/wiki/index.php/Bolt

    Durango, a framework that allows developers to build customizable Adobe AIR applications
    http://labs.adobe.com/technologies/durango/

    Flash Catalyst, formerly codenamed Thermo, is a new professional interaction design tool for rapidly creating application interfaces and interactive content without coding
    http://labs.adobe.com/technologies/flashcatalyst/

    Adobe Wave, an Adobe AIR application and Adobe hosted service that work together to enable desktop notifications (like Growl)
    http://labs.adobe.com/wiki/index.php/Adobe_Wave

    PatchPanel, a Flex library and set of services that make it possible for SWF files to work as Adobe Creative Suite CS3 and CS4 plug-ins
    http://labs.adobe.com/wiki/index.php/PatchPanel

    Configurator, a utility that enables the easy creation of panels (palettes) for use in Adobe Photoshop CS4
    http://labs.adobe.com/technologies/configurator/

    More on Centuar (CF 9)
    http://labs.adobe.com/wiki/index.php/Centaur

    Alchemy, that allows users to compile C and C++ code into ActionScript libraries (AVM2)
    http://labs.adobe.com/technologies/alchemy/

    Genesis is the code-name for a new product initiative at Adobe with the objective of joining business applications, documents and the web on every knowledge workers desktop with integrated collaboration capabilities
    http://labs.adobe.com/wiki/index.php/Genesis

    Codename “Cocomo” is a Platform as a Service that allows Flex developers to easily add real-time social capabilities into their RIA
    http://labs.adobe.com/technologies/cocomo/

    Stratus is a hosted rendezvous service that aids establishing communications between Flash Player endpoints. Unlike Flash Media Server, Stratus does not support media relay, shared objects, scripting, etc
    http://labs.adobe.com/wiki/index.php/Stratus

Search Blog

Top-Rated Entries

Recent Comments

  • 1-4 of 4

Copyright © 2009 Adobe Systems Incorporated. All rights reserved.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-08-2008).

Powered by HiveLive