27 April 2011

FITC - Design and Technology Festival in Toronto

The place to be next week is Toronto, Canada. Why? Because that's the congregation point for one of the best Flash Platform conferences out there - The Design and Technology Festival, FITC.

Number of events and presentations is huge - over 80 of them. Some of the speakers are: Grant Skinner, Jasse Warden, Robert Peters, Lisa Larson-Kelley, Joshua Noble ...

In the meantime, those of us who can't attend are spending time on FITC Vimeo videos page.



*_*

22 April 2011

Happy 4th Blogoversary

Today is 4 years since I started this blog. That's just amazing. I'm one of those people who rarely finishes something I've started (don't judge me, pls) but this blog has survived for 4 long years and not only survived, but improved over the time, contribute some value to the Blogosphere (I hope) and will continue to do so.

Every time I neglect posting comments and feedback are bringing me back to find new stuff to blog about, so thank you for that. Thank you for subscribing to my RSS feed, all 250+ of you. This number is growing steadily over the time.

Social media networks also played large part in improving Flanture, first Twitter and from recently you can connect also via Facebook page which is still new but gives us new ways to discuss Flash and web.

It is always good advice to move your blog in direction your readers need it. Flanture asked and you answered. Here is Poll result from last month:



Thank you for your answers. I have no other option but to announce that Flanture will soon open its YouTube channel with Flash / ActionScript Tutorials!

Happy 4th Blogoversary !!!

*_*

15 April 2011

Average Flash Games Developer

MochiMedia has conducted survey of Flash games market for 2010. Let me present few key points about average Flash games developer for last year.

Our average Flash games developer is 'he' in 97% of the cases and only 3% is 'she'. He is around 24 years old and he is most likely from United States.

Average Flash games developer doesn't create Flash games full time, it's mostly a part time activity and he develops Flash games for 2 years using ActionScript 3.0 and during that time he has developed 3-4 full games. Each of those games got about 200.000 plays during its lifetime. He is most like working by himself.

Coding and game design are best aspects of his game creation process. Average Flash games developer needs 1-2 months to create single game. He makes up to $500 for that game.



I've mentioned how our average Flash game developer comes from United States, however, there is evident raise in number of developers from non-western countries comparing to last year:

o Russia 6% (up 2%)
o Ukraine 4% (up 2%)
o India 4% (up 3%)
o Brazil 3% (up 1%)
o Indonesia 3% (up 1%)

This is reasonable raise because average $500 for a single game in US/UK maybe is not big deal and may be considered as small bonus, but in Indonesia and India this is good money. Conclusion is that Flash games market is maturing and moving fast from hobby to real business which is good news for both players and developers.

*_*

13 April 2011

Elliptical Movement ActionScript 3.0 Flash Tutorial

First let's start with something we already done here and extend our knowledge. Take a look at previous posts about circular movement in ActionScript 3.0:

How to orbit in AS
Making orbit trails in Flash
Using drawing API for orbit like shapes

Elliptic movement in AS3





Ellipse has center point C(x0,y0) and two fixed points F1 and F2. Distances from F1 and F2 are r1 and r2. You can think of circular movement as special case of ellipse movement where values a and b are equal (a=b).

Thus, based on previous examples we can write code for finding position of point moving along elliptic curve.

var posX:Number = planet.x + Math.cos(radians) * a;
var posY:Number = planet.y + Math.sin(radians) * b;

Instead of single radius parameter in orbit function, ellipse function has two parameters a and b.

function ellipse(planet:MovieClip, sat:MovieClip, a:Number, b:Number, speed:Number):void
{
var currentDegrees:Number = 0;

this.addEventListener(Event.ENTER_FRAME, doEveryFrame);

function doEveryFrame(event:Event):void
{
currentDegrees += speed;
var radians:Number = getRadians(currentDegrees);
var posX:Number = planet.x + Math.cos(radians) * a;
var posY:Number = planet.y + Math.sin(radians) * b;
sat.x = posX;
sat.y = posY;
}

function getRadians(degrees:Number):Number
{
return degrees * Math.PI / 180;
}
}


That's all. You can replace orbit function with ellipse one in previous trails examples and it will work perfectly.

*_*

05 April 2011

