Archive for September, 2005

WAY OT: Make Yoda out of origami you can. Try not, do or do not. There is no try.

Friday, September 30th, 2005

I found this link today and given that it is Friday I thought I’d share it. This is awesome.
http://www.pajarita.org/aep/internacionales/intern2-1.pdf

[Link from minime283 at digg.com]

PixelStyles – Macromedia Approved Extension and Now Available in MXP

Friday, September 30th, 2005

I’m excited to say that my pixelStyles extension submission to the Macromedia Exchange was approved. I submitted it for Macromedia Approval instead of a basic submission. They bang on it a lot and put it to a high standards QA/testing phase in addition to the basic submission criteria. It is now available for download via the exchange by clicking here. If you want to read more about how pixelStyles allows you to save, share and apply dynamic styles in the Flash 8 IDE, click here. While you are in the exchange why not give me a good rating if you like it?!

One thing I should mention. The Macromedia Exchange does not appear to have a way to upload and signify that your extension is for Flash 8. Thus my extension is listed as MX 2004 Professional. It will NOT work obviously in Flash 7 but since MM hasn’t updated the Exchange yet I sent it as such. Thanks.

Hope you like.
-Sarge

My Bitmap Reflection Class for Download

Monday, September 26th, 2005

I took the time to write my “Reflection” class into a true AS2 class so that I could share it and use it easily when I needed to. The following AS2 code should be saved into an .as file called Reflect. You can then use the class by instantiating the class like:

reflect = new Reflect(my_mc,50,255);

The arguments are the (movieClip,the _alpha of the reflection, and the ration of the fade 0-255)

Here is the class (watch for line wraps that may happen in your web browser):

import flash.display.BitmapData;

class Reflect{
//Ben Pritchard 2005
//Pixelfumes.com
private var mcBMP:BitmapData;
private var reflectionBMP:BitmapData;

function Reflect(mc:MovieClip,alpha:Number,ratio:Number){
//create a bmp obj out of it
mcBMP = new BitmapData(mc._width, mc._height, false, 0×00FFFFFF);
mcBMP.draw(mc);
mc.createEmptyMovieClip(“origItem_mc”,mc.getNextHighestDepth());
mc.origItem_mc.attachBitmap(mcBMP, 1);

reflectionBMP = new BitmapData(mc._width, mc._height, false, 0×00FFFFFF);
reflectionBMP.draw(mc);
mc.createEmptyMovieClip(“reflection_mc”,mc.getNextHighestDepth());
mc.reflection_mc.attachBitmap(mcBMP, 1);
mc.reflection_mc._yscale = -100;
mc.reflection_mc._y = mc._height;

//create the gradient mask
mc.createEmptyMovieClip(“gradientMask_mc”, mc.getNextHighestDepth());
var fillType:String = “linear”;
var colors:Array = [0xFFFFFF, 0xFFFFFF];
var alphas:Array = [alpha, 0];
var ratios:Array = [0, ratio];
var matrix = {matrixType:”box”, x:0, y:0, w:mc._width, h:mc._height/4, r:(90/180)*Math.PI};
var spreadMethod:String = “pad”;

mc.gradientMask_mc.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
mc.gradientMask_mc.moveTo(0, 0);
mc.gradientMask_mc.lineTo(0, mc._height/2);
mc.gradientMask_mc.lineTo(mc._width, mc._height/2);
mc.gradientMask_mc.lineTo(mc._width, 0);
mc.gradientMask_mc.lineTo(0, 0);
mc.gradientMask_mc.endFill();
mc.gradientMask_mc._y = mc._height/2;
mc.reflection_mc.cacheAsBitmap = true;
mc.gradientMask_mc.cacheAsBitmap = true;
mc.reflection_mc.setMask(mc.gradientMask_mc);
}
}

The class does not support embedded FLVs or anything nutty (in-clip animation) though the wrapping clip can be animated a bit. This is because it is being cached as a Bitmap and is a static “snapshot” of the clip. It is handy for image galleries, etc. Hope you like. Let me know. I love feedback.

DHTML Clone of Flash 8 BitmapData Image Reflection Example

Thursday, September 22nd, 2005

So I was working with some AJAX yesterday and eventually stubmled onto the Internet Explorer filters that I had worked with long ago. I ditched the AJAX and I actually figured out a way to nearly perfectly duplicate my Flash 8 Bitmap duplication, reflection and blur all using DHTML. I wasn’t sure it was possible… Well it is (for IE users). I am a 100% supporter of FireFox and use little else. But for demonstration purposes I am going to ask all you loyal FireFox users to commit a sin and visit this page with IE 5+ to check the demo out. You will see it works the same as the flash version. Hope you enjoy! Click here to load the demo.

Flash 8 BitmapData Image Reflection Example

Tuesday, September 20th, 2005

I thought I’d post a little experiment that I did using the BitmapData class in Flash 8. It loads an external leaves image and then creates a bitmap out of it on the fly. It then takes the bitmap and clones it, flips it and then applies an alpha gradient mask to it on the fly. You can see by changing the blur amount and alpha that the effect is completely dynamic and does not require the loading of the leaves image twice since the actual pixels have been duplicated. I saw this nice little design style over at Microsoft so I thought I’d rip it off for my example. Hope you like. If you want the source file here it is.

