Blog

  • The Making of Flash 8 – JXL Cameo

    Even as I am now a full-time Flex contractor, I still utilize Flash 8 in more than half of my daily duties. I really am impressed with the quality of this release. As I continually scan the lists, I’m seeing a steady stream of feature discussions, both old and new, which indicate no overt problems with utilizing the product by users, instead focusing on creating & using.

    Watching the video, it was weird; it felt like watching those NASA documentaries where they talk about how they sent their rover to Mars, except in this case, you’re like, “Dude, I know that guy! Hey, I met and talked to her!”. Very cool to see a behind the scenes look at the hard work the Flash Team puts in. It shows; millions around the world use and love Flash, me included. Also, it really gives you a greater appreciation for the product as well as a level of respect to those who can pull it off.

    “The Making of Flash 8” Documentary Film
    http://www.macromedia.com/devnet/flash/video/team/

    BTW, check out my ghetto-looking self!

  • Wireframe Components Using Flash 8’s Scale9

    Scale9 doesn’t suck. When I originally saw it, I wasn’t impressed, but apparently was too quick of a judge.

    I’ve been doing more and more wireframing this past year for projects. One could also call them storyboards since a lot of work in Flash & Flex has a lot of potential crossovers. As the projects get bigger in scope, and I get bequeathed more responsibility (or take the ball when no one else does), the opportunity arises to lessen the need for MVC; planning out your application before actually building it.

    From talking to Enterprise developers, in both application development and web development, I’ve found both utilize a lot of planning. I’ve historically hated planning. You show me a design of an application you’d like to build, and I can see it within seconds in my head how it works, and start laying the groundwork as well as the framework to ensure a good scope creep defense. As things get bigger, however, it becomes harder to wrap my head around the whole enchilada unless I write it down to challenge my, and the client’s, assumptions. Not to mention the fact I’ve lost all patience with re-work because of a misunderstanding of functionality up front.

    …however, I don’t own Visio or Illustrator. I do own Flash with a pimp stylus, and with Flash 8’s improved text handling capabilities as well as runtime rendering, she’s a viable choice. The 2 problems, however, are the temptation to utilize real GUI components which defeat the purpose of no design & technology commitment that you get with wireframing. The second is, if you are using Flex components, those aren’t in Flash, and screen capturing implemented prototype designs, while quick to make in Flex, aren’t flexible enough once you’ve turned them to bitmaps. A change in layout causes you to do the whole process again.

    So, until I start doing enough wireframing to justify purchasing Visio (Open Office? No thanks, tried it, no like it), I’ve built these Wireframing Components for Flash 8 that allow you to layout your GUI without implying a design style, or even a technology for that matter (excluding Flex’ Panel component). Most utilize Scale9, so they scale well both at authortime, and when you publish a SWF (or image or image sequence). Additionally, a few have text capabilities, so your buttons can show labels and your text boxes can have h@wt, latin text. I’ve even included Flex’ popular Panel with toggeable close button and control bar.

    If you are good at Flash, and have the opportunity (curse?) of having to do some wireframes of an application, these components should help you out. They are plain in look, efficient in resource usage, and look the same at authortime as they do at runtime. They are not interactive at runtime to ensure no implication about functionality is made.

    2 things to watch out for:

    • if you utilize the “,” and “.” (comma and period) keys to go forwards and backwards in a SWF file, the components will break; don’t know why. Instead, implement button and/or keyboard interaction if you plan on showing a SWF to someone.
    • if you choose to look at the source and compile yourself, keep in mind I had to edit the mm_livepreview.as that comes in your Flash’s Include folder. Make sure this file is next to the .FLA

    Wireframe/Storyboard Components – MXP | Source Files ZIP

    Example Usage

    Authortime

    Runtime

  • Shared Whiteboard using Flash 8, Flex, & Flashcom: Map Revealer

    After reading this article about using Flash 8 in Flex 1.5, and failing to prove it wrong, I still figured I could blend the best of both worlds.

    Background

    I’ve always wanted a Map Revealer, like Fantasy Grounds has; here’s a screenshot. The goal it accomplishes is it allows players in the game to see where they have explored, but not the whole map until they’ve explored it. That way, they have a visual aide to track their progress, and it gives a sense of accomplishment to those explorers in the party. If you walk down the hallway (and don’t fall in a trap), then that hallway is revealed on the map.

    Taking ideas from my JXLScratch Off component, I tried to do this pre-Flash 8 by having about 2000 (20×20 10 pixel tiles) loaded on top of a large bitmap. You could, as the presenter (DM) toggle their visibility since they were just clickable MovieClips. Even at that low-level on my Alienware, though, she chugged. The redraw froze the app for 3 seconds. I’m sure I could of done 1 redraw and just synchronized it amongst clients, but… bleh, don’t think so.

    Now that we have the pixel pushing power of Director, with the addition of half-pixel support, I figured I could implement what I truly wanted; an anti-aliased fog of war that could be used to reveal a map to a list of clients connected, with the Presenter/DM controlling the revealing.

    The original Baldur’s Gate had a GIF transparency approach; pixel on, pixel off. It was actually more close to the Fireworks 1bit transparency you can do with single color images by making every other pixel transparent, alternating rows. You can see an example here.

    The sequeal improved it by making what you didn’t see solid black, revealing it with a nice, soft gradient transparency edge seen here, and re-covering visited areas with a transparent gray.

    Finally, I can do that in Flash!

    Whiteboards Rendering Engines, BitmapData, and Flashcom

    …then I hit a snag. You can’t send a BitmapData instance over the rtmp wire… although, you CAN send an image pixel by pixel! To me, though, that doesn’t count, heck with that.

    Most Whiteboards done in Flash consist of a rendering engine. They take shapes, and render them to the screen. Each shape is unique, and has attributes that are set when it is created and manipulated by the user. When those attributes are changed, they are sent over the wire so each rendering engine on the client can show the same whiteboard state. That way, you have small pieces of data, and when a new piece comes in, your code goes “oh, this is an ‘arrow’, it’s red, is so large, and sits at these screen coordinates.” This process repeats for when an object is manipulated, those changes are sent over the wire. If it’s deleted, those changes are sent as well.

    The pros? The data sent over the wire is extremely small since the rendering engine is capable of drawing a lot of objects (arrows, text boxes, drawings, etc.). The cons? Too many frikin’ objects… Flash Player has a lot of overhead (currently, hehe) when creating objects; that’s why when you create a lot of MovieClip’s, things start to slow down. RAM & CPU get ravished.

    What’s a bitmap? 1 object. Yeah, it’s a series of pixels, but showing 1 bitmap in Flash is cake, utilizes low resources, and if you change it, it’s still 1 bitmap!

    My Implementation

    Since you can’t shove it over the wire, though, I had to utilize the best of both worlds. I created a rendering engine based off of Senocular’s code, specifically the Erase & Draw’s example that will draw the changes to the bitmap based on a stored array of mouse movements. This has been done before by GE, but they utilized a vector line. While that certainly does NOT limit ones creativity, the presentation and ability to manipulate bitmaps has been more mature for awhile, and the implementation of such effects in Flash does what bitmaps do best; render well with low resource usage. While erasing the mask, or covering it back up again, I record the mouse movements. You can then run through this recorded array of x and y coordinates to redraw the bitmap exactly as the user did. The sending of the data over Flashcom wasn’t as latent as I thought; there is a noticeable delay, but considering I’m sending almost a thousand numbers in 4 arrays across, it’s not bad.

    Pros & Cons

    And now, time to tear it to pieces. First off, I do not record the order in which you erase and then re-draw, so if you swap the order, it doesn’t matter; the engine does 2 passes; 1 to do the erasers, and then 1 do to the redrawing of the mask you just erased. Secondly, I could of put a bunch of info objects into 1 array to make the code simpler, OR I could of put each object on a unique slot on the SO to allow the data changes to stream; however, to me, you typically draw the image, and when ready sync it so the rest of your viewers can see. I felt that was a reasonable tradeoff since you only throw that big message every once in awhile. Third, while the erasing of the image mask is a nice anti-aliased (smooth gradient) brush, the redrawing of the mask is not. Couldn’t figure out how to get it to work. Fourth, while “seeing the drawing draw itself” is a novelty, that wasn’t the goal; the goal was to update state and syncronize it across many clients. If you screw up and erase a part, it records that… so it’s not a perfect drawing engine. Finally, it’s a white mask if you are not the presenter; I wanted black, but putting the black color in there doesn’t work since it’s an alpha… or something.

    Whiteboard(s) In Our Future

    Anyway, after seeing what I could in a few hours after 2 nights, I can DEFINATELY infer what Breeze 6 will have; the most powerful and ubiquitious multi-user whiteboard on the internet. If Macromedia’s smart they’ll withold the key feature for Breeze, like they did with Screensharing for Flashcom, to allow BitmapData objects to be shared over Flashcom. The whiteboards out there currently for Flash/Flashcom are pretty good, but you ain’t seen nothing yet. Either way, if someone spent a few weeks on one… sick!

    Map Revealer Demo + Source

    Here’s my Map Revealer in action; 2 clients, 1 a presenter, and the other an attendee, share the Whiteboard over the wire. Source FLA + AS in ZIP.

    Map Revealer – See It | Source ZIP

  • Community Voices, UI vs. Meat Goats, Breakin’ Goths, and Al Qaeda Raver

    My favorite posts from this week.

    Tariq Ahmed from Flexcoders linked to the this MXDJ Article about The Voices of the Community, where they asked a bunch of homeskillets industry related questions. Answers are interesting; more interesting when compared. I’m on page 1; pimp!

    If you are going to raise livestock, I’d prefer Alpacas so you can saturate the knitting market with Alpaca fur, and thus lower the price of it’s fur. I have Alpaca thread coming out of the woodwork in this house because of my wife’s yarn obsession. I balled out laughing reading this post by Dynamic Flash, not just because of the text-book example of bad UI design, but the suggested career change for someone unsuccessful in the web design world just seemed… well, a 180 with a z-index. Anyway, I’ve never heard of meat goats, and I’m glad I did; now I have a random, weird statement to issue forth in times of frustration! Moo goo gai pan was getting old anyway.

    Viewing the 1st video from Playfool’s post, I learned Goth’s could dance; I had no idea! Every 90’s movie I saw growing up had them head banging, and the paid goth dancers that dance on the platforms at clubs aren’t real goths. Anyway, some really really phat moves. Apparently, even Voltron can break it down; can you imagine the event model it took to code that shiz? Awesome…

    Finally, making al Qaeda happy and then having them rave… dude (er, so, sorry JD) off the chain, yo!