download / 3.3 mb zip
version : 1.1.9
updated : February 18, 2011
open all | close all
upcoming HYPE events
No events.
let's keep in touch.
Keep us informed what you're working on using HYPE by connecting with us, either via e-mail or through twitter.

hype@hypeframework.org
twitter.com/hypeframework
Branden Hall

automatastudios.com
twitter.com/waxpraxis
Joshua Davis

joshuadavis.com
twitter.com/joshuadavis
flickr.com/photos/joshuadavis

You and HYPE have a play date in about 5 minutes! Let’s make sure you’re ready!

First, you have to have Flash Professional CS4 installed on your computer.
PC or Mac, it doesn’t matter.

Now take a look at all of the other files that came long with this readme.

If you’re crusty developer type, grab the “src” folder, look at the docs and examples and get down with your bad self – I’ll see you in a few paragraphs if you still want to go through the tutorial, otherwise, have fun!

For folks who want a slightly easier route, go ahead and double click on the “HYPE.mxp” file. Check out the window-o’-legalese and click “Accept”. You’ve now copied all of the source files that make up HYPE into your personal library area that Flash sets up when it gets installed.

(If you get some kind of goofy error you probably have an older version of Flash still installed on your computer. That’s not a problem, just make sure that you open the MXP file with “Adobe Extension Manager CS4″. http://www.adobe.com/exchange/em_download/)

There’s just one more step – you need to open the “Setup Classpaths.jsfl” file with Flash CS4. You should be able to just double-click on it, but in case that doesn’t work just use the Commands > Run Command… menu inside of Flash to run it. This just makes sure that Flash knows about where that MXP just stashed the HYPE source code.

Play Time!

First thing’s first, crack open Flash CS4 and create a new ActionScript 3 FLA. Now, go ahead and draw a circle (you can get all artsy and draw a rhombus or something, but I’m going to keep calling it a circle so don’t get confused!). Now select your circle and open the Modify > Convert to Symbol… menu. Name your symbol “Circle” and hit OK.

Next select your instance of Circle on the stage and give it an instance name of “circle” (I generally capitalize symbol names and leave instance names lower case – it helps to keep track of which is which!).

Now add a new layer to your timeline and name it actions – we’ll be putting our code here. Yes, I can hear you developers moaning. No, I don’t care. We’re playing here, there are no rules except for one – have fun! If you want to clean up the code and make it use a document class later – feel free!

Anyways, select that first frame in your actions layer and open the actions panel. The first thing we need to do is to import the bits of HYPE we’re going to need. First up, we’re going to need the MouseFollowSpring class – you can import it by adding this line:

import hype.extended.behavior.MouseFollowSpring;

Now we just need to make an instance of that behavior and attach it to our circle. That’s as easy as adding this next line:

var b:MouseFollowSpring = new MouseFollowSpring(circle, 0.8, 0.1);

So what’s going on here? Well, we’re making a new instance of MouseFollowSpring and assigning it to a variable named b. We’re passing the constructor 3 arguments. The first says that we’ll be making our circle instance follow the mouse, the second says how much spring there will be to it’s movement and the third says how quickly the circle can move toward the mouse (0.1 means it can, at most, move 10% of the way to the mouse on each step).

Now if you run your movie… nothing will happen! We have to start our behavior for it to work! To do so add this line:

b.start();

And then run your movie – the circle will now track the mouse!

What you see here is a behavior – a staple of HYPE. Behaviors make things do stuff. Yes that is a horribly vague statement, but given the flexibility of HYPE it is the most accurate definition! There are a bunch of behaviors built-in with HYPE – play with them. All of them. Do it. Now is fine or when you’re done – but do it! HYPE is best learned through play!

Now, as for our example, back when Flash 3 came out this was some cutting edge stuff… but 10 years later it is, to say the very least, passe. Let’s make it a bit more hip.

Blitting a Bitmap

The BitmapCanvas class allows you to easily capture any other display object as a bitmap. Let’s add one to our movie and tell it to continuously draw (never erase). To do this first add this to the top of your code:

import hype.framework.display.BitmapCanvas;

Now, we have a slight problem with our code. BitmapCanvas needs to be able to point to a display object to draw it. We could just point it at the stage, but then it would draw everything on the stage, and we might not want that. Instead, let’s make a container for canvas to draw.

First, go ahead and remove the circle instance there on the stage. Then, open the Circle symbol, click the Advanced button and select “Export for ActionScript” and “Export in Frame 1″. Then, give it a class name of Circle and click OK.

Now, under the imports but above our mouse follow code add the following:

var container:Sprite = new Sprite();
var circle:MovieClip = new Circle();
container.addChild(circle);
addChild(container);

This code just makes a new container, then makes a new instance of circle, stuffs it in the container, and displays the container.

Note that while we’re adding the container to the stage, the only reason we need to do that is because the MouseFollowSpring code uses the “stage” property of it’s target (our circle) – and that property doesn’t exist if the target isn’t placed on the stage.

So far so good, but nothing new or sexy visually is happening. Let’s fix that. Add this code at the bottom:

var canvas:BitmapCanvas = new BitmapCanvas(550, 400);
canvas.startCapture(container, true);
addChild(canvas);

This code creates a new BitmapCanvas instance, sets it’s size to 550 x 400 (change it to whatever your stage size is!), tells the canvas to start capturing and never to erase (that’s the second argument), and finally adds canvas to the stage.

Run your code and check it out! Still passe, but a bit more sexy. Now let’s really dial it up and blur it out over time!

Blurring the Lines (and the fills)

A Rhythm is just code that is run over time. Like Behaviors that can be started and stopped. The only non-simple rhythm that comes with HYPE v1.0 is the FilterRhythm – which just runs a filter repeatedly on an instance of BitmapData, which is exactly what we need!

First add the import statement to the top of your code:

import hype.extended.rhythm.FilterRhythm;

Then add the following to the bottom of your code:

var blur:BlurFilter = new BlurFilter(5, 5, 3);
var blurRhythm:FilterRhythm = new FilterRhythm([blur], canvas.bitmap.bitmapData);
blurRhythm.start();

This code makes a new BlurFilter (this is a built-in class). Then, it makes an instance of FilterRhythm and tells it the only filter it will use is the blur filter instance and to use the BitmapData instance that’s part of our canvas!

Finally, the code tells the rhythm to get started. Now run the code. Yes it’s still a mouse follower, and is thus lame, but at least it looks all cool and blurry!

One last thing before you head off to play. Let’s say you wanted that blur filter to only run every 4th frame so that it blurred out less quickly. To do this all you need to do is add this import at the top of your code:

import hype.framework.core.TimeType;

And then change the line that starts the FilterRhythm instance from this:

blurRhythm.start();

to this:

blurRhythm.start(TimeType.ENTER_FRAME, 4);

This tells the rhythm that it must use ENTER_FRAME as it’s timing mechanism (which is the default) and to only run every 4th frame. Give the code a test and you’ll see it blurs out much more slowly.

The Beginning

That’s it. You’re now playing with HYPE. Don’t let me stop you! Fiddle around with some of the numbers I used in the examples. Try adding another clip that also follows the mouse. Have fun, and if you get stuck, check out the “docs.html” file – it will launch the asdocs for HYPE. These are simple explanations for all of the parts of HYPE, their syntax, and how they work.

Get playing!

~ Love,

Branden Hall & Joshua Davis

Credits

HYPE was developed and is copyrighted by Branden Hall & Joshua Davis, 2009. See license.txt for licensing information.

Joshua and Branden would sincerely like to thank their families for the support and understanding during the development of HYPE and throughout their careers!

Mr. Doob’s Stats is included courtesy of Mr. Doob.

http://code.google.com/p/mrdoob/wiki/stats

LOVE to bevin keley aka blevin blectum for letting us use two of her tracks, “Retrice” and “Foyer Fire”, from her Gular Flutter album, for our SoundAnalyzer examples.

http://blevin.LSR1.com

Leave a Comment
Bram Timmer said, on October 31st, 2009 at 12:06 am

Love it! Thanks for publishing this tonight guys. Let’s see how well we do with a bit of whiskey warping the brain ;)