PixelStyles – Share, Edit, Apply Dynamic Styles for MovieClips and Text in Flash 8

Monday, September 19th, 2005

Recently I shared an FLA that had some movie clips with “styles” attached to them. I love the potential that this give to Flashers. You can have some insane effects with little to NO increase in file size.

Currently you can choose the filters tab in the property panel to look at filters on a movie clip. You can then apply filters and save them as a preset for later use. I wanted to take that a step further so I created a Flash extension panel that I call pixelStyles. Using pixelStyles you can actually copy styles on movie clips, add styles, edit them, duplicate them, export them to share with friends, import your own from another computer, etc… I think there is a lot of power in this extension. I tried to ensure it was a tight and shouldn’t error out on you or anything. Below you will see a list of the features.

Import/Export:


Import and export your styles. Styles are custom JSFL files generated on the fly by the panel. You can easily add and share your styles.

Apply Styles:


You can easily apply styles to any movie clip or text field you have created. Simply select your object and select a style in the style list. Now hit the Apply Style button and that’s it! Removing styles is just as easy. Just select a movie clip or text with a filter applied, select None from the style list and hit Apply Style.

Delete Styles:


If you make a mistake or want to clean up the style library you can do so using the delete feature.

Update Styles:


Let’s say you have a style applied to a movie clip. You make a tweak and love the new effect. You want to save a revision to the current style. Instead of creating a whole new style you can save over the current style thus updating it permanently to contain the new effect.

Duplicate Style:


What? You don’t want to overwrite your style? Well then you can just duplicate the currently selected style in the list!

Save Selected Style:


This is probably the most important feature. You don’t want to be writing custom JSFL files every time you want to save a new custom style. You simply select the movie clip you have applied your filters to, type a name for your filter in the pixelStyles panel and press the Save Selected Style button. This will generate the JSFL style file for you on the fly and add it to your library!

Once installed you can access the panel by going to:
Go to Windows > Other Panels > pixelStyle panel

If anyone likes this please let me know. I put a lot of work into it. If you create some cool styles please share them! I will feature them here on the site. Feedback much appreciated. Please feel free to share this panel as well.

I don’t currently have an MXP written so you have to do a little work but it’s not bad. In the zip there is a readme file. It tells you where to dump everything to. This release is PC only and Flash 8 of course.

DOWNLOAD IT (Right-click and choose Save Target)

Photoshop-like "Styles" in Flash 8

Thursday, September 15th, 2005

One of my favorite new features is the ability to add filters to movie clips in Flash 8. What you may not have noticed is that you can apply multiple variances of the same filter to a movie clip and then save it as a preset. What you can end up with is something very similar to the “styles” you can use in Photoshop. I use styles all the time to get quick effects when designing. I have posted an FLA with two of my quickly created styles. Metal Frame and PurpleBlue Gloss. If you crack the FLA open and look at the filters attached to the movie clips you can see how they were created. Below you will see the Metal Frame, PurpleBlue Gloss and original movie clip.

I would love to see some sites popup that provide “Flash Styles”. Anyone else wanna take a stab and share? I think it would be sweet to write a converter using the Photoshop Javascript API or something that would pop-out Photoshop styles to Flash Format (In ActionScript of course – since all the filters are possible at run-time as well as author-time).

Let me know what you think.

Flash 8 – Dragging is Good

Wednesday, September 14th, 2005

Sam Robbins at pixelconsumption mentioned that you can now drag components directly from the components panel into the library. Very handy! No more dragging to the stage and deleting to keep it in the library.

I also noticed that another difference from Flash 7 is that you can click on the tab of an open document (FLA or AS) and drag to swap the order they display in the IDE. I figure most people know you can also tab through them with Cntrl + Tab but that started in Flash 7.

If anyone else has little “nice to have added” features they wanna share lemme know! I’d love to hear about them!

Flash 8 Filter Gotcha on ComboBox

Wednesday, September 14th, 2005

Just thought I’d mention a little issue I found with the Blur filter on a combobox. If you drag a combobox component to your stage and delete it (let it in the library) and then add the following code to the stage, publish the movie and now open the combobox and try to scroll the list. Not sure if this will creep up anywhere else but thought I’d share.

import flash.filters.BlurFilter;

this.createClassObject(mx.controls.ComboBox, “my_cb”, this.getNextHighestDepth());
var product_array:Array = new Array(“Studio”, “Dreamweaver”, “Flash”, “ColdFusion”, “Contribute”, “Breeze”, “Director”, “Flex”);
my_cb.dataProvider = product_array;
my_cb.setSize(140, 22);

// Define a new array for the filters.
var filtersArr:Array = new Array();
var blur:BlurFilter = new BlurFilter(0, 5);
filtersArr.push(blur);
my_cb.dropdown.filters = filtersArr;

The result follows:

The Google Talk Bandwagon – I Jumped On

Wednesday, September 14th, 2005

Ok – so I jumped on the bandwagon the day it came out… I notice some of the fellow blogging Flashers out there published their user emails so people could add them to their list. I figured I’d do the same. If you ever visit my blog and want to add me onto your list you can do so by using this email: sgtpritchard at gmail dot com (written like that to attempt bots from spamming me). Oh yea – did anyone tell you Flash 8 is out?