Showing posts with label work. Show all posts
Showing posts with label work. Show all posts

Wednesday, October 27, 2010

Adobe wakes up

THIS should have been Adobe's first public response to Apple dropping Flash support. It's an HTML5 animation editor (in the prototype stage) called "Edge".

If they had announced this when Apple publicly declared they were going to drop Flash support, instead of posting petulant rants about how Apple is doomed as a result, Adobe would have looked forward-thinking, professional, capable, and supportive of their users with whatever technology they choose to deliver to. It would have saved them a lot of bad press, and it wouldn't have fostered an Apple vs. Adobe mindset (or a "dang it, I'm going to have to choose or double my work, aren't I?" mindset) among its customers.

This is the first thing to come along in years that has given me hope for Adobe's product strategy. With the standout exception of the excellent Photoshop, Adobe has been nothing but disappointing with its product decisions of late. But this is smart; it's going where the web developers are going instead of trying to drop anchor and keep us where we are for as long as possible.

Gotta give kudos to Adobe on this one; I'm already a customer of this product, if they can deliver it before a compelling alternative emerges.

Tuesday, October 12, 2010

The Rosetta Dongle

I just rage quit Lightwave before even getting it installed.

All I wanted to do was use Lightwave on my OSX laptop without installing Rosetta. Not such an outrageous request, given that OSX is a supported platform, right? I have a registered copy that ran fine before updating my system software, but now I don't want to install Rosetta - I want to run it under straight-up OSX. So I download the updater files, and I'm all paid up and everything, and I've even got my hardware dongle plugged in. (Seriously, what is this, 1996?) I run the installer. It installs the OSX version. Almost there!

Then I get this message: "Donglecheck requires Rosetta to run. Want to install it now?"

You know, if I wanted to install Rosetta, I wouldn't bother downloading the OS X update, now would I?