Jeffery Saddoris said, on October 31st, 2009 at 12:12 am

Fantastic project, Josh. I first met you at FlashForward in SF, 2001 and was blown away then by your creativity and commitment to contributing to both the art and Flash communities. Congrats to both you and Branden on getting HYPE out into the fray.

Scott Tweedie said, on October 31st, 2009 at 1:03 am

Thanks Josh, looking forward to having some fun with Hype!

Bram Timmer said, on October 31st, 2009 at 1:44 am

My inebriated state got confuzzled with “Clicking the advanced button…” Solution: hop on over to your library panel, right click the ‘circle’ and bring up the properties. Once you’ve followed the steps of Export for AS and export frame 1, an error is likely to show which reads something like “A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.” Hit ok.

Jesse Burgheimer said, on October 31st, 2009 at 1:46 am

The spirit of Dreamless lives!

(get back to work. belch.)

Alex McLeod said, on October 31st, 2009 at 8:17 am

sooooo good! Madd thanks!

Pascal said, on October 31st, 2009 at 11:22 am

Nice job !

Branden Hall said, on October 31st, 2009 at 12:19 pm

Oh! I forgot to mention – there are videos I’ve recorded about HYPE (including a new demo that will be avilable later today) at the HYPE channel at Vimeo – enjoy!

