Saturday, April 26, 2008

[Experiment] Sticky Particles /w Source


Sticky Particle
Originally inspired by yugop on his creation @ amaztype. But that was years ago before BitmapData is even out. That really made me wonder what kind of algorithm he thought of to make this work. A pure genius.

Source file is in Adobe Flash CS3 Format, commented and available for download at :
[ Download FLA ]

Demo is viewable at :
[ View SWF ]

Wednesday, April 23, 2008

[Tips] Using Tweener

I hope you are still having a good weekend through this week. And if you remember a few post back then regarding the usage of Tweener, it has became an essential tool for me, if not, a neccessity for me in building a Flash project, faster and more efficient.

Like the good ol’ MC TWEEN, a spiritual succesor towards Tweener, you can download the free class files at http://code.google.com/p/tweener/

In this post I will go through a sweet short usage introduction that is enough to entice you to try more. Compared to MC TWEEN, in which you will have always declare :

#include mc_tween.as;

...at the start of every flash file, contrary to Tweener, you have to only do this, just like importing class for BitmapData or BlurFilter. Like :

import caurina.transitions.*;

But how do you use it? Unlike, MC TWEEN that only requires installation through a MXP package (double click and install through Macromedia extension), you need to place the classes in a correct folder. I will share with you on how to prepare your Flash to use Tweener.



Step 1 : Go to Tweener website at http://code.google.com/p/tweener/


Step 2 : Click on Downloads, or alternatively, you can download directly from the Featured Downloads link at the right of the page.

Step 3 : Select the Class file that best suite your preference, I will choose AS2 at the moment, it shouldn’t differ too much with AS3.

Step 4 : Once the link is clicked, the download will proceed immediately. Unzip the folder to your Desktop/Finder after download is completed.


Step 5 : This step here is purely optional, but I practice this because it really help to boost up my productivity and organize my Flash Files altogether. Adapted from Lee Brimelow’s tutorial, I will usually have a “Flash” folder on my Desktop that stores all my external Classes (Papervision, etc etc) and my experimentats. In this case, I will put the extracted caurina folder into Classes for all my AS2 files, this applies to any classes that is for AS3. Reason? It is best to have a separate Class folder for both AS version to avoid mixup and overwriting.

Step 6 : Now we will go into Flash and add our own Class Folder. Go to Preferences inside Flash (Ctrl + K for PC and CMD+K for Mac).

Step 6.2 : Select Actionscript from the left menu and Actionscript 2.0 Settings on the bottom right.


Step 6.3 : It will now pop a window for you to specify the location of the Class folder. Press on the plus (+) sign to add a new directory for this. And click on the Target button to find/browse the specified folder.

Step 6.4 : Select the correct folder which stores all of the external classes.

Step 7 : We will now proceed with our first experiment on using Tweener. It is really simple, which I will provide the example file on the end of this sharing. Create a new document with a movieclip that is named as “box” as its instance name. On the first frame and layer a/s, we will initilize the Flash file with importing the Tweener class.
By doing : import .caurina.transitions.*;
We will now try to move the box from the left side of the stage to the right end of the stage. Additionally, it will fade out after it reaches the right side. Awesome?

Step 8 : We will start with moving the box from left to right with the syntax as below :

Tweener.addTween
(box,{_x:400,time:1,transition:"easeIn"})

Test the movie and it should slide gracefully from the left side of the screen to the right. Okay now, you might think on what about making more crazy stuff? Before going into that detail, the code is compromise of the name of the movieclip you need to control, and inside the {} curly bracket, you will then need to specify what you want the movie clip to do. It’s that easy!

There are a lot of syntax that you can explore and refer from the online documentation at :
http://hosted.zeh.com.br/tweener/docs/en-us/
But the most common used by me are : _x, _y, _xscale, _yscale, _frame, _color, _alpha, _autoAlpha
And you might think what are those? _autoAlpha?! basically it’s some really cool predefined animations that set to tween your movieclip to alpha 0, and make it disappear (_visible = false) automatically!

Step 9 : Now for the magic, we will add another line as :

Tweener.addTween(box,{_alpha:0,delay:0,time:1,transition:"easeIn"})

Notice the delay there? It is the same amount of time (in second) as the first tweening, that means the second code of tweening will wait in line until the first one finishes in 1 second. Experiment around. You will be amazed.

