Fourier Transform
Posted by Fabricio in Actionscript, Misc on April 5th, 2010
Recently I had to do some research on the Fourier Transform, a calculus technique which allows one to manipulate frequencies from a signal wave.
I could spend hours studying and discussing the Transform, but I just wanted to post a technical link from MathWorks.
They are the manufacturer of MATLAB, a powerful software for spectrum analysis which I used 6 years ago in school.
It is also widely used in all sorts of engineering, image processing, intensive computational tasks and so on.
More info : MatLab
In my case I have wave signal being the input and I want to sample data from the frequency spectrum.
The problem is that using a Discrete Fourier Transform, processing goes up to the ceiling.
The solution is to use a Fast Fourier Transform that makes a distinction between the window length and the transform length.
That decreases the computational complexity from O(n2) to O(n log n).
Let’s see if that helps me in my project.
I’ll make updates to this post.
Meanwhile, take a read:
Fast Fourier Transform
DUI – Drawing under the influence
Posted by Fabricio in Actionscript, Design, Interactive, Xperiments / Tuts on April 4th, 2010
In this little experiment I tried to change usual mouse interaction to something similar to a staggery or frantic effect.
It all depends on the type of effect chosen. Options given are related to known drug effects.
In fact, I wish there was a different kind of way to interact with our precious machines.
I’ve seen stuff around and it may be bound to happen soon.
See it live:
Download source and doc:
AS cue points and custom events – SunLife video website
Posted by Fabricio in Actionscript, Xperiments / Tuts on April 4th, 2010
I recently worked on a website that contains a “talking” video along six different sections, each with its own video.
The challenge was to create a custom event class to assign and handle actionscript cue points.
One other aspect worth pointing out was the loader, which needed to be a circular mask that reveals
the layer below in a “clock wipe” or “pie chart” type of transition.
As easy as it may sound, drawing such shape, or actually making the animation, needed some attention.
After some research, I figured that you actually need to to draw a segment from the center out.
The next segment will be adjacent to the previous one but slightly offset within a circle.
This example uses a percentage variable in an ENTER_FRAME event, but it can be used upon a PROGRESS_EVENT of some sort:
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
br>
Source:
br>
br>
package src{
import flash.display.*;
import flash.events.*;
public class CircleLoader extends MovieClip{
private var circleLoader:MovieClip;
private var percentage:Number = 0;
public function CircleLoader() : void{
trace("//---> CircleLoader");
circleLoader = new MovieClip();
addEventListener(Event.ADDED_TO_STAGE, init);
};
private function init(event:Event) : void{
removeEventListener(Event.ADDED_TO_STAGE, init);
addChild(circleLoader);
circleLoader.radius = 80;
addEventListener(Event.ENTER_FRAME, circleEnterFrame);
};
public function circleEnterFrame(event:Event) : void{
percentage = (percentage + 1);
MovieClip(this.parent).tLoader.text = String(percentage.toFixed(0));
if (percentage > 100){
//removeEventListener(Event.ENTER_FRAME, doMask);
percentage = 0;
}
var endAngle:Number;
var startAngle:Number;
if (!isNaN(percentage)){
graphics.clear();
endAngle = 2 * Math.PI * percentage / 100;
startAngle = 0;
if (endAngle != startAngle){
graphics.lineStyle(2, 0, 0.5);
graphics.beginFill(0x003299, 0.5);
graphics.lineTo(-circleLoader.radius, 0);
CircleSegmentTo(0, 0, startAngle, endAngle, -circleLoader.radius, 1);
graphics.lineTo(0, 0);
graphics.endFill();
}
}
};
public function CircleSegmentTo(x, y, a1, a2, r, dir) : MovieClip{
var diff = Math.abs(a2 - a1);
var divs = Math.floor(diff / (Math.PI / 4)) + 1;
var span = dir * diff / (2 * divs);
var rc = r / Math.cos(span);
graphics.moveTo(x + Math.cos(a1) * r,y + Math.sin(a1) * r);
for (var e = 0; e < divs; ++e){
a2 = a1 + span;
a1 = a2 + span;
graphics.curveTo(x + Math.cos(a2) * rc,
y + Math.sin(a2) * rc,
x + Math.cos(a1) * r,
y + Math.sin(a1) * r);
}
return this;
};
};//end class
};//end package
So, for the actionscript cue point event I created a class named “CueEvent.as” which holds a string as a parameter to differ from other objects of the same class.
From up-down understanding of the hierarchy, my Main class instantiates a FLVPlayer class and adds a listener of type “VIDEOCUE” (public property in my CueEvent class):
Main.as:
public var mVideo:FLVPlayer;
mVideo.addEventListener("VIDEOCUE", cuePointHandler);
private function cuePointHandler(event:CueEvent) : void{
var e:* = event;
trace(" Cue point is: " + e.option);
if (e.option == "innovative"){ }
};
The FLVPlayer class contains a FLVPlayback instance to load up and play the video.
All that needs to be done is add a listener and the cue points to the FLVPlayback instance:
1. Add the built-in MetadataEvent.CUE_POINT
2. Add each cue point event using the addASCuePoint method passing two parameters (time, name)
3. In the callback function for the listener dispatch the custom event rather than a simple Event object:
We need the name assigned to the FLVPlayback instance in the Main class (cuePointHandler of the Main class) in order to make decisions for each cue point.
FLVPlayer.as:
public var mVideo:FLVPlayback;
mVideo.addASCuePoint(10.36, "innovative");
mVideo.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);
private function cuePointHandler(event:MetadataEvent) : void{
dispatchEvent(new CueEvent(CueEvent.VIDEOCUE, String(event.info.name)));
};
Finally, the custom event class has two important properties.
One string to be the type of event (VIDEOCUE) and another one to hold the name of the cue point.
CueEvent.as:
package src{
import flash.events.*;
public class CueEvent extends Event{
private var _option:String = "none";
public static const VIDEOCUE:String = "VIDEOCUE";
public function CueEvent(param1:String, param2:String) : void{
super(param1, true);
_option = param2;
return;
};
public function get option() : String{
return _option;
};
override public function clone() : Event{
return new CueEvent(type, _option);
};
};//end class
};//end package
Remember, CueEvent is a public class that extends the Event class used in the FLVPlayer class without being a instance variable inside of FLVPlayer.as.
We simply dispatch the event: dispatchEvent(new CueEvent(CueEvent.VIDEOCUE, String(event.info.name)));
The Main class instantiates the FLVPlayer class in a variable. That’s how it is structured.
When running the file, your player should start and when the playhead reaches the exact time you assigned
in the addASCuePoint method you will have an event triggered in your Main class with the name of your cue point event.
All this helped me understand better the way custom events work and on top of that,
I associated actionscript cue points for FLV playback passed up to your the level.
For each cue point added I receive its name and decide on which graphics to instantiate and animate.
For the Intro video I added these cue points:
mVideo.addASCuePoint(10.36, “innovative”);
mVideo.addASCuePoint(11.75, “tools”);
mVideo.addASCuePoint(13.13, “support”);
mVideo.addASCuePoint(22.68, “board”);
mVideo.addASCuePoint(24.41, “moveboard”);
mVideo.addASCuePoint(27.84, “dynamic”);
mVideo.addASCuePoint(29.53, “easy”);
mVideo.addASCuePoint(31.12, “innovativetech”);
mVideo.addASCuePoint(32.84, “intuitive”);
mVideo.addASCuePoint(34.51, “advisor”);
mVideo.addASCuePoint(36.02, “compensation”);
mVideo.addASCuePoint(44.34, “switch”);
mVideo.addASCuePoint(46.06, “pull”);
mVideo.addASCuePoint(47.51, “servicesolutions”);
mVideo.addASCuePoint(49.01, “productssolutions”);
mVideo.addASCuePoint(50.75, “insightsolutions”);
mVideo.addASCuePoint(52.16, “websolutions”);
mVideo.addASCuePoint(53.82, “compensationsolutions”);
mVideo.addASCuePoint(69.87, “out”);
mVideo.addASCuePoint(73.31, “discover”);
mVideo.addASCuePoint(75.91, “end”);
You can view the project running on my server.
Sunlife Solutions
Art from code
A nice collection demonstrating that programmers are also creative.
To me there isn’t much difference when it comes to conceptualization.
In the Digital Era, tools have changed, the media evolves and the results still remain as an output of ideas and concepts.
Whether you are a sculptor, designer, writer or simply interested in new media, you can accomplish similar results.
Those that immerse themselves in the coding oracle are know to be the future builders of our world.
The power of code and math is yet to be better understood and applied in different ways, but it drives me further to
be part of it and little by little more fascinated.
School of Animation, Arts and Design PV3D sphere
Posted by Fabricio in Actionscript, Art, Design on April 5th, 2010
We recently worked on a template website for the Sheridan School of Animation, Arts and Design.
It took a lot of effort to understand how to make the mouse move a sphere and still be able to get the mouse location on a click.
Clicking on a picture brings it to the front and so on.
It is still buggy, but I will eventually upload a fixed version.
The problem is that the school has not decided if they want to continue on the project,
and for that reason and other projects I have to work on, Kevin and I haven’t been able to finish it.
Check it out:
SAAD sphere
[ Portfolio projects remaining list ]
Posted by Fabricio in Actionscript, Design, Interactive on April 4th, 2010
This list contains previous projects I worked on and were not included in my portfolio featured list.
Each project contains a link, a thumbnail and a larger image of one page.
Enjoy it!
O’Pub
O’Pub Augmented Reality
O’Pub
![]()