Flash AS3 Laser Lab Code

As promised, here is the code for Laser Lab. In order to run this code successfully, you'll need to have Slider and Color Picker controls in your file library. Everything else is pretty simple, just paste the code into first frame of your FLA file and that's it.

Original document dimensions are 550x400. That is why loop function exist to avoid drawing over control elements.

If you extend this example even more, do let me know.

// laser effect playground
// author http://flanture.blogspot.com
// based on code by www.eyes-squared.co.uk
// march 2011

import flash.display.Sprite;
import flash.filters.GlowFilter;
import flash.events.MouseEvent;
import flash.events.Event;
import fl.controls.ColorPicker;
import fl.controls.Slider;
import fl.events.ColorPickerEvent;
import fl.events.SliderEvent;

// starting values
var baseColor = 0xFFFFFF;
var glowColor = 0xFF0000;
var baseStrength = 3;
var glowStrength = 4;
var glowBlur = 8;

var sprite:Sprite = new Sprite();
addChild(sprite);

function updateFilter() {
var gf:GlowFilter = new GlowFilter(glowColor);
gf.quality = 3;
gf.strength = glowStrength;
gf.blurX = gf.blurY = glowBlur;
var fils = new Array();
fils.push(gf);

sprite.filters = fils;
}
updateFilter();

stage.addEventListener(MouseEvent.MOUSE_DOWN, startFire);
stage.addEventListener(MouseEvent.MOUSE_UP, stopFire);

function startFire(m:MouseEvent) {
sprite.graphics.lineStyle(baseStrength, baseColor);
sprite.graphics.moveTo(mouseX, mouseY);
addEventListener(Event.ENTER_FRAME, loop);
}

function stopFire(m:MouseEvent) {
removeEventListener(Event.ENTER_FRAME, loop);
}

function loop(e:Event) {
// avoid drawing on control elements
if (mouseX < 400) {
sprite.graphics.lineTo(mouseX, mouseY);
}
}

var cp1:ColorPicker = new ColorPicker();
cp1.width = 100;
cp1.height = 25;
cp1.x = 420;
cp1.y = 30;
addChild(cp1);

var cp2:ColorPicker = new ColorPicker();
cp2.width = 100;
cp2.height = 25;
cp2.x = 420;
cp2.y = 200;
addChild(cp2);

var sl1:Slider = new Slider();
sl1.x = 430;
sl1.y = 100;
sl1.liveDragging = true;
sl1.minimum = 1;
sl1.maximum = 10;
sl1.tickInterval = 1;
addChild(sl1);

var sl2:Slider = new Slider();
sl2.x = 430;
sl2.y = 280;
sl2.liveDragging = true;
sl2.minimum = 1;
sl2.maximum = 10;
sl2.tickInterval = 1;
addChild(sl2);

var sl3:Slider = new Slider();
sl3.x = 430;
sl3.y = 350;
sl3.liveDragging = true;
sl3.minimum = 1;
sl3.maximum = 7;
sl3.tickInterval = 1;
addChild(sl3);

cp1.addEventListener(ColorPickerEvent.CHANGE, changeHandler1);
function changeHandler1(event:ColorPickerEvent):void {
sprite.graphics.clear();
baseColor = event.target.selectedColor;
}
cp2.addEventListener(ColorPickerEvent.CHANGE, changeHandler2);
function changeHandler2(event:ColorPickerEvent):void {
glowColor = event.target.selectedColor;
sprite.graphics.clear();
updateFilter();
}
sl1.addEventListener(SliderEvent.CHANGE, changeSlider1);
function changeSlider1(event:SliderEvent):void
{
baseStrength = event.target.value;
sprite.graphics.clear();
}
sl2.addEventListener(SliderEvent.CHANGE, changeSlider2);
function changeSlider2(event:SliderEvent):void
{
glowStrength = event.target.value;
sprite.graphics.clear();
updateFilter();
}
sl3.addEventListener(SliderEvent.CHANGE, changeSlider3);
function changeSlider3(event:SliderEvent):void
{
var temp = 1;
for(var i=0; i<event.target.value; i++){
temp = 2 * temp;
}
glowStrength = temp;
sprite.graphics.clear();
updateFilter();
}


*_*

 

template by blogger templates