{"id":13745201,"url":"https://github.com/hype/HYPE_AS3","last_synced_at":"2025-05-09T04:34:38.176Z","repository":{"id":693066,"uuid":"337349","full_name":"hype/HYPE_AS3","owner":"hype","description":"the Hype Framework is a collaborative visual framework developed in FDT and AS3 by Branden Hall and Joshua Davis.","archived":false,"fork":false,"pushed_at":"2011-10-30T14:44:36.000Z","size":79843,"stargazers_count":123,"open_issues_count":2,"forks_count":20,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-15T17:40:55.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.hypeframework.org","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hype.png","metadata":{"files":{"readme":"readme.txt","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-10-14T16:30:21.000Z","updated_at":"2024-02-13T23:11:27.000Z","dependencies_parsed_at":"2022-07-07T14:27:59.378Z","dependency_job_id":null,"html_url":"https://github.com/hype/HYPE_AS3","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hype%2FHYPE_AS3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hype%2FHYPE_AS3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hype%2FHYPE_AS3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hype%2FHYPE_AS3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hype","download_url":"https://codeload.github.com/hype/HYPE_AS3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253192781,"owners_count":21868991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:24.763Z","updated_at":"2025-05-09T04:34:37.406Z","avatar_url":"https://github.com/hype.png","language":"ActionScript","funding_links":[],"categories":["Unsorted"],"sub_categories":["Other API"],"readme":"\nthe HYPE framework\n-------------------------------------------------------------------------------\n\n\n\nInstallation \u0026 Setup\n-------------------------------------------------------------------------------\n\nYou and HYPE have a play date in about 5 minutes! Let's make sure you're ready!\n\nFirst, you have to have Flash Professional CS4 or later  installed on your \ncomputer. PC or Mac, it doesn't matter.\n\nTo install HYPE for use in a project you simply need to tell Flash to include\nthe \"hype.swc\" file. There are two ways to do this - globally or on a per-FLA\nbasis. You will probably want to just install it globally (don't worry, none\nof the HYPE classes are included in a SWF unless you use them!)\n\nTo install the SWC globally you need to open the main application preferences\nfor Flash. Then select the \"ActionScript\" option on the left. Next click the\n\"ActionScript 3.0 Settings...\" button. In the middle you will see a section\nlabeled \"Library path:\". Press the red and white button with the \"f\" on it and\nbrowse to the \"hype.swc\" file. Now just click \"Ok\" and you're all set!\n\nIt's a very similar procedure if you want to just link the SWC to a particular\nFLA. To do that open the publish settings of your FLA and select the Flash tab.\nThen, in the middle of the panel select the \"Library\" tab. Finally, click the\nred and white button with the \"f\" on it and browse to the \"hype.swc\" file.\nClick \"Ok\" and you're all done!\n\nIf you ever run into a problem where Flash complains that it doesn't know\nabout some HYPE class, you usually just forgot to link in the \"hype.swc\" file.\n\nPlay Time!\n-------------------------------------------------------------------------------\n\nFirst thing's first, crack open Flash Pro and create a new ActionScript 3 FLA.\nNow, go ahead and draw a circle (you can get all artsy and draw a rhombus or\nsomething, but I'm going to keep calling it a circle so don't get confused!).\nNow select your circle and open the Modify \u003e Convert to Symbol... menu. Name\nyour symbol \"Circle\" and hit OK.\n\nNext select your instance of Circle on the stage and give it an instance name\nof \"circle\" (I generally capitalize symbol names and leave instance names lower\ncase - it helps to keep track of which is which!).\n\nNow add a new layer to your timeline and name it actions - we'll be putting our\ncode here. Yes, I can hear you developers moaning. No, I don't care. We're\nplaying here, there are no rules except for one - have fun! If you want to\nclean up the code and make it use a document class later - feel free!\n\nAnyways, select that first frame in your actions layer and open the actions\npanel. The first thing we need to do is to import the bits of HYPE we're going\nto need. First up, we're going to need the MouseFollowSpring class - you can\nimport it by adding this line:\n\n import hype.extended.behavior.MouseFollowSpring;\n\nNow we just need to make an instance of that behavior and attach it to our\ncircle. That's as easy as adding this next line:\n\n var b:MouseFollowSpring = new MouseFollowSpring(circle, 0.8, 0.1);\n\nSo what's going on here? Well, we're making a new instance of MouseFollowSpring\nand assigning it to a variable named b. We're passing the constructor 3\narguments. The first says that we'll be making our circle instance follow the\nmouse, the second says how much spring there will be to it's movement and the\nthird says how quickly the circle can move toward the mouse (0.1 means it can,\nat most, move 10% of the way to the mouse on each step).\n\nNow if you run your movie... nothing will happen! We have to start our behavior\nfor it to work! To do so add this line:\n\n b.start();\n\nAnd then run your movie - the circle will now track the mouse!\n\nWhat you see here is a behavior - a staple of HYPE. Behaviors make things do\nstuff. Yes that is a horribly vague statement, but given the flexibility of\nHYPE it is the most accurate definition! There are a bunch of behaviors\nbuilt-in with HYPE - play with them. All of them. Do it. Now is fine or when\nyou're done - but do it! HYPE is best learned through play!\n\nNow, as for our example, back when Flash 3 came out this was some cutting edge\nstuff... but 10 years later it is, to say the very least, passe. Let's make it\na bit more hip.\n\n\n\nBlitting a Bitmap\n-------------------------------------------------------------------------------\n\nThe BitmapCanvas class allows you to easily capture any other display object as\na bitmap. Let's add one to our movie and tell it to continuously draw (never\nerase). To do this first add this to the top of your code:\n\n import hype.framework.display.BitmapCanvas;\n\nNow, we have a slight problem with our code. BitmapCanvas needs to be able to\npoint to a display object to draw it. We could just point it at the stage, but\nthen it would draw everything on the stage, and we might not want that.\nInstead, let's make a container for canvas to draw.\n\nFirst, go ahead and remove the circle instance there on the stage. Then, open\nthe Circle symbol, click the Advanced button and select \"Export for\nActionScript\" and \"Export in Frame 1\". Then, give it a class name of Circle and\nclick OK.\n\nNow, under the imports but above our mouse follow code add the following:\n\n var container:Sprite = new Sprite();\n var circle:MovieClip = new Circle();\n container.addChild(circle);\n addChild(container);\n\nThis code just makes a new container, then makes a new instance of circle,\nstuffs it in the container, and displays the container.\n\nNote that while we're adding the container to the stage, the only reason we\nneed to do that is because the MouseFollowSpring code uses the \"stage\" property\nof it's target (our circle) - and that property doesn't exist if the target\nisn't placed on the stage.\n\nSo far so good, but nothing new or sexy visually is happening. Let's fix that.\nAdd this code at the bottom:\n\n var canvas:BitmapCanvas = new BitmapCanvas(550, 400);\n canvas.startCapture(container, true);\n addChild(canvas);\n\nThis code creates a new BitmapCanvas instance, sets it's size to 550 x 400\n(change it to whatever your stage size is!), tells the canvas to start\ncapturing and never to erase (that's the second argument), and finally adds\ncanvas to the stage.\n\nRun your code and check it out! Still passe, but a bit more sexy. Now let's\nreally dial it up and blur it out over time!\n\n\n\nBlurring the Lines (and the fills)\n-------------------------------------------------------------------------------\n\nA Rhythm is just code that is run over time. Like Behaviors that can be started\nand stopped. The only non-simple rhythm that comes with HYPE v1.0 is the\nFilterCanvasRhythm - which just runs a filter repeatedly on an instance of\nBitmapCanvas, which is exactly what we need!\n\nFirst add the import statement to the top of your code:\n\n import hype.extended.rhythm.FilterCanvasRhythm;\n\nThen add the following to the bottom of your code:\n\n var blur:BlurFilter = new BlurFilter(5, 5, 3);\n var blurRhythm:FilterCanvasRhythm = new FilterCanvasRhythm([blur], canvas);\n blurRhythm.start();\n\nThis code makes a new BlurFilter (this is a built-in class). Then, it makes an\ninstance of FilterCanvasRhythm and tells it the only filter it will use is the \nblur filter instance and to use the BitmapData instance that's part of our \ncanvas!\n\nFinally, the code tells the rhythm to get started. Now run the code. Yes it's\nstill a mouse follower, and is thus lame, but at least it looks all cool and\nblurry!\n\nOne last thing before you head off to play. Let's say you wanted that blur\nfilter to only run every 4th frame so that it blurred out less quickly. To do\nthis all you need to do is add this import at the top of your code:\n\n import hype.framework.core.TimeType;\n\nAnd then change the line that starts the FilterRhythm instance from this:\n\n blurRhythm.start();\n\nto this:\n\n blurRhythm.start(TimeType.ENTER_FRAME, 4);\n\nThis tells the rhythm that it must use ENTER_FRAME as it's timing mechanism\n(which is the default) and to only run every 4th frame. Give the code a test\nand you'll see it blurs out much more slowly.\n\n\n\nThe Beginning\n-------------------------------------------------------------------------------\n\nThat's it. You're now playing with HYPE. Don't let me stop you! Fiddle around\nwith some of the numbers I used in the examples. Try adding another clip that\nalso follows the mouse. Have fun, and if you get stuck, check out the\n\"docs.html\" file - it will launch the asdocs for HYPE. These are simple\nexplanations for all of the parts of HYPE, their syntax, and how they work.\n\nIf you have any questions about HYPE or want to just chat with fellow HYPE\nusers please join the official HYPE mailing list:\n\nhttp://groups.google.com/group/hypeframework/\n\nNow, get playing!\n\n~ Love,\n\nBranden Hall \u0026 Joshua Davis\n\n@hypeframework\n@waxpraxis\n@joshuadavis\n\n\n-------------------------------------------------------------------------------\n\nChange Log\n-------------------------------------------------------------------------------\n1.1.9 / Enhancements / Updates / Bug Fixes :\n    - added destroy method to ObjectPool (thanks nodename!)\n    - split ICanvas into two interfaces, ICanvas and IEncodable\n    - changed ICanvas so that startCapture can accept either a DisplayObject \n      or a Vector or Array of DisplayObjects\n    - added colorTransform method to ICanvas\n    - removed get/set target from ICanvas\n    - updated encoder infrastructure to use IEncoder rather than ICanavs\n    - added new BitmapCanvasCompositor class that can be used to combine \n      multiple BitmapCanvas instances with alpha compositing\n    - added new scale parameter to BitmapCanvas so that content can be scaled \n      before it is captured\n    - fixed issue on BitmapCanvas where clear wouldn't clear the large canvas\n    - added colorTransform method to BitmapCanvas\n    - changed PixelColorist so it supports either passing the constructor a \n      class that subclasses BitmapData or an instance of BitmapData\n    - added getColorAt method to get the color at a specific x and y location\n    - added automatic support for BitmapCanvasCompositor to ContextSaveImage\n    - added destroyManager and destroy methods to RhythmManager \n      (thanks magicbruno!)\n    - removed MXP package\n    - combined hype_framework.swc and hype_extended.swc into hype.swc\n    - now compiled with mxmlc 4.1.0\n\n1.1.8 / Enhancements / Updates :\n    - updated all FLA-based examples for increased clarity\n    - added SimpleProximity behavior\n\n1.1.7 / Enhancements / Updates :\n    - modified 01_adjuster example\n    - added 02_adjuster example\n    - the Adjuster class now exposes activeClip property\n    - modified PixelColorist to deal with multiple children in the target sprite\n    - added DepthShuffle behavior\n    - added examples 01_depthShuffle, 02_depthShuffle, 03_depthShuffle,\n      04_depthShuffle, and 05_depthShuffle\n\n1.1.6 / Bug fixes\n    - fixed nasty bug in ObjectPool\n    - added applyLayout to ILayout (thanks markstar!)\n\n1.1.5 / Bug fixes / Enhancements / Updates :\n    - fixed bugs in ObjectSet that were causing runtime errors\n\n    - exposed all properties of behaviors so they could be changed at runtime\n      (see Swarm behavior for example)\n\n    - deprecated ContextSavePNG in favor of generalized ContextSaveImage\n\n    - created hype-framework.swc and hype-extended.swc for use with either\n      Flash CS4+ or FlexBuilder/FlashBuilder\n\n    - added TGACanvasEncoder to output Targa (TGA) files\n      Targa output size is only limited by user RAM, PNG is limited to approx.\n      100,000 total pixels - at that point script timeout errors will occur\n\n    - moved Flash-based examples into own folder, added some basic pure AS3\n      examples (more coming in later releases)\n\n    - fixed all outstanding issues on GitHub \n      (thanks sebleedelise and markstar!)\n\n1.1.1 / Updates :\n    - moved all examples that use ContextSavePNG to their own folder and added\n      a new example\n\n1.1.0 / Enhancements / Updates :\n    - added ability for ObjectPool's constructor to accept either single\n      classes or an array of classes that are randomly chosen from\n\n    - added new CanvasFilterRhythm class that makes filtering instances of\n      BitmapCanvas easier\n\n    - created new ICanvas interface and two classes that implement it,\n      SimpleCanvas and GridCanvas\n\n    - modified BitmapCanvas to use new ICanvas classes and added new\n      setupLargeCanvas(scale:int) method\n\n    - added new CanvasPNGEncoder for creating PNGs from ICanvas classes\n\n    - added new ContextSavePNG - a simple class to assist in encoding and\n      saving large PNGs from BitmapCanvas instances\n\n    - created two new BitmapCanvas examples, 06 and 07, to show new PNG\n      encoding capabilities\n\n1.0.2 / Bug fixes / Enhancements / Updates :\n\n    - jDavis made tons of changes to almost every .fla to polish things like\n      variable name consistency, removing addChild(clipContainer) if not\n      needed, etc. website also reflects all updates.\n\n    - added RandomTrigger.as to extended/trigger - used in SimpleBallistic\n      examples 02 and 03\n\n    - added PixelColorist.as to extended/color - used in Color\n      examples 03, 04 and 05 - applies color to object in relation to a\n      specific pixel color found on a linked image\n\n    - added SimpleBallistic.as to extended/behavior - new examples added.\n\n    - modified ExitShapeTrigger.as / constructor to support new enterOnceFlag\n      argument. Defaults to false. If true the target MUST enter the shape at\n      least once before the trigger will fire\n\n    - modified Oscillator.as / Added new argument to constructor\n      (linkOffset - links offset to frequency). The frequency is now modified\n      through a property. Added new amplitude property. Added new offset\n      property. Added new linkOffset property.\n\n    - added new function clear to BitmapCanvas.as / which clears the canvas\n      back to it's base color\n\n    - new examples / BitmapCanvas, Color, SimpleBallistic, and Oscillator\n\n    - fixed Setup Classpath.jsfl so it works properly for our PC friends\n\n1.0.1 / Bug fixes / Updates :\n\n    - Fixed memory leaks in Adjuster \u0026 HotKey - thanks to @SiRobertson\n\n    - Fixed issue with SoundAnalyzer, frequency index 0 was always 0.\n      Now it duplicates index 1 (seems to be bug in SoundMixer).\n      Updated 03_soundAnalyzer and 04_soundAnalyzer.\n\n    - Added 05_soundAnalyzer and 06_soundAnalyzer to demonstrate\n      soundAnalyzer.getFrequencyRange\n\n1.0.0 / Initial release\n\n\nCredits\n-------------------------------------------------------------------------------\n\nHYPE was developed and is copyrighted by Branden Hall \u0026 Joshua Davis, 2009.\nSee license.txt for licensing information.\n\nJoshua and Branden would sincerely like to thank their families for the support\nand understanding during the development of HYPE and throughout their careers!\n\nMr. Doob's Stats is included courtesy of Mr. Doob.\n(http://code.google.com/p/mrdoob/wiki/stats)\n\nCanvasPNGEncoder is based on PNGEncoder from AS3CoreLib. See license.doc for\nlicensing information.\n\nLOVE to bevin keley aka blevin blectum for letting us use two of her tracks,\n\"Retrice\" and \"Foyer Fire\", from her Gular Flutter album, for our SoundAnalyzer\nexamples. (http://blevin.LSR1.com)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhype%2FHYPE_AS3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhype%2FHYPE_AS3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhype%2FHYPE_AS3/lists"}