28 April 2010

Running Flex 4 SDK and FlashDevelop

Using only Flash IDE for ActionScript or AIR projects is almost never final choice for many developers. In fact, majority of developers use all kind of available tools. When team work is involved usable knowledge of these tools is a must and this is also a big plus in anyone's portfolio. Here is small intro how to introduce Flex 4 SDK + FlashDevelop workflow.

First of all go and download Flex 4 SDK from Adobe Opensource Pages. Install downloaded files somewhere on your hard drive C:\flex4sdk for example. Set path to this folder. Right click on My Computer icon, go to Advanced tab and click on Environment Variables. In System variables list choose path, click edit and add path to newly created folder to the end of line. Go to Command Prompt and test your work with compc -version command.

You will also need FlashDevelop from their site, downloaded and installed. I have 3.0.6 RTM running, but more recent version is now available. Simple HelloWorld AS3 Project is enough to see if everything is OK.

I got following error after I tried to compile my project: 'C:\Documents and Settings\[USER]\My Documents\FDProjects\HelloWorld\HelloWorld.as: Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.'

In order to solve this problem, right click on project name, open Properties and choose Compiler Options. Within Additional Compiler Options add this line: -static-link-runtime-shared-libraries=true (see image). This will solve warning issue.

setting flex compiler advanced options
One more thing. I highly recommend using Senocular's pseudo output panel for testing purposes.

So, there you have it, basic setup of Flex 4 SDK and FlashDevelop. If you like this post leave comment or share. Thanks.

*_*

19 April 2010

New Flash Games development job

Totally unexpected opportunity knocked on my door few days ago and I'm still thinking if I should take it or not. A friend of a friend of a friend of mine offered me to make few small Flash games for kids. He is into publishing business, mostly educational books for children under 7-8 years old and they want to expand to multimedia educational games. My job would be coding and animating since they already have ideas and graphics ready.

I found inspiration via these Flash educational games links, lots of interesting examples are available. Just recently I have started to learn more about Flash Games development and this call came just on time, but I'm still not sure if I could pull it off. I have explained them about my short experience in subject but after they looked at this blog, they are more confident in me then myself.

Do you have any experience in the subject or/and can point me to some examples? Thanks.

*_*

13 April 2010

Random Generator updated to AS3

If you are blogger, are you happy to see your older posts are still read and commented, even years has past? I am. Especially if I see ppl are using my older code for learning. That's why I updated AS2 Random Number Generator to AS3 version.

There is one new getRan function which return random number less than max parameter. You can use this to limit the number you want to display. Here is new code with minor changes.


// author: FLANTURE http://flanture.blogspot.com
// date: 24 Jan 2009
// updated: 13 Apr 2010 (AS2 -> AS3)

import flash.filters.BlurFilter;
import flash.events.Event;
import flash.text.TextField;

var timerStarted:Boolean = false;
var counter:uint = 0;
var firstDigitStop:uint = 8;
var secondDigitStop:uint = 16;
var thirdDigitStop:uint = 20;
var filter:BlurFilter = new BlurFilter();
var filterArray:Array = new Array();

// function for roll_mc movie clip onPress action. If timer has not started,
// that means there is no action in progress, so we can start one.

roll_mc.addEventListener(MouseEvent.MOUSE_UP, onRoll);
function onRoll(evt:Event):void
{
if (!timerStarted) {
var filter:BlurFilter = new BlurFilter(60, 120, 1);
var filterArray:Array = new Array();
filterArray.push(filter);

num1_txt.filters = filterArray;
var newNumber1:Number = getRan(10);
num1_txt.text = newNumber1;

num2_txt.filters = filterArray;
var newNumber2:Number = getRan(10);
num2_txt.text = newNumber2;

num3_txt.filters = filterArray;
var newNumber3:Number = getRan(10);
num3_txt.text = newNumber3;

timerStarted = true;
}
}

// functions for restoring blur effect

function restoreBlur1() {
num1_txt.filters = new Array(filter);
}
function restoreBlur2() {
num2_txt.filters = new Array(filter);
}
function restoreBlur3() {
filter.blurY = 0;
filter.blurX = 0;
num3_txt.filters = new Array(filter);
}

// next function controls when blur should stop and numbers should display.

addEventListener(Event.ENTER_FRAME, onFrame);
function onFrame(evt:Event):void
{
if (timerStarted) {
if (counter < thirdDigitStop) {
counter += 1;
if (counter == firstDigitStop) {
restoreBlur3();
}
if (counter == secondDigitStop) {
restoreBlur2();
}
} else {
timerStarted = false;
counter = 0;
restoreBlur1();
}
}
}

// you can change firstDigitStop and other variables to suit your needs.
// numbers represent frames, not seconds.

function getRan(max:uint):uint
{
return Math.floor(Math.random()*max);
}



Everything else is the same, just target at least Flash Player 9 with AS3.



*_*

06 April 2010

AS3 Spiderweb Workshop

If you have read about improved spiderweb AS3 class here is a little tool I made to make things easier. This visual toy will allow you to create your own spiderweb fast.

Right now, there isn't size limit, so your creation will go out of borders if not appropriate parameters are used. In some future version I'll include size limit plus I'll add maybe save feature. Stay tuned. Share if you find it interesting.


Click on image to download spiderweb workshop utility which is only 3Kb.

*_*

 

template by blogger templates