Extra note : For starter or intermediate learner, you might be stunned with all these examples that you can find at http://tweener.googlecode.com/svn/trunk/examples/. Head on to gotoAndLearn() as well for those recent tutorials that made use of a lot Tweener.

[ Download Tutorial File ]

Wednesday, April 09, 2008

[Toy] YouBrowser - YouTube Visual Finder


YouBrowser - Look For Video (literally)

I had some chance earlier last year to play around with YouTube’s API and I’m looking forward to improve this toy. Basically when we want to find something, etc “look” we really want to look around. So I hope you will find this useful and have fun “looking” for top videos.

Do keep the comments and suggestions coming in to make this one a better one for all of us. Cheers!
If you like it, digg it or bookmark the url, will be permanent at : http://labs.oneduasan.com/YouTube.html

Update : Tips to share.
In regards if you are looking to do some dynamic user input/search through php-->flash. There’s some trick I found on the internet. I will probably share it in detail next time when I finalize the detail on YouBrowser search engine. But basically if you want it to work, you need to send a string to youtube on the ‘tag’ you want to search and parse it back as a xml document to you through php. And I realized it can’t be done directly through Flash, at least in AS2.0.



$devid = $_GET['func'];

$theURL = "http://www.youtube.com/api2_rest?method=youtube.videos.list_featured&dev_id=".$devid;

$contents =implode ("",file($theURL));

echo($contents);

?>


Note that the function that is helping this to work is the implode() function that feeds the data from the api into xml data and then send it back to Flash. Hope you will find this useful.

[Inspiration] Jonathan Harris


Telling Stories Using Data : Jonathan Harris

An exclusive interview with data virtualisation pioneer, Jonathan Harris. One of my big source of inspiration from his work is his habit in reusing existing material but to make it more visually appealing and effective in conveying communication. Talk about good design being made better.

Tuesday, April 08, 2008

[Tools] Tweener


http://code.google.com/p/tweener/
"...In layman's terms, Tweener helps you move things around on the screen using only code, instead of the timeline..."
"...Tweener is also the spiritual successor to MC Tween..."

Basically if you are familiar with the succesful MC TWEEN for ActionScript 2. You will find yourself blessed with this. Since there are quite a lot of aspect improved in terms of efficiency in implementing tweening. On the other hand, it will help for you to learn faster if you are also regularly learning from gotoAndLearn()

Friday, April 04, 2008

Random Bits of Sharing


ColorFlip

A rather simple and direct site. But it definitely does a good job in simulating a full page spread paper that you can tear. Much like a layout pad that concept/2D artist draws on. A canvas.


Shuffle

Knock your opponent’s ball, er... away. Pretty addictive if you ask me. But nevertheless it does reminds me of both snooker, billiard and dodgeball.


Real Time Raytracing in AS3.0
While announced a while ago, it seems that the Flash technology has reached another milestone in implementing 3D technology onto the web. Does it mean, in the future, we will see, RTS or FPS games inside your browser using Flash?


World Golf Tour : PGA Charity Challenge

This would definitely be one of the stunning 3D Flash game at the moment that I had seen. I’m still thinking that the gameplay or instruction could be further enhanced. Took me several minutes to figure out how to hit the golf ball.

Transitioning & Effects


Starbucks Coffee At Home
Sometimes, what really is impressive about a website is not how it is technologically
driven, but it is so beautiful beyond words that you are seamlessly feeling like you are watching an interactive video showcase in a website. This website doesn’t shout out loud on the crowd but it does all bit of details that makes this one a premium site to be inspired at. The details of video transition, rollover, sound effects. This all small elements makes up to a big outcome that will define if the site is worth of visit. And the concept are just fantastic, from the usual shop that we see, that uses chalk on the blackboard to promote the latest drink, this straightforward idea is then brought to the web, and it’s fresh once again! bravo.

Using Papervision 2.0


Papervision 3D Tutorial
gotoAndLearn() is an amazing resource for video tutorial from the basics to the intermediate level in Flash Actionscript programming. In my recent browse to the site, they have one really interesting tutorial on implementing a 3D cube navigation with papervision 3d. Check em out!


Dear readers,
I has been a mild long time since this has any updates. This time around I will look back into sharing interesting thing I have found over the years.

Salutes,
Mervin