Archive for the ‘Flash / Actionscript 3’ Category

In this article i want to share a simple way to use accelerometer on AIR SDK. Since we’re using AIR SDK, you can deploy your application in Anroid or IPhone. But the code that i want to share is actually intended to be deployed on Android (since i don’t have IPhone device) :p

First we need to import several libraries :

import flash.sensors.Accelerometer;

This is the MovieClip that will be moved by accelerometer

private var haro:HaroSymbol;

An variable of accelerometer

private var accel:Accelerometer;

Two variables that will store tilt factor in x an y axis

private var targetX:Number = 0;
private var targetY:Number = 0;



Developing Flash Application to run on smartphone such Android can be very interesting. My intention is to port my flash game into android platform and finally, after some configurations on my computer, i can create a simple flash application that runs in Android. Don’t expect much to my application, it  just displays images of android and air logo :)

Here’s the tools:

  1. AIR SDK
  2. Flex SDK
  3. Android SDK
  4. Flash Develop

Note: Thanks to Guave Studio Blog for creating Air Android AS3 template project :)

I want to give a simple trick about how to change focus to specified movie clip. You may have problem with keyboard input when your movie clip are closed/unclosed by other movie clip, your movie clip don’t want to receive keyboard press event until you clik on your application window.

Here’s the trick :

this.stage.focus = mc;

mc is movie clip that you desired to receive keyboard event. I found there’s a problem remain. With code above maybe you’ll encountered annoying focus rectangle diplay. Usually this focus rectangle appear as yellow lines surrounding your movie clip.

To remove this annoying yellow lines, you should add another line like below:

this.stage.focus = mc;
mc.focusRect = false;

Problem solved :)

Hi,  i want to share my three months of developing a flash game (even my current project is still unfinished, needs polishing, adding design arts, etc). Of course everybody already know what is Flash. It is most popular RIA platform on the web, and of course robust development. Commonly for developing Flash game (i’m focusing on game not other Flash Apps), developer use Adobe Flash (and it cost around $700, my friend said). With this software, you can easily to create animation, vector art, and motion tween. It’s great software, well for game art designer, it’s Yes, but me, a programmer, it’s No. Adobe Flash has poor Actionscript3 (AS3) editor. Before i develop flash game, i developed mainly Java or .NET application, of course, both do have strong OOP concept but AS3 don’t. Oops, i didn’t judge AS3 is sucks. Like i said, it has poor OOP concept but it has robust development.

An application should be divided its parts, Presentation layer shouldn’t be merged with logic or persistent layer.  So i can’t do it when i develop with Adobe Flash, so my friend suggested me to use Flash Develop. It’s free and somewhat great IDE. it has standard features like other IDE, like tabbing, debugging tools, and refactoring. After used it, my problem solved. this IDE is good enough for me, a programmer instead a designer.

Another problem came,  Adobe Flash Compiler is very very sucks, it didn’t give me specific error message when i was debugging  my app.  So i found there’s another compiler which i can tried, Flex SDK. Flex SDK is open source project from Adobe. It gives me good debugging message not like that “sucks” Adobe Flash.

If you’re interesting to develop Flash game, you’re programmer, looking for good IDE, you can download FlashDevelop here, download Flex SDK is in here, and you should read this tutorial abot Flex and FlashDevelop Workflow here.

Last words, developing Flash Game gives me interesting experience, fun, and annoyed error when i got stuck :)