Thursday, December 31, 2009

Flash Monetization Experiment

1 comments
I've been a flash developer for a couple of years now and always wanted to get into flash game development. I recently discovered an article on Emanuele Feronato blog, an experiment on how to monetize a flash game. He gives an in-depth overview of the pros and cons of the types of flash games to make and how to distribute your flash game. Using his article as a source of inspiration, I decided to create my own experiment.

Creation of the Flash Game
Since I'm a newbie in flash game development, I decided that I should start with a very simple game.
I'm not a graphic artist so I knew the graphics had to be simple enough that I could create on my own.
I did a bit of research on some of the popular flash games on the web. A memory or matching
game I decided on. I always liked Simon-Says as a child so I decided was going to create a memory game.
I finally decided on a Christmas themed game, simon-says with a twist, musical penguins.

I took me a day to create the game in total. Since I'm not a graphic artist, I feel this was
a perfect game to create.

screenshot

I did a bit of research.....
I found some great tutorials to get me started.
I started to do research on what games where popular.
I found some great resources that helped me along the way.

I finally decided on a Christmas themed game, simon-says with a twist, musical penguins.

Now that the game was finished, it was time to figure out how to distribute it.

screnshot

Game Monetization

Different Types of Monetization
Overview
Describe different types of monetization. Here's a brief overview of the different types.
- mochiads
- sponsorship
- ads


What and why I decided to choose mochiads

Cons: poor graphic – repetitive gameplay (1 day game)
http://www.emanueleferonato.com/2007/10/28/experiment-monetizing-a-flash-game/





There are several ways to monetize a flash game and I experimented with one.

I did choose sponsorship because the game was so simple, I did not feel it was
not a good enough candidate for sponsorship.

I choose to go through mochiads. I earned a few pennies a day but the lesson learned was the process.

I feel this was a good experiment. I had a lot of fun, that's what it is all about. I'm going to develop a more involved game, maybe hire a graphic artist.

I see the potential to create a great game. This is a great time to be a flash developer

I really had alot of fun but I know to be more competive and successful, I will need to create a more original game.

To play the game, click here.

Saturday, December 26, 2009

How to Load An External CSS File

0 comments
In this tutorial, you're going to learn how to load an external stylesheet and apply
it to a textfield. Let's get started.



Create Textfield

Open up flash and rename the default layer to text.
Place textfield on the text layer. Give it an instance name of my_textfield and make sure to set the behavior to multiline.



Create CSS File

You can use styles like in traditional html. Flash supports a subset of CSS properties. Please
go here to view a full list of supported properties.

To create our CSS file, use a text editor and paste the following code into it:


.quotation {
font-size: 20px;
color:#0000FF;
text-align:center;
}

p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align:justify;
color:#999999;
margin-right:20px;
}

.author {
font-family:Geneva, Arial, Helvetica, sans-serif;
text-align:right;
font-style: italic;
}


Save the file and name it style.css.

Load CSS Files

Create a new layer and name it code. Place the following code in the layer:


var cssLoader:URLLoader = new URLLoader();
var cssRequest:URLRequest = new URLRequest("style.css");
var css:StyleSheet = new StyleSheet();

cssLoader.load(cssRequest);
cssLoader.addEventListener(Event.COMPLETE, cssLoadComplete);

function cssLoadComplete(e:Event):void {
css.parseCSS(e.target.data);
my_textfield.styleSheet = css;
my_textfield.htmlText = "

Imagination is more important than knowledge.

";
my_textfield.htmlText += "

For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.

";
my_textfield.htmlText += "

Albert Einstein

";
}

Save your work and test the movie.

Download Source

How To Create A Digital Clock In Flash

0 comments
In this tutorial, you will learn how to create a digital clock using Actionscript 3.



Note: I'm using a LCD font called Digital 7 in this tutorial. You can go grab it from here.

1. Create a new flash document and set the size to 300 x 150 px and the background color to black.
2. Rename the default layer to text and create a new layer and rename it to code.



3. Create a dynamic text field on the text layer and give it an instance name of clock with the following properties:



4. Now embed the characters within the text field like shown:



5. Add the following actionscript code to the code layer:

stage.addEventListener(Event.ENTER_FRAME,updateTime);

function updateTime(e:Event):void {
var date:Date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var ampm;

// Conditional statement to set AM or PM according to hour
if (hours >= 12) {
ampm = "PM";
} else {
ampm = "AM";
}

if (hours > 12){
hours = hours - 12;
}
else if (hours == 00){
hours = 12;
}

if (minutes < 10){
minutes = "0" + minutes;
}

if (seconds < 10){
seconds = "0" + seconds;
}

clock.text = hours + ":" + minutes + ":" + seconds + " " + ampm;
}


6. Save your work and test the movie.

Download Source

How To Create A Hyperlink

0 comments
In this tutorial, you will learn how to create a hyperlink in Flash using ActionScript 3.

1. Go ahead and rename the default layer in your flash document to button. Create a new layer and rename it code.



2. Go to Insert >> New Symbol and create a new button and name it My_Button.



3. Rename the default layer to bg and create a new rectangle 120 wide and 40 high. Give it a color of #0053A4. Insert a new layer and rename it text. Create a static text field and align it properly.



4. Drag the button from the library into the button layer. Give it an instance name of my_button.

5. Go to the code layer and add the following code:


my_button.addEventListener(MouseEvent.CLICK, gotoURL);

function gotoURL(e:MouseEvent):void {
navigateToURL( new URLRequest( "http://www.flashsource.blogspot.com" ), "_blank" );
}

6. Save your work and test the movie.

Download Source