DeepCover
DeepCover is an image game. The challenge here was to serialize/parse bytearrays to a bitmapdata object and save the picture locally.
![]()

SociedadeDDP
SociedadeDDP is a multidisciplineray communication agency.
It aims non-traditional advertising through resource optimization and efficient communication.
Visual identity for each section of the site.
![]()

Ao Vivo
Light, camera, action!
Release of a 15 min. movie about a girl’s delirium to become famous.
Object of movie production debates and summits.
World-wide nominee for film festivals.
![]()

Feelmes
A growing film production company.
Website displays their reel and the logo.
Feel me.
![]()

Relax Medic
Relax Medic is a dealer of products designed for relaxation purposes.
Quality of life matters the most.
Dynamic integration with the product database and all effects for each section made me wanna work using one of their chairs!
![]()

Mater
Mater is a reproductive medicine center with facilities in different countries.
They are specialized in human offspring fertility and all treatment options.
Two leveled navigation system to exposure all content, from staff to treatments and articles.
![]()

Claus Lehmann
Photographer portfolio.
Showcase for his selected pieces along with roll over effects and bitmapdata manipulation.
![]()

The Globe and Mail banner
RSS feed banner for the auto section.
![]()

Autohound banner
AutoHound.ca features used cars and trucks for sale in Canada.
Interactive banner for MSN Auto portal.
![]()

