Adobe Launches AIR 3.2 and Flash Player 11.2

Flash Player 11.2 adds features for gaming, including mouse lock, relative coordinates, and right and middle -click support.

AIR 3.2 introduces Stage3D graphics technology for iOS and Android, enabling efficient, faster native GPU rendering performance

For more information about the release check this link

Learn Adobe Flash – Actionscript Lessons Website

Here’s a neat website with some nice tutorials on Flash Actionscript. It ranges from beginer to more advance techniques.

http://everythingfla.com

 

[ AS3] Masking Dynamic Content TextField and cacheAsBitmap

Ok, this is a quick post.

In a little project I am working right now I had to do some effects involving some textfield masking.  The problem I had is that the text was never masked and it always was visible on the display list. To solve this problem I had to use the cacheAsBitmap propriety of display objects. Once I set that to true everything went smooth.

Waving Text Effect in Actionscript 3.0

var text:String       = "This text is a waving text";
var format:TextFormat = new TextFormat("Arial", 12);
var radius:int = 5;
var speed:Number = Math.PI/15;
var angle:Number =0
var letters:Array = null;


function Init():void
{
	letters = [];
	
	for (var a = 0, x = 0; a<text.length; a++)
	{
		letters[a] = new Sprite();
		
		var txt:TextField =  new TextField();
		txt.selectable = false;
		txt.autoSize = "left";
		txt.text = text.charAt(a);
		txt.setTextFormat(format);
		
		letters[a].addChild(txt);
		letters[a].x = a * 15;
		addChild(letters[a])
	}
	
	addEventListener(Event.ENTERFRAME, Animate, false, 0, true); 

}

function Animate(e:Event):void
{
	for (var a = 0; a<letters.length; a++) 
	{
		letters[a].y = Math.sin(angle+a)*radius;
	}
	
	angle += speed;
}

Init();

Random Generated Displacement Map

So,  I was following this tutorial from activetuts+ to create the same effect,  a static distortion effect using the displacement map filter,  in one of my game projects and it was cool until I realized that my project is getting fatter and fatter by adding images of different sizes to use for different sized objects.

Ofcourse, this was not acceptable so I thought I could create a random generated image by code and reuse it than to create different images in Photoshop.

Anyway, here’s the code which is generating a random image to be used with the effect in the tutorial.

function rndImage(w:Number, h:Number, wl:int = 0, bl:int =0):BitmapData
{
var bitmapdata:BitmapData = new BitmapData(w,h,false, 0xDDDDDD);
var randY:int = 0;
var randX:int = 0;
var randW:int = 0;
var thick:Number = 0;
var a:int = 0;
var minWidth:int = 0;
var line:Shape = new Shape();

for ( a = 0; a< wl; a++)
{
thick = Math.random()* 1.3 + 0.2;
randY = Math.random() * h;
minWidth = (40 * w)/100;
randW = Math.random() * (w-minWidth) + minWidth;
randX = Math.random() * ((w-randW));
line.graphics.lineStyle(thick, 0xFFFFFF);
line.graphics.moveTo(randX,randY);
line.graphics.lineTo(randW, randY);
}

for ( a = 0; a< bl; a++)
{
thick = Math.random()* 1.3 + 0.2;
randY = Math.random() * h;
minWidth = (40 * w)/100;
randW = Math.random() * (w-minWidth) + minWidth;
randX = Math.random() * ((w-randW));
line.graphics.lineStyle(thick, 0x000000);
line.graphics.moveTo(randX,randY);
line.graphics.lineTo(randW+randX, randY);
}

bitmapdata.draw(line);

return bitmapdata;
}

And this is how you generate the image

rndImage(width,height, nr_white_lines,nr_dark_lines);

Adobe Flash 11 Stage3D (Molehill) Game Programming Beginner’s Guide book

If you are a flash developer keen to get into game development this book is for you. It is a perfect introduction to 3D game programming in Adobe Molehill for complete beginners.

Starting with simple tasks like setting up Flash to render a simple 3d shape, each chapter presents a deeper and more complete videogame as an example project.

You can get this as a physical book or an eBook.

Source

Muscle Jump – Flash 11 ( Stage 3D / Molehill ) gfx showcase

Ok, so after the Adobe Flash announced the big failure with mobile platform they concentrated they efforts on showing that Flash isnt quite dead ( as many have cried out ).

Their latest “spam” is this quite nice graphics demo to show some of the capabilities of Flash 11 ( Stage3D/Molehill )

So this is the official teaser-trailer for the upcoming Muscle Jump, a short, immersive Flash 11 experience/game with bluffing graphics, posing as a direct Web equivalent of home videogames.

Enjoy !

Also here is a link with other Stage 3D games in case you are curious.

Lite Video Presentation

Lite Video Presentation

Lite Video Presentation

You can use this component for various video presentations.
You can jump in different sections of the video by clicking the
thumbs.

Until the section of the video is loaded the thumb will be greyed
out.

Features:

- resizable
- change settings through a XML file
- youtube video support
- flv, mp4, 3gpp, quicktime, mov
- change the colors of each element of the video player
- the wallpaper can be enabled or disabled
- supports custom made captions through an XML ( can be disabled )
- caption text supports HTML formatting

- OOP code
- documentation
- example files ( ready to custom & deploy )

[ LINK ]

Detect Mouse Inactivity in Actionscript 3.0

Before we start you need to be familiar with MouseEvent and Timer classes.

var _timer:Timer = new Timer(5000);

function Start():void
{
   _timer.addEventListener(TimerEvent.TIMER, ShowMsg, false, 0, true);
   _timer.start();

   stage.addEventListener(MouseEvent.MOUSE_MOVE, StopTimer, false, 0, true);
   stage.addEventListener(MouseEvent.MOUSE_DOWN, StopTimer, false, 0, true);
   stage.addEventListener(MouseEvent.MOUSE_UP, StopTimer, false, 0, true);
}

function ShowMsg(e:TimerEvent):void
{
   trace("There is no activity");
}

function StopTimer(e:MouseEvent):void
{
   _timer.stop();
   _timer.start();
}

Start();

The first thing I’ve done is to setup a Timer object to count up to 5 seconds ( you can change that to what ever numer of seconds you want ).

The timer object also has an event listener so we can know when the 5 seconds are over.

I have setup some event listeners that will help detecting any actions of the mouse on the Stage ( MOUSE_DOWN, MOUSE_MOVE and MOUSE_UP )

If during those 5 seconds nothing happens ( mouse is not moved or performs a click ) ShowMsg() function will be fired up and give you a message of inactivity.

If the mouse is moved the StopTimer() function will be activated and reset timers count.

This is a useful and easy way to detect user activity.

Lite Slide Gallery

Lite Slide Gallery

Lite Slide Gallery

This is a nice flash application that will enhance your website.

This gallery can be used either in a fixed size mode or full browser mode, because it is resizable.

Features:

- resizable 
- change settings through a XML file 
- unlimited number of images 
- background: can be either a image or a color 
- change thumb's width and height 
- change the color of each element of the gallery 
- the thumbs panel can be either visible or hidden at startup 
- title can be visible or not - OOP code - documentation 
- commented code 
- ready to deploy files 
- examples  

[ LINK ]