Jason Doherty said, on October 31st, 2009 at 3:59 pm

@ Bram – Whisky and Actionscript go hand in hand!! (for me anyways)

hush said, on October 31st, 2009 at 4:02 pm

cool shite, let’s take it for a spin ;]

Eric Fickes said, on October 31st, 2009 at 11:40 pm

Thanks for opening for download, and for kicking ass! Looking forward to making squigglies and doodlies!

Karl said, on November 1st, 2009 at 4:49 pm

Maybe this is just a detail but why isn’t Hype to be meant to work on CS3 Flash systems?

Branden Hall said, on November 1st, 2009 at 6:14 pm

Karl – fundamentally, for the sake of simplicity. We’d prefer to not spend out time making sure that our code works with both versions and packaging everything separately. I don’t believe that there’s anything currently in HYPE that is CS4 specific, but that will probably change within the next few updates (3D, Vectors and PixelBender all come to mind). If you want to manually setup the source to work with CS3 have at it – please let us know if you run into any problems.

Also, CS4 has been out for over a year now, so given the 18 month to 2 year life cycle of Flash, we’re more than half way through with CS4 (kinda scary, isn’t it?!).

Lyubomir Popov said, on November 2nd, 2009 at 6:31 am

Tried to follow the tutorial, but how do you use this from within a document class? Sorry for the n00b question.

Matteo said, on November 2nd, 2009 at 6:55 am

Great! I can’t wait for play with HYPE!! thank you!

Lee Probert said, on November 2nd, 2009 at 7:29 am

Do you have a repository URL for Hype now?

matiass said, on November 2nd, 2009 at 9:56 am

Amazing! I´ll spend 2-3 hours a day playing with hype my way to deeper AS3 knowledge! :D
Regards from Argentina.

Branden Hall said, on November 2nd, 2009 at 10:15 am

Lyubomir – a document class would only be slightly different. The code could go right in the constructor and then you’d just have to have your imports inside your package block. Note that you’ll need to explicitly import flash.filters.BlurFilter.

Lee – we’re using a private git server right now. We’re looking at moving at least the release builds up to GitHub so it can be forked more easily in the future. No real timetable on that though, but it is on our plate.

Lyubomir Popov said, on November 2nd, 2009 at 12:28 pm

Thanks for the tip! One more question, do you intend to include something like Processing’s saveFrame()? It would be so nice if you could output the generated animations as an image sequence for use in videos.

Veronique said, on November 2nd, 2009 at 12:58 pm

Thank you Branden and Josh! I just fill out the request form for a New York workshop. Please come.

Branden Hall said, on November 2nd, 2009 at 1:13 pm

Lyubomir – we don’t currently have anything built in to support that, but it is *very* possible to do on your own using PNGEncoder that’s part of AS3CoreLib. We’ll have to look to see if including support for that inside of HYPE would make sense. If nothing else, perhaps adding a new TimeType option to support manual control of time stepping would be handy.

