contact

Archive for November, 2008

Actionscript 3 3D with Flash CS4

Wednesday, November 26th, 2008

I finally got a copy of adobe flash cs4. In addition to the great new user interface flash cs4 can compile flashplayer 10 content which enables the new actionscript 3 3D methods. with only the three simply rotationX, rotationY and rotationZ properties one can quickly create really nice 3D animations. This is my first test.

here are the few lines of code it took to make this thing spin:

</pre>
import flash.display.*
 import flash.geom.*
 import flash.events.*
 import flash.display.*
 var panes:MovieClip=new MovieClip()
 panes.x=300
 panes.y=200

for(var i:Number=0;i<18;i++){
 var pane:MovieClip=new MovieClip()
 pane.graphics.lineStyle(1,0xffffff,0.5)
 pane.graphics.beginFill(0x003366,0.3)
 pane.graphics.drawRect(0,0,100,100)

pane.x=0
 pane.y=-50

pane.rotationY=i*20
 pane.moving=false
 panes.addChild(pane)

}

addChild(panes)
 panes.rotationZ=90
 panes.cacheAsBitmap=true
 panes.addEventListener(Event.ENTER_FRAME,movePanes)

function movePanes(e:Event){
 panes.rotationX+=5
 }
<pre>

Jquery documentation PDF version

Wednesday, November 19th, 2008

The Jquery documentation is nice but only works online. I found a guy who put the entire documentation into a nice downloadable pdf.

jquery documentation

jquery documentation

You can download the latest version for jquery 1.2.6 here –>

http://www.nabble.com/jQuery-Documentation-in-PDF-td20088645s27240.html

wacom bamboo fun, OS X leopard and Adobe CS3

Sunday, November 16th, 2008

for my birthday I got a wacom bamboo fun via amazon. I use it with my macbook Pro running leapord OS X.

Unpacking:

wacom unpacking close

wacom unpacking close

wacom unpacking

wacom unpacking

Installation:

wacom Installation

wacom Installation

the installation is really easy. the product comes with 4 separate CDs so you get to choose how much of the bundled software you install. I only went for the drivers and the artRage software since I am not interested in the handwriting recognition part.

Set Up:

wacom settings

wacom settings

The Installation adds a preferences pane to your mac os X settings where everything can be configured.

Usability:

It takes some time to get used to the pen, but after a day or two you will not have any problems. I got the small tablet which is sufficient perfectly fine for my purposes.

ArtRage:

this software is very nice for practicing and goofing around with your tablet. it offers a lot of functionality and was made to be used with a tablet.

artrage 2.5

artrage 2.5

Adobe CS3

The main reason to wish for a wacom tablet was, that is works really well with adobe CS3 suite. I work a lot with flash, and I really like flashs drawing capabilities. I also tested photoshop, and it worked really well.

Verdict:

I used the tablet for just a few days now and I just love it. I recommend it any Mac user.

Update – Adobe CS 4 support:

I recently upgraded from Adobe CS 3 to Adobe CS 4 and it works just as fine. After using the tablet for a couple of months now I still hold up my recommendation!

calculating the number of days between two dates

Sunday, November 9th, 2008

for a recent project I had to figure out how many days are between a given start and end date. My first very poor attempt was to split the dates and then get the monthes and then add up the days for each month. Very poor on performance.

The easy solution:

most modern programming languages offer Dates Objects that can handle timestamps, which makes our calculation very easy.

(Timestamp(endDate)-TimeStamp(startDate)) / 3600 / 24 = days

this will compute the amount of seconds between the start and end date, then divide by 3600 gives you get hours, divide by 24 and you have the number of days. This is especially nice since it automatically considers 29th of february.

note: if you use actionscript you have to again divide by 1000 since its timestamps are in milli seconds.

actionscript 3 screenshot

actionscript 3 screenshot