Épisode Nelson – II

Re-bonjour tout le monde,

je vais reprendre ou j’ai laissé. Là je suis de retour au camping après 6 jours dans la grande maison (qui vaut 900,000$!!!). J’ai pris des photos du comptoir en marbre qui vient de Turkie, de la maison. Je vais les ajouter à la fin de ce mail. J’ai aussi réussi à prendre une photo superbe d’une fleur et une abeille, vous pouvez la voir ici: photo sur DeviantArt (cliquez sur la photo pour voir le grand format..). Continue reading

Épisode Nelson – I

Bonjour à tous,

bien que je ne suis plus en voyage outremer, les aventures se poursuivent! Alors je me suis dit que pourquoi pas… je pourrais bien partager ce dernier chapitre avec vous. J’en ai envie et puis je m’offre le temps. Alors voici:

Depuis dimanche soir je dors chez un inconnu. Je connais son nom: Marc. Il a hérité de beaucoup d’argent lors de la mort de ses parents; d’une maison d’une vingtaine de chambres, d’une foule d’antiquités. Son père était connu dans le monde de l’aviation; il a oeuvré dans l’armé et ensuite dans le privé. Il a acheté un manoir à Nelson à une minute du centre-ville; dans une côte. Le terrain doit faire 3 acres, dont 1.5 acres sont aménagés. Il est complêtement entouré d’arbres matures, et bien que le bruit nous rappele souvent qu’on est proche de la ville on se sent en campagne. La maison est de pierre, doit contenir une dizaine de pièces, de haut plafons, céramique, comptoirs en marbre (et quel beau marbre avec mille et un reflêts et des couleurs que j’avais jamais vu dans un comptoir en marbre auparavant). Bref je suis confortable, je dors dans une chambre au 3ième étage, de là je vois le lac Kootenay et j’apperçois quelques toîtures de magasins de la ville. Je dors jusqu’à .. 11h am. Et chaque matin je me surprends de dormir si tard; faut dire que j’ai toujours eu une tendance à être oiseau de nuit plutôt que matinal; je suppose que cela se perpétue.

Continue reading

Flash ActionScript brightenColor Function

I’ve been working hard on several projects lately; and have decided to post on here some of the useful functions i’ve developped. Starting with the simplest ones and eventually going into sharing full-blown components.

Today I wish to share a little function that either brightens or darkens a color value, such as 0×445566. Here is the code:

[code lang="actionscript"]

public static function brightenColor(color:Number, perc:Number):Number {
var factor:Number;

// get the blue offset
var blueOffset:Number = color % 256;

// get the green offset
var greenOffset:Number = ( color >> 8 ) % 256;

// get the red offset
var redOffset:Number = ( color >> 16 ) % 256;

// if percentage is greater than 50, we are making the color brighter
if(perc > 50 && perc <= 100) {

// calculate the factor by which we will make the color brighter
factor = ( ( perc-50 ) / 50 );

// apply this factor to all offsets
redOffset += ( 255 - redOffset ) * factor;
blueOffset += ( 255 - blueOffset ) * factor;
greenOffset += ( 255 - greenOffset ) * factor;

}
// else if the percentage is less than 50, we are making the color darker
else if( perc < 50 & perc >= 0 )
{
// calculate the factor by which we will make the color darker
factor = ( ( 50 - perc ) / 50 );

// apply the factor to all offsets
redOffset -= redOffset * factor;
blueOffset -= blueOffset * factor;
greenOffset -= greenOffset * factor;
}

// put all offsets back together to form the color value of 0xRRGGBB
return (redOffset<<16|greenOffset<<8|blueOffset);
}

[/code]

Basically, this function decomposes the color value into it’s individual components, that is the red, green and blue components. It then applies a factor to this component. If the ‘perc’ parameter is above 50, it will brighten the color, if the parameter is below 50, it will darken it. The minimum value should be 0, and maximum should be 100.

Enjoy!

ActionScript – Composing Images using BitmapData

In my current project I need to create a weird drop shadow effect, which is exactly like a checker board with black and transparent squares. I could do this using the drawing API but that would require quite a lot of drawing and a complex algorithm to manage different square sizes.

So I looked into doing it using the BitmapData Class, new to Flash 8. What I need to do is:

  • create a bitmapData array
  • understand how to compose colors in the 0xAARRGGBB format (32 bit color value)
  • fill it with my checker pattern
  • attach it to a movieclip instance

Continue reading

ActionScript Drawing Method – SquiglyLineTo

In a project I am currently working on I am required to draw squigly lines using the drawing API, as they are a basic part of most skins of the common controls (dialog box, buttons..). I used Ric Ewing’s dashTo method as a basis to build a function called SquiglyLineTo:

MovieClip.prototype.squiglyLineTo = function(startx, starty, endx, endy, len, width)
Continue reading

online dating

i subscribed to PlentyOfFish today; an online dating site which is entirely free. What can I say? Well, to start i want to travel around BC in a week or two and am looking for interesting people on the way who could show me around a bit, give me insider tips and share a moment with me. I think they’d appreciate my company, no matter who they are. I’m a nice guy ain’t I?

Continue reading

i dropped my motorcycle today

about 2-3 months ago I bought a Kawasaki 750 LTD 1986 (pics here). It was in Vernon, BC while I live in Golden, BC. I only had my learner licence and needed the motorcycle to pratice. Also since I live in a remote community we don’t get the opportunity to have tests taken very often. Once a month instructors come from other communities and offer the test and there is a waiting list. Continue reading

birth of spiders

today I witnessed an amazing event: the birth of spiders! With my new camera handy i took a few pictures, here you go!

The Spider Nest

Spider Nest

The spider nest illuminated using a mirror

naissance-araignés-lenid2.jpg

The Spider Nest II

Spider Nest

The spiders once I poked into the nest (hrmm..)

Baby Spiders

The spiders once I poked into the nest II

Baby spiders