SoftFluid
High-tech infra-strucure company.
Networking services including design, installation & maintenance for professional environments.
Fancy robotic effects implemented to display the necessary information for any client of theirs.
![]()

Soberan
Agricultural and rural product manufactered by Bayer.
Bayer’s intranet showcase for this product, the project involved animations, charts and xml navigation to ensure the success and popularity of the project.
![]()

Medco
Number one pharmacy benefit management company in the US.
Worked with the IBM B2C team implementing new requirements and maintanance.
From the jsp client side to the Broadvision framework and C++ components.
![]()

Sotheby’s eGallery
Sotheby’s International Realty Canada is a premier full-service luxury real estate portfolio management brokerage with an experienced team of real estate sales and marketing professionals that provide marketing and sales services.
Worked with the server side team to integrate data for a slideshow displayed in a plasma TV in all SIR offices around the world.
![]()

Sotheby’s
Sotheby’s International Realty is a premier full-service luxury real estate portfolio management brokerage with an experienced team of real estate sales and marketing professionals that provide marketing and sales services.
One year project for IBM.
Web designed new pages and the map application.
![]()

Useful Photoshop image enhancing tuts
Posted by Fabricio in Art, Design, Xperiments / Tuts on April 5th, 2010
Once in a while you need to enhance a photograph, but you don’t work with Photoshop 24/7.
You take photography as a hobby or for use in your work as a web developer, a list of tutorials
form beginner to advanced becomes very handy, not only to get the results but also, to understand better
involved techniques.
Singing Tree
Posted by Fabricio in Art, Design, Interactive, Music on December 9th, 2009
Cerrado (central regionof Brazil) is the perfect place for such installation!
Ferrofluid Art
Posted by Fabricio in Art, Design, Interactive, Music on December 9th, 2009
Ferrofluid is a liquid which becomes strongly polarised in the presence of a magnetic field.
Sachiko Kodama is a japanese fellow known for his art assembling towers with such fluid.
Ypu can find out more on his website: http://www.kodama.hc.uec.ac.jp/spiral/