Posted: September 30th, 2009 | Author: admin | Filed under: Uncategorized | 1 Comment »
I came across a really cool panel for flash CS4 IDE that lets you create SWFs with multiple fonts that you can access in run-time.
check it out:
http://blog.johannest.com/2009/09/28/runtime-font-publisher-a-flash-cs4-extension/
Posted: September 28th, 2009 | Author: admin | Filed under: Uncategorized | No Comments »
I was messing around with Kaleidoscopes last year, and refactored an AS2 kaleidoscope that Quasimondo posted in 2005. I was looking for that code, and found it laying around, so I thought I’d post it if anyone’s interested to see a way of doing it in AS3. Please note that if you want to use this for commercial use, you will need to contact Quasimondo because it’s based on his code. If you need more sources for Kaleidoscopes, you can check out the book ActionScript 3.0 Image Effects by Todd Yard (Friends Of Ed).

source
Posted: September 24th, 2009 | Author: admin | Filed under: papervision3D, tips and tricks | No Comments »
Quaternions sound really scary… and I admit, they are. I don’t pretend to even begin to understand the math behind it, but using Quaternions in your code will make transitions look much nicer! It is something really helpful if you’re moving your camera around in Papervision3D to match objects’ rotation.
here’s an example that shows the difference between normal approach and the quaternion one:

source
so — what are quaternions?? you can read about it in Wikipedia, but for our purposes, we’re using it to calculate the SHORTEST route to a certain rotation (on all axises). we basically take the beginning angle, end angle, assign a SLERP value (SLERP = spherical linear interpolation) and tween it!
It’s really not that much when it comes down to it. here’s what the code should look like:
private function calculateQuaternions() : void
{
camTarget.extra = {slerp:0};
startQuaternion = Quaternion.createFromMatrix(camTarget.transform);
endQuaternion = Quaternion.createFromMatrix(_selectedPlane.transform);
TweenMax.to(camTarget.extra, .5, {slerp:1, ease:Quad.easeInOut, onUpdate:slerpMe});
}
private function slerpMe():void
{
var quaternion:Quaternion = Quaternion.slerp(startQuaternion, endQuaternion, camTarget.extra.slerp);
camTarget.transform.copy3x3(quaternion.matrix);
}
SOMETHING TO LOOK OUT FOR — it you’re scaling the object you’re copying the transformation from the quaternion calculation will be incorrect.
There are other approaches to this, but I think it’s the simplest one. Here is a good post about using it for an object rather than the camera.
Posted: September 22nd, 2009 | Author: admin | Filed under: tips and tricks | No Comments »
The other day I played out with my band and wanted to have a cool visual projected behind us. I needed to get an adaptor for the projector, but found out that the new macBookPro’s miniDisplay connector only supported DVI or VGA converters (because the video card only supports digital output). The projector only had either composite or s-video inputs available, and a digital-to-analogue converter ran up a $100…. SO, I decided to try something I’ve heard of before — export actionscript code into an MOV file in order to burn a DVD from it. It turned out to be really REALLY simple!
Here’s an example of an export of Flint Pixel Particle System:

Here are the steps, just make sure you’re running CS3 or CS4 Flash IDE.:
1. go to file>export>Export Movie…

2. select QuickTime from the drop down and choose destination

3. Then you get a few settings. here’s a quick rundown:
Ignore Stage Color: check this if you want to have a transparent background. if you don’t check it, the SWF bg color will be used as the background. note that it will increase file size (use 32bit color values) — and also make sure to select quickTime settings that will match this selection.
Stop Exporting: if you are doing timeline animation, select the first bullet (When Last Frame Is Reached). If you are running a script, you need to specify the amount of timeyou want to render it for. be aware that the format is quite picky. if you want 30 seconds, you can simply type 30, but if you want a minute and a half, you can’t type in 90. You need to type 1:30. for an hour and 30 minutes (are you insane!?) you will need to type 1:30:00. there’s a millisecond option as well (30.5 is 30 seconds and a half).
Store Temp Data: Choose to either store temp data on memory (RAM) or HardDrive. If you just want to export 30 seconds or a couple minute, choose the memory option. I was exporting 50 minutes of animation, so I had to store temp data on my HD. Even if you use compression, it will first store the uncompressed data on your RAM or HD, and only after it is finished it will compress the file.

QuickTime Settings… : disable sound if you’re not using any. then, click the “settings…” button. for best results, I would recommend Animation Codec at BEST quality. if you chose the transparency option, select Millions Of Colors+, otherwise, just Million Of Colors. Quality — high or best. The dimensions by default match the flash stage settings, so I would recommend to match that to the final output source (720×480 for NTSC DV for example).

3. Click export and wait….
Posted: September 18th, 2009 | Author: admin | Filed under: tips and tricks | 3 Comments »
I was messing around with masks today trying to find a good solution for a fairly complicated masking job. I knew that BlendMode.ALPHA was capable of doing masks, with an advantage that it renders the mask with gradients. Now, I know there’s an easy trick for masking with gradient transparency — just cache both sprites as bitmap and create the mask. BUT, what if you have a more complex scene, that you don’t necessarily want to cache as bitmap (for performance reasons for instance), or what if you want to mask a few different sprites, and not just one? that’s where BlendMode.ALPHA comes in. Here are a couple advantages of using it:
1. BlendMode.ALPHA masks ALL layers under it (in a specified DisplayObjectContainer), so you can mask multiple object, and not just one (which is the limit with a normal mask)
2. You can create a mask of the INVERTED alpha channel, by using BlendMode.ERASE
3. Great at animating with gradient transparency
One thing to be aware of is that unlike a mask, parts of the object that are not defined (don’t have alpha values) won’t affect the image below, so your mask should match in size the objects your masking.
To apply this blendMode, you must first define the displayObjectContainer’s blendMode property as BlendMode.LAYER. here are the steps:
this.blendMode = BlendMode.LAYER;
_myMask.blendMode = BlendMode.ALPHA;
Posted: September 16th, 2009 | Author: admin | Filed under: Effects, Uncategorized | 1 Comment »
This is a simple class I created for some transition effect. It’s really simple, but the effect is cool.
I’m basically taking any displayObject and creating a grid of bitmap copies of it. then animating them with BetweenAS3 tween engine (if you haven’t heard of it, it’s worth checking out — really fast and clean engine from LibSpark). I’m planning on decoupling the animation from the grid creation, so you could create different animations with the segments (or tie them in with a particle system), so that might be coming soon.
To use it, all you need to do call it like this:
new ExplodeBitmap(sprHolder, explodingSpr, widthSegments, heightSegments, smoothing);
here’s what it looks like (with randomized segment width and height):

source
Posted: September 14th, 2009 | Author: admin | Filed under: papervision3D | 1 Comment »
I’ve been doing a lot of papervision3D lately. And though I really like using it, I think many sites over-use it, which results in a clunky user experience. Sometimes it’s more efficient (and easier) to use “fake” 3D techniques TOGETHER with PV3D (or any other 3D engine for that matter) to achieve certain effects. It can perform better, and create a more appealing look & feel. A good example for this is the site What’s The Real Cost — there’s a big 3D cube with some colorful dots flying around it. I think it’s a great example of how to use fake 3d with papervision3D to enhance the visuals.
To create a similar effect, all you need to do is have 3 layers of sprites, with the papervision3D layer in the middle. Create simple sine waves for the x,y positions and scale of dynamically created circles. to have the circles go in front and behind the cube, simply switch the parent of the circle according to a size threshold.
The result is pretty cool:

source