Hi, I'm Brian Reavis. I design and develop
awesome things for COLOURlovers. I love mountains.

Facebook | Dribbble | Stack Overflow | Twitter

Sketch: Particle Beats

Posted 4 days ago

After trekking to Petsmart this evening to get a Furminator, I sat down to try my hand at visualizing music. With a mix of Processing.org + Minim + some minor post in AE, this is a snippet of the result!

What’s going on: Each particle has a random mass. As the music plays, an FFT breaks down the sound. A spike in volume in the low frequencies energizes high-mass particles, and a spike in volume on higher frequencies energizes the low mass particles. If the energy of a particle reaches a predefined threshold, it spawns children (visible at the end). There are some other forces at play as well in order to get just the right result, but this is the gist.

JSX Scripting with Creative Suite Extensions: In Practice

Posted 2 weeks ago

JSX scripting makes controlling Adobe Creative Suite from an extension you’re developing a breeze. Scripting opens up the realm of creating guides, selecting tools, creating layers, running filters, and so on. To get you started, Adobe Extension Builder creates a basic *.jsx file with a sample function in every new project:

function jsxFunction() {
   // ... your code goes here ...
   return '<object><property id="success"><true /></property></object>';
}

To call that function from AS3, it’s easy:

var result:SyncResult = CSXSInterface.instance.evalScript('jsxFunction');

The Workflow

First, install the Scripting Listener plugin. With it installed, whenever you do something in Photoshop/Illustrator/etc, it will write the code needed to perform those steps to ScriptingListenerJS.log on your desktop. Copy the parts you need from there and put them in your *.jsx file, wrapped in a function. Then just call evalScript() with the function name, and you’re good!

Function Arguments

Sometimes you might need to pass a value to a JSX function from AS3—maybe it’s a coordinate, maybe it’s the path of a file, maybe it’s a color. Arguments is where life gets janky. In CS4 products, Continue reading

File.downloadsDirectory in AIR

Posted 2 weeks ago

Adobe AIR provides great references to common locations on a user’s computer that map to the right place depending on the operating system.

  • File.userDirectory — User’s home directory.
  • File.desktopDirectory — User’s desktop.
  • File.documentsDirectory — User’s documents.
  • File.applicationDirectory — AIR application directory.
  • File.applicationStorageDirectory — AIR application settings directory.

It’s missing one, however: File.downloadsDirectory. Here’s what would work:

/**
 * File.downloadsDirectory
 *
 * Returns the appropriate location to place downloaded files.
 * (falls back to the Desktop)
 */ 
public function get downloadsDirectory():File {
   var downloadsDirectory:File;
 
   downloadsDirectory = File.userDirectory.resolvePath('Downloads');
   if (downloadsDirectory.isDirectory) return downloadsDirectory;
 
   downloadsDirectory = File.documentsDirectory.resolvePath('Downloads');
   if (downloadsDirectory.isDirectory) return downloadsDirectory;
 
   return File.desktopDirectory;
}

Actually-Native Alerts in AIR

Posted 1 month ago

A few libraries (as3nativealertlib and AirAlert) claim to provide native alert dialogs to Flex/AIR—but each one emulates the UI, which isn’t quite ideal.

A workaround is to use the HTMLLoader class to get totally-native modal alerts laid out by the OS. This works by leveraging Flex/AIR’s integration of Webkit into the runtime. Calling the alert method of the window triggers an alert just as a web browser would.

var htmlInterface:HTMLLoader;
function alert(message:String):void {
   if (!htmlInterface) {
      htmlInterface = new HTMLLoader();
      htmlInterface.loadString('<html><head></head><body></body></html>');
   }
   try { htmlInterface.window.alert(message); }
   catch (e:Error) {}
}

Not exactly the cleanest of solutions… but it works! The only downside is the inability to set the title of the dialog.

2012 Resolution

Posted 1 month ago

After digging through old designs & projects and saying “holy crap, I had totally forgotten about” out loud more than once (even on things I had put 100+ hours into), I have decided to start writing again and keep a thorough log of problems, projects, and ideas that pop up. Writing has always helped defrag’ my head, so I’m going to do it. I have a feeling this was a past new years resolution of mine… but maybe I’ll stick to it this time? We’ll see.

Twitter / Tumblr / Path / Facebook haven’t been cutting it for me. What’s posted there has little value… if those services vanish, not much will be lost other than a window into the scatterbrain—which can be fun, but I need a little balance.

Copyright © 2012 – Brian Reavis. All rights reserved. The views expressed here are my own and do not necessarily reflect the views of COLOURlovers / Creative Market.

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.