Sunday, November 30, 2008

Embedding pictures in flashmovies using FlashDevelop

Embedding resources such as pictures,sounds & even other swf files was one of the first issues when I started looking into writing actionscript 3 using Flexbuilder (and now later FlashDevelop) having no previous flash experience it was a shot in the dark, but luck behold, embedding resources in actionscript 3 is just as easy as scratching your bum :)

have a look at the following code:

package
{
import flash.display.Bitmap;
import flash.display.Sprite;
/**
* ...
* @author Kenneth Christensen
*/
[SWF(width = '640', height = '480', backgroundColor = '#ffffff', framerate = '25')]
public class Main extends Sprite
{
[Embed(source = "..\\picture.png")]
private var pictureclass:Class;

public function Main():void
{
// lets declare a new bitmap based in the pictureclass above
var mypicture:Bitmap = new pictureclass();

// add it to the current stage.
this.addChild(mypicture);

// that's it really .. pretty easy no ? ;)
}
}
}


Pretty easy stuff eh ? the metadata statements in the Actionscript 3 really makes it easy for an old developer like me.

Regarding the use of FlashDevelop, a HUGE thanks flies out to Laurence Muller for posting his quickguide on developing flash 10 with debugger in FlashDevelop




I'm currently reading up on the Flash 10 3d features, and hopefully doing this week i'll be posting a few examples..




..Kenneth Christensen

Saturday, November 29, 2008

what a timeout....

Sorry guys.. this sort of thing seems to happen EVERY time I promise something..

long story short.. I quit my old job after almost 10 years (and being part owner of the company) .. and that caused "a bit of a stir" for reasons that in not going to mention here...

but, bottomline is, I'm now in a much more relaxed job which allows me to only work the allotted 37hours/week instead of doing +50 ..


future of this blog ? hopefully a lot more updates, with a few more complete projects. And also i've started using the FlashDevelop instead of FlexBuilder (was company license) so in the near future I'll make a tutorial of how to write towards Flash 10 in the FlashDevelop (so easy :))

...K Christensen