NewTek, if you're going to make my life difficult and use separate programs to enforce and/or unlock your clumsy, draconian DRM, at least keep them up to date. Don't make me install Rosetta for the sole purpose of unlocking your software (that I've already unlocked!) so that I don't have to run it under Rosetta.

That's worse than having no OSX version at all - at least then, I'd be installing Rosetta for some real purpose.

Sadly, this is not an isolated frustration - it is indicative of the software NewTek ships: haphazard, buggy, obtuse, nonsensical, poorly-thought-out software running on the fumes of long-passed greatness, all protected by paranoid, burdensome DRM disproportionate to the value of the software it protects.

I make purchasing decisions about 3D software for our multimedia studio. I'm going to be making a different choice for 2011.

Thursday, July 22, 2010

ADDED_TO_STAGE doesn't always fire

Flash development geekery ahead. This is mainly so I can remember the solution to this problem in the future, but maybe this will help someone else, too...

I was struggling with a problem in Actionscript 3 for two hours trying to figure out why some ADDED_TO_STAGE events weren't firing on some MovieClips I had added to some MovieClip symbols I was instantiating.

I had four identical symbols, all the same class inherited from MovieClip, added to another MovieClip symbol in the library. Each would register for an ADDED_TO_STAGE event in itself in the constructor, but when the parent MovieClip was instantiated and added to the stage, only the first of the four MovieClip would actually fire.

The solution? Instead of registering for the ADDED_TO_STAGE event in themselves, I registered in "this.parent", i.e., I would watch for when the parent MovieClip gets added instead of the MovieClip itself. It works, but doesn't seem right. What if I need to make the parent MovieClip a sub-clip of another MovieClip? Will it break again? And how do I remove the listener if the parent changes?

I like the concept of Actionscript 3, but in practice, I'm finding lots of gotchas that make development seem harder than it should be.

Wednesday, July 07, 2010

Treadsylvania is live!

Finally, the ATV safety game we created for National 4-H is live and available for the general public to play. It's called Treadsylvania, and features some fun monster-fighting action! Check it out.

Monday, June 14, 2010

Easy Depth Sorting in Actionscript 3

I'm working on an ActionScript 3 project, and I needed a way to height-sort objects on the screen (so that elements further down the screen are drawn on top of elements further back). Thanks to a little web searching and my own hacking, here's an easy solution to the problem. It's called "DepthSort Space", and it's a movie clip that depth sorts all its children each frame. Currently, it uses bubble sort on the list, but if speed is of the essence, you could probably use some other sorting mechanism.


package {

import flash.display.*;
import flash.events.*;

public class DepthSortSpace extends MovieClip {

public function DepthSortSpace() {
super();
this.addEventListener( Event.ADDED_TO_STAGE, this.addedToStage, false, 0, true );
}

private function addedToStage( e:Event ) {
this.stage.addEventListener( Event.ENTER_FRAME, this.enterFrame, false, 0, true );
}

private function sortDisplayList():void {
var len:uint = numChildren;
var i,j;
for( i=0; i < len-1; i++ )
for (j=i+1; j < len; j++)
if ( getChildAt(i).y > getChildAt(j).y ) this.swapChildrenAt( i, j );
}

private function enterFrame(e:Event) {
this.sortDisplayList();
}

}
}


To use this, just make a new symbol, and set its class to DepthSortSpace (or subclass DepthSortSpace as your movie clip if you're already adding custom code for it). Then, add any objects you want to depth sort as children of this movie clip. It will handle it automatically.

Friday, June 04, 2010

Apple's HTML5 Gallery

Apple just released an HTML5 Showcase showing what's possible with the current generation of browsers (read: why the need for Flash is overstated).

I think what's clear is that Flash is still the way to go if you want to do vector-based interactive animations (i.e., games), but Flash is no longer necessary (or, at least, should be the fallback) for the things it's been used for in its most popular contexts, like video playback. That's a good thing, since video is a media type that browsers should understand, just like images, and it's in the spec. The sooner people are coding to the spec, the better.

But even the interactive animation context is under assault. With the canvas element, you can already create interactive animations using bitmap graphics and crude vector graphics. It won't be long before HTML5 games start showing up. If Adobe wants to make the case for Flash's long-term relevance, they need to stop putting all their chips in fighting against the video tag - they lost that one when YouTube jumped - and start focusing more on staying ahead of the canvas element. Adding "real" 3D support (ala Shockwave3D) to Flash would go a long way toward that.

Or, better yet, make a Flash-like IDE for HTML5/Canvas, and migrate Flash users to that, and become the de-facto IDE for developing next-generation interactive web content just like they dominated the last generation. Unfortunately, I don't have a lot of confidence that Adobe is that forward-thinking from their track record with products like Director. But maybe.

Tuesday, April 13, 2010

We are hiring!

We're hiring at NMSU Media Productions:

Web developer - Develop web applications for NMSU internal and external clientele using PHP, MySQL, XHTML, CSS, and Javascript. If you are good at coding the back end of a web site AND good at crafting excellent UI's, we want to talk to you.

Game developer - Develop educational games, mostly using the Flash platform, although we may also be moving to Unity and Objective C (iPhone OS). Artistic skill is not as important as capability to write games and game logic code, as you will be integrating art assets by our artists and animators.

NMSU Media Productions is a great place to work - talented and personable people, fun projects, supportive management, and work that has societal benefit rather than just being for generating revenue for investors. We're located in sunny Las Cruces, and the green chile is bountiful.

Monday, July 06, 2009

Bhut Jolokia Brownies

Hot on the heels (as it were) of releasing "Holy Jolokia," a hot sauce made with Bhut Jolokia, the NMSU Chile Pepper Institute is now selling Bhut Jolokia in powdered form. It's a boon to chefs everywhere who like their food spicy.

(For those of you who don't know, the Bhut Jolokia is the world's hottest pepper, rather recently discovered, whose heat goes into the millions of Scovilles.)

To celebrate, my wife made a whole tray of brownies with only a teaspoon of powdered Bhut Jolokia mixed in. And boy, did it add some zip! Not enough to be painful, but certainly enough to give you a pleasant chile burn for a while. If you're looking for a way to add a little zing to your cooking, just a little bit of this stuff will go a long, long way!

(Cue jokes about putting mind- and body-altering substances in brownies...)

Thursday, July 02, 2009

Preloading Flash SWF's without Executing Scripts

For a project we are doing at work, I had a game engine shell which would load .SWF's into the shell for playing individual vignettes and cutscenes. Because it was going to be served via a web server, I wanted to preload these vignettes during play so that when the vignette was encountered, it would play immediately, instead of the user having to wait to download the item.

However, one of the vignettes had a custom cursor in it, which would hide the regular cursor. The end result of this was that when I preloaded that SWF, it would execute that code and hide the cursor for the movie before displaying that vignette.

The solution was to use URLLoader to load the vignettes to get them into Flash Player's cache, and then, when they were needed, using the Loader class to load them into the engine:
import flash.net.*;
public class SWFPreloader {
public function SWFPreloader() {
// Preload a list of SWFs here, or call preloadSWF()
this. preloadSWF( 'intro' );
}

public function preloadSWF( url:String ) {
var urlr:URLRequest = new URLRequest( url );
var _loader:URLLoader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.load( urlr );
}
}
Using this method, you could preloadSWF() the MovieClips you will need later, and the Flash Player will put them into the cache. Load the MovieClips normally using the Loader() class, and Flash Player will pull the SWF's from the Flash Player cache instead of downloading them again from the web server.

Thursday, June 11, 2009

Update to MVC Framework

I've released an update to the MVC framework for developing Shockwave3D applications in Director. Changes include:
  • Models now receive the act() message each frame.
  • Fixed bug that makes demo scene not work.
  • info() gives more information, and more complete information without parameters.
  • Fixed thumbnailer to include headings on member thumbnails.
  • Added floor() and ceil() math functions.
  • Added event() and replaceController() to the Controllers object. The Controllers object is now implemented a little differently, but the API should be the same.
  • Added centerImage() imaging lingo routine.

Tuesday, April 28, 2009

Holy Jolokia!

It's official. NMSU has its own hot sauce, taken from the hottest pepper in the world, the Bhut Jolokia. Sales of Holy Jolokia go towards an endowed chair at NMSU. Burn your mouth and help higher education at the same time!

Wednesday, November 14, 2007

New Article on Additive Blending Effects

Now that Jorge at IsoInteractive has teased out how to use additive blending in Shockwave3D, I figured I'd put up a page in my Shockwave3D Developer's Center (sorry, I've taken the site down - do not use Adobe Director) showing how additive blending techniques can really enhance the look of a Shockwave3D piece.

Here's a screenshot of what the featured effect (called "FireJet") looks like:

Screenshot of the FireJet effect

Special Effects using Additive and Multiplicative Blending includes a discussion of what additive blending is, and includes exposition, details, and the source code to recreate the above FireJet effect.

It also has a demo that lets you click between several particle textures to see their effects in an additive context, which might give you some ideas for spell effects for your next Director-based RPG game. (Hint, hint!)

Thursday, November 08, 2007

Shockwave Additive & Subtractive Blending

Oh, happy day! Jorge Rodríguez at isointeractive has figured out how to do Additive and Subtractive Blending in Shockwave.

Thursday, October 18, 2007

Quickly view HTTP headers

Found this little gem today. Web-Sniffer.net allows you to enter a URL and it will display the HTTP request and response header.

Friday, October 05, 2007

Creating Accessible Flash Content

WebAIM has posted an article on making Flash content accessible. Widely it is asserted that Flash is accessible, but the reality is that it's not unless you make a Herculean effort to make it so. Thus, a how-to guide is good to have.

In addition, it has a good overview of general accessibility issues for any web content, not just Flash content:
  • Hearing disabilities
    • Provide synchronized captions for any audio that conveys content
  • Photo epilepsy
    • Remove strobing content that flashes between 2 and 55 times per second
  • Motor disabilities
    • Ensure the Flash content is keyboard accessible
    • Do not require fine motor skills
  • Cognitive disabilities
    • Give users control over time sensitive content
    • Provide easy to use controls and navigation schemes
    • Be consistent
    • Use the clearest, simplest language appropriate to the content
  • Low vision
    • Provide plenty of contrast
    • Allow the Flash content to scale to a larger size
  • Blindness
    • Ensure screen reader accessibility or provide an accessible alternative
    • Ensure keyboard accessibility
    • Do not interfere with screen reader audio or keyboard commands
    • Provide textual equivalents for all non-text elements that convey content or provide a function.
This list of accessibility items is always a good thing to look at when you are faced with a site that you need to update or design. Keeps you in check when you (or someone else) is looking to get funky with AJAX, general Javascript, or Flash on the web.

Tuesday, October 02, 2007

Flash "memory leak" in Director

For our current project, I've been trying to nail down what appeared to be a memory leak in Director with respect to Flash members. It's not technically a "leak," per se, but the end result is the same: memory gets allocated that cannot be de-allocated. After some investigation, here's what is going on.

I was using Flash members to store bitmap graphics for a project which required cartoony characters. These character graphics were 256x512 pixels in size, so I could either use 16k to store a Flash member that contained all the frames for the animation, or I could use 512k per frame of animation to store the bitmaps. No brainer, right?

Well, there's a problem. Apparently, if you use "the posterFrame" property of a Flash member, Director's engine will become unable to unload it. My guess is that this is because it is flagged as "changed" in the same way that a bitmap cast member cannot be unloaded after you change its image using its image property. I suppose this makes sense, because the posterFrame set would be lost if the member was unloaded.

So, basically, we have a situation where, if we store graphics in a Flash member and extract them via the posterFrame property, you can never unload them.

What to do? As with most things in Director, there is a workaround. Since the Flash member can never be unloaded when you set its posterframe, the trick is to not set its posterframe, but instead set the posterframe of a duplicate. Make a copy of the Flash member, yank the posterframes from that, and then erase it. The original Flash member can remain unloaded in this case, and the member which cannot be unloaded is instead erased. Here's the code:

on getFlashImage theMember, thePosterFrame

-- We can accept either a literal member reference, a string, or a number.
if (theMember.ilk = #member) then m = theMember
else m = member(theMember)

-- Duplicate the member, and set its posterframe
theTempMember = member(m.duplicate(), m.castlibnum)
theTempMember.posterframe = thePosterFrame

-- Grab the image
i = theTempMember.image.duplicate()

-- Erase the temporary member
theTempMember.erase()

-- Unload the original member
m.unload()

-- Return the image
return i

end getFlashImage

Tuesday, September 11, 2007

9 JavaScript Tips You May Not Know | Ayman Hourieh's Blog

Ayman Hourieh has provided a nice overview of 9 JavaScript Tips You May Not Know. I knew almost all of these, but there were a few nuggets in there I thought were clever, such as the way to model linked lists with arithmetic, and the static local variables trick.

Thursday, June 28, 2007

Bug Fix in the Code Thumbnailer

It came to my attention that there was a bug in the Code Thumbnailer code that was up on my Shockwave 3D Developer's Guide page. It doubled-up the type names on the thumbnails, instead of showing it once, and then including the rest of the member name.

Anyway, it's been fixed on the thumbnailer page. The updated version will also be included in the next release of the MVC Framework which I'm working on.

Tuesday, June 19, 2007

Winding down the "Double Creature Feature"

The "Double Creature Feature" ACE/NETC Conference has wound down, and boy, are we exhausted. Being the host state for a conference of about 500 communications professionals and the IT professionals who support them can wear you out! Despite the rather impressive battery of sessions available, I was only able to attend about three, since I was proctoring, monitoring, and troubleshooting for the rest of the conference. However, there were still many highlights:
  • Awards Banquet - While we had a slow year in the ACE awards for projects, the New Mexico crowd picked up three of the Professional Skill awards. Me, my wife, and our former boss all came home with best-of-discipline achievement awards, and it felt pretty great to have the appreciation of your peers. (Our boss's award in particular was good, since his contribution to the ACE organization has been very high, and the excellence of everyone in our department that picked up awards is directly tied to his unceasing support for continued professional development. I don't believe he is going to get recognized for those accomplishments in his home state, but I think it speaks more coming from a professional organization, anyway.)
  • Attendees - The attendees at ACE/NETC, almost to a person, were friendly, knowledgeable, clever, and sharp. I enjoyed almost every conversation I had with people, and that's saying something coming from an introvert like myself. And they all seemed to be having a great time - I often heard that this was the best ACE/NETC conference yet. It feels great to put on something that makes people happy and which they appreciate; it's the same feeling I get when we do Carnival of Souls.
  • Sessions - I didn't get much time to just go to sessions and listen, but I did manage to see firsthand some great sessions. My clear favorite was presented by Alessandro A. Bellina, from University of Illinois Extension, speaking about AJAX. It's not that AJAX is this new thing to me, but the web crew from Illinois are one of the few web groups I've seen in ACE/NETC that really are doing some well-designed and well-thought-out stuff. They don't just mash tech together for the propeller-geekery of it, as certain groups that attend ACE/NETC appear to do, but instead are putting real thought into solving problems effectively. I saw them present on their custom CMS for the Illinois Cooperative Extension System years ago and was mightily impressed - in fact, their vision of a CMS solution has highly influenced some of the solutions I have built since then for NMSU. It was great to see what they were up to, and I'm gratified to discover that we're doing a lot of the same stuff now.
  • El Pinto – The night we all went to El Pinto was nice. Great weather, great food, great music, and a chance to go visit where my wife and I tied the knot 10 years ago. It was fun.
  • Hanging with the crew - I spent a lot of time sitting around talking with people from work at this conference, and it was a lot of fun. It was fun chatting with people between sessions or around the impromptu Guitar Hero party in the hotel atrium one night. It served as a powerful reminder that I work with some really awesome people, and it struck me (as it often does) what a value it is to truly enjoy the people you work with.
All in all, it was a success, and everyone seemed to enjoy it. We're off the hook for hosting now for about 40 years. Yay!

Wednesday, June 13, 2007

Introduction to 3D Game Scripting

I've added a twenty-three-page tutorial to my Shockwave3D Developer's Guide page called Introduction to 3D Game Scripting.

Thumbnail of first page of 'Introduction to Low-Polygon Game Asset Texturing
It takes the new or novice Lightwave user through the process of exporting Lightwave content to Shockwave3D format for use in Director, and using my Model-View-Controller Framework (below) to begin adding interactivity to 3D scenes.

This document was uploaded in preparation for my presentation on the development of Science Pirates at the ACE/NETC "Double Creature Feature" Conference we're hosting in Albuquerque this coming weekend. If you'd like to learn more about developing Shockwave3D games - or any other aspect of communications from web to print to video (see the massive list of sessions) - it's not too late to register and attend!