moock.org is supported in part by


January 14, 2004

got a good flash hack?

O'Reilly publishes a "Hacks" series, including titles such as "Google Hacks" and "eBay Hacks." They're now soliciting submissions for a "Flash Hacks" book (not written by me). You can submit hack ideas directly to the book's editor (Bruce Epstein at bruce@zeusprod.com) or submit them on O'Reilly's site at http://hacks.oreilly.com using the "Got a Hack?" link on the left side of that web page. Hacks can be interesting, non-obvious solutions to common problems, or just non-obvious uses of Flash or ActionScript. For example, using JSFL to export a .swf from the command line is a good hack.

For other hack samples, including design-oriented hacks, see this Word file (~3mb):
http://www.futuremedia.org.uk/hacksSample/hacksSample.zip

i'll also leave the comments open on this entry for a while so folks can submit their ideas here directly if desired.

Posted by moock at January 14, 2004 11:39 AM
Comments

Chad: They have a hard enough time getting the Dictionary right with the things that are in there now. They don't seem to have the time or patience to include them. Those classes are more of a "bonus" or "extra" inclusion with the installation. Because of they're lack of necessity to the Flash application itself, it might not be "deserving" of an entry of the dictionary... or deserving of someone's time to put it in. ... Does the livedocs allow inclusion of NEW items? That'd be a way to go.

Posted by: sen at January 19, 2004 09:46 AM

Dominick,
If you think of a hack in the purest terms, the tween class is certainly a hack IMHO.

By doing a bit of research into the classes of Flash AS, you come across that tween function. I certainly am not denying that. However, it isn't documented in the Flash help and isn't referenced on the Macromedia website's actionscript dictionary. Not only that, but bcause of this, it could easily be removed in future versions of the flash player. This is similar to your ASSetPropFlags example in pretty much every way.

This makes it a hack in my view.

But back to my original questions posed... why is this undocumented? I just don't get why they wouldn't put this ion the dictionary.

Posted by: Chad Udell at January 18, 2004 05:04 PM

I think that ASSetPropFlags should be considered a hack. Most average users trace objects, and only see the [object object] when in reality there are all those hidden members. If you can understand this hack, you can introspect any object and eventually get the info your looking for. The other day I was returning a web service call, but I had forgot what was sent back to me. In fact, it was a query, and I was able to introspect that object to see that it had a 0, 1, etc... property. Knowing that I was able to loop through the resultset and grab the resultset data. I don't take credit for this. And I know that you already know all about ASSetPropFlags. In fact this undocumented feature has been around for a while. I just think that this is a hack. Not necessarily a class that does what its meant to do.

Posted by: Dominick at January 16, 2004 10:00 AM

I don't think that the tween classes are hacks! Anyone that understands actionscript, immediately went into the classes folder and checked out what came with the product. I mean, in the tween class they even show you an example of how to use the tweens. Ask Robert Penner if the tween class is a hack :-). If thats a hack, I guess I can just search through the library and find other examples, label em hacks!

Posted by: Dominick at January 16, 2004 09:53 AM

The new Flash authoring templates for Slideshow hint at a powerful tween and transistion engine buried in the Flash player. In the behaviors palette, you can create transistions, this hack adapts the code in that behavior and allows you to tween a Movieclip in 16 different ways across any property available through the standard setProperty properties available to any movieclip.

It seems as though the easng equations made famous by Robert Penner have been included in and used to produce a tween / easing class for Flash MX 2004. this is just undocumented and definitely a gem of a find.

To use the hack take a look at this Actionscript: foobarTween=new mx.transitions.Tween(targetObj,_property,easingEquation,startPosition,endPosition,duration);Here is a more conrete example:tween=new mx.transitions.Tween(clip,"_x",Strong.easeOut,1,300,50);

I came across that looking for a good tween library a couple of weeks ago for Flash 6 and I was blown away when i found that link.

My question is, why do you think this is undocumented? This seems as though it is a fantastic way to programmatically tween anything you want. Have you heard anything about this? Why would MM not put this in the ActionScript dictionary?

BTW, I can't take credit for discovering that, I found that information at www.FlashMX2004.com

Posted by: Chad Udell at January 15, 2004 12:16 PM

can i submit names of those who flash hack their flash? ie. rip it off? hehe. ill look at the word file.

Posted by: ericd at January 14, 2004 01:10 PM