Amanda said, on November 2nd, 2009 at 9:01 pm

I am calling Hype my Flash Mecca and Branden Hall & Joshua Davis my Flash Saviors. Great site. Thanks so much.

Thiago said, on November 3rd, 2009 at 7:37 am

thank you very much !!!! this framework will change my work almost 100% !!! my favorite artist ever….. thanks guys

alberto said, on November 3rd, 2009 at 11:28 am

Kudos to you guys!!!
I can see lot of potential within this framework!!
Thank you!

alberto said, on November 3rd, 2009 at 11:32 am

I forgot…
are you planning to go svn with HYPE, so that we can comfortably stay updated with the code?
That’d help..
Cheers!

Branden Hall said, on November 3rd, 2009 at 11:40 am

Within the next few weeks we’ll be setting up an additional git remote server on GitHub. We’re both new to git so we’re taking out time to make sure we’re doing everything correctly.

Eric Dolecki said, on November 3rd, 2009 at 5:00 pm

GitHub would be awesome. I’d like to contribute and want to make sure everything is current as well.

Eric Dolecki said, on November 3rd, 2009 at 5:09 pm

Some of the mouse stuff needs event.updateAfterEvent(); (ie. MouseFollowSpring)

Branden Hall said, on November 4th, 2009 at 12:27 am

Eric – Well, behaviors are based on a specific “beat” of time (which can be events like Event.ENTER_FRAME, but don’t have to be). While the simplest example could be made more smooth with updateAfterEvent, it kind of falls out of line with how HYPE behaviors work. Really, it’s just an example though, and we’re trying to keep them as simple and understandable as possible. The 1.0 of HYPE is not the end – it’s just the beginning and we’re already starting to see custom behaviors, triggers, rhythms and layouts popping up!

marc Drulot said, on November 4th, 2009 at 2:52 am

Hype is so hyyype :)
Thanks for yr great work.

rolf said, on November 5th, 2009 at 6:09 am

Branden Hall said, on November 1st, 2009 at 6:14 pm
“If you want to manually setup the source to work with CS3 have at it – please let us know if you run into any problems.”

Done. I actually got the “01_objectpool” and “02_swarm” demos working but had to deactivate lines 117 + 186 of RhythmManager and thus disabling RhythmManager.processExitFrame(), since CS3 doesn’t know of any EXIT_FRAME Event. Apart from that the demos run just fine.

I understand that CS4 provides some additional functionality that you guys are willing to explore – breaking compatibility with CS3. Sadly, I don’t plan to upgrade before CS5 is out, but are willing to play with HYPE. Is there any chance to have the core of HYPE being CS3 compatible and then adding optional CS4 stuff on top of that? People with CS3 would then have to omit or port classes that rely on CS4, but basic things like the RhythmManager would work.

Great work, anyways. Don’t let me pull you down ;)
thanks!
Rolf

scottrockers said, on November 5th, 2009 at 2:56 pm

First of all, both of you do amazing and very inspirational work, so thank you. I agree with Rofl, it would be nice to have a cs3 version if possible especially because a lot of people out there still don’t have cs4. If anyone has the source or you guys have a version sent to you please let me know.

Thanks,
Scott

Dan Zen said, on November 7th, 2009 at 11:08 am

Cool framework! Very tidy. Good examples of using interfaces too – calling methods on a subclass that implements the interface.

fernando said, on November 22nd, 2009 at 5:10 pm

just wondering if the cs3 will be released?

Gracias!

F/

Joshua Davis said, on November 22nd, 2009 at 8:14 pm

We have no intention of releasing a CS3 version… CS4 has been out for way too long, and CS5 is right around the corner. Also there are some specific methods we’re using that ONLY work in CS4.

not what you wanted to hear, I know, but at least it’s a definitive answer.

fernando said, on November 23rd, 2009 at 6:20 am

ok!!

Ty any way!!

hans said, on December 16th, 2009 at 5:07 pm

HYPE is very nice and might convince me to learn bit of AS3. AS3 is soooo different from AS2/AS1. I once thought I understood something about AS, because there was a lot of intuitive trial and some error. In AS3 I am totally lost: very restricted trial and always errors… We gained power, structure and performance, but lost intuition, freedom and playfulness. So again thanks very much for sharing this kind of framework. Without these kind of initiatives I would probably stay in AS1 and AS2 world for ever. I hope AS4 will introduce some form of human language in scripting. Simply writing something like ‘Remove all objects from the stage’ should be enough instead of … (some sophisticated code, don’t even know (yet) in AS3). Imagine just really talking to Flash: make 20 objects and present them on stage and make them vibrating…! And flash asking: ok, done, do you want to change the color?… ;))) Hope to show some of my HYPES sooner or later…

Christian said, on December 28th, 2009 at 9:35 am

This is absolutely awesome! Can’t wait to play around with this, thanks for sharing!

hans said, on February 12th, 2010 at 12:22 pm

Alright, changed my opinion! AS3 is far more superior then AS2! Thanks to HYPE I am completely into AS3! Lots to learn but new tools means new results. That’s great! Thanks again!

Julian said, on February 14th, 2010 at 2:45 pm

I was soooo happy to hear from this project for a long time. Yesterday I tried to follow your tutorial on setting up the hype library and the extension manager doesn’t seem to work. I do double click on the HYPE.mxp as you guys said in the instructions and nothing happens. Then when I try the tutorials I get the message: 1172: Definition hype.extended.behavior:MouseFollowSpring could not be found.

Branden Hall said, on February 15th, 2010 at 8:54 am

You need to make sure that you have the Adobe Extension Manager installed – it should have been installed with Flash. If you don’t have it you can download it from http://www.adobe.com/exchange/em_download/

Julian said, on February 15th, 2010 at 3:07 pm

Hi Branden. Thank you for your quick reply. I already did that and It seems to be all ok. I downloaded all the files that appear in the address you said, re-installed and nothing happened. I think I’m going to re-install the Exchange from the originals. I’ll keep in touch.

Neal said, on February 19th, 2010 at 6:43 pm

Dude this is sick. I am a designer and have tried to learn ActionScript on my own several times and gave up after a few days of being stuck on the most basic thing. It seems that a lot of jobs require at some knowledge of AS now a days and this is a great way to learn – I find it hard reading books about code, but actually seeing it work and being able to see all of the pieces that make it work it invaluable. Thanks!

Gabriel Dancause said, on March 7th, 2010 at 11:14 pm

Hi guys

Awesome work on the framework. I’m gonna use it for my musical animations for sure. I’ll make sure to send you the links once done.

I use exclusively FlexBuilder to code my ActionScript projects. I have nothing against Flash CS4, but coming from a Java background, it was pretty easy to learn FlexBuilder (Eclipse). Now, my questions :

Will all the functionnalities of the Hype Framework will work in pure As3 code? (without a .fla)

Is it part of your plan to create a .swc file with your framework? (library)

Thanks again for sharing your work.

Branden Hall said, on March 9th, 2010 at 8:11 am

The SWC and examples for working with pure AS3 are in the most recent builds. There are two SWCs – hype-framework.swc and hype-extended.swc so you only have to include what you will use. All functionality works in any AS3 environment that supports Flash Player 10.

jgomula said, on March 31st, 2010 at 4:49 pm

Hi Guys,

First this is totally awesome and a major step up for me – coming from art and not coding, my cut and paste code methods often leave much to be desired.

One question – I love how multiples of a core object are replicated and modified, but is there a chance for assigning text (like from an external XML file) to the objects? For example, if I wanted a different word pulled from a list and added to each of the 01_adjuster objects (as if they were a bunch of people with name tags on)??

Again, this is really great, thank you so much!!

jgomula said, on March 31st, 2010 at 5:10 pm

Ah! I think I did it :). I’d be happy to send you the code.

SlowX said, on March 1st, 2011 at 10:00 am

In version 1.1.9, is there still a “hype.mxp” and/or “Setup Classpaths.jsfl” file? Can’t find either one…

Branden Hall said, on March 7th, 2011 at 6:38 pm

No, those have been removed. Please read the updated readme.txt that comes with v1.1.9