Flash actionscript 3.0

Simple Chat application using SMARTFOX2X

2

Posted by Sankar.G | Posted in | Posted on 3:05 PM


The new SmartFoxServer 2X platform builds on top of this huge experience, providing one of the most versatile, extensible and feature-rich platform for massive multiplayer development.

SmartFoxServer 2X (aka SFS2X) takes the core SmartFoxServer philosophy established by the Basic and Pro editions and expands it in new directions, introducing hundreds of improvements and focusing on a few precise goals: simplicity of use, versatility and performance.

I create a simple chat application in Actionscript 3.0 using SmartfoxServer 2x Client API below link used to you to get the chat application source

SFS2X Chat.rar

Play sound files by using Local File Browser

0

Posted by Sankar.G | Posted in | Posted on 4:20 PM


One of the readers requested for to play audio file by using local file browser,thought i will post it so that it may help others who might have siame requirement.

We cannot select and play a audio file by using fileReference because fileReference object doesn’t return the file path of the audio file [this will not be an issue if you are developing a AIR application, as you can use'File' object which will return file path]. So our only choice here is to load the audio file as binary data using fileReference objects ‘load’ method.

And we need to Convert the wave audio data into raw data and use Sound objects Sample data Api to play back.

An API which can convert Wave into raw audio for to play in sound Channel and a small example is below.

Sound_Play.zip

Peer to peer in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 6:17 PM

Adobe Cirrus the previous name of the technology called Adobe stratus using the technology we can connect 2 flash player without any server just we need to exchange the 128 bit code.

Already i done a post about this in my previous blog

Previous_Entry

Usage of Cirrus
You can able to chat,video stream etc but there is no server direct peer to peer connection between 2 flash Player, I develop a small chat application by using Adobe Cirrus below you have the link

Adobe_Cirrus.zip

Steps to use the above Example

1) Download the file from above link.

2) Extract the file and open test.swf twice.

3) you get 128 bit text in the first box in both the swf.

4) Just copy that code from first swf and paste it in second swf and click connect.

5) And copy the code from second swf and paste it in the first swf and click connect.

Now both the swf are connected each other using Adobe Cirrus (Peer to peer)
And start your chat using below text box with send button...

Facebook Graph api example in AS3.0

1

Posted by Sankar.G | Posted in | Posted on 2:14 PM


In the below URL you can get Facebook wall post, fetching friends List from Facebook , fetching news from Facebook and publish stream , read stream and getting email address permission coding in Action script 3.0


And you can get the profile picture of log in user by using below file


I done this application using Adobe Air so i use Facebook Desktop API but there is no much different between Facebook Desktop API & Facebook web API, you can get the file in the below link ...


Facebook Graph api in as3.zip

Adobe Air Example with DB

0

Posted by Sankar.G | Posted in | Posted on 4:35 PM

Using Adobe Air we can create a application for the Desktops and mobile phones,Adobe air have in built database that is SQLLite
So we don't need external Database to store and retrieve the Data
so using the adobe air with SQLLite, i create a sample application to store the friends birthday date below link is use to you to get the code to create and select the sqllite Database with
adobe air 2.0

Birthday Reminder.zip

Data transfer from as2 to as3

0

Posted by Sankar.G | Posted in | Posted on 12:05 AM

We face lot of difficulties to transfer object from as2 to as3 or vice versa
so below you have a link to get the file
It is used to create a bridge between as2 to as3 , And It is useful to exchange the objects from as2 to as3 with good example

In the Below File , i attach the as2 file inside of the as3 file
and pass the object from as2 to as3 and vice versa

connector.zip

Tron Analog Clock in AS3

4

Posted by Sankar.G | Posted in | Posted on 3:56 PM

I develop a simple Tron Analog Clock in as3

Tron:Is a 2010 American science fiction film directed by Joseph Kosinski and produced by Steven Lisberger

Using that widget , i develop a simple analog clock the below link is used to get a
Tron Analog clock source

Tron.zip

Tron.swf

Dynamic Registration Point for a MovieClip in AS3

0

Posted by Sankar.G | Posted in | Posted on 4:44 PM

In the Flash depend upon the MovieClip registration point only
movieclip rotation and scaling will occur..
so below file is used to change the registration point of a MovieClip
on the Fly.

Dynamic_reg.zip

Dynamic_reg.swf

Custom Slider in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 5:57 PM

In flash we have slider component in as3.0.
But some time we need to use our own design to implement the slider,
so by using the below link you can create a custom slider design in as3.0
with out using flash slider component.

Custom Slider.zip

Isometric depth Swaping in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 9:49 PM

In AS3.0 always we facing the problem in depth swaping if it is in isometric view it take so troubles ,so below file is used to you to do isometric depth swaping easily

isoDepth.zip

depth.swf

Custom Event Dispatcher in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 8:39 PM

The EventDispatcher class is the base class for all classes that dispatch events. The EventDispatcher class implements the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface.

We Can create a Custom Event Dispatcher in as3.0
we can send the Object,string through Event Dispatcher Class...


Below Link is Used to you to get the Example of the Custom Dispatcher in as3.0...

Custom_Dispatcher.zip

A Star path finding Algorthim in Actionscript3.0

6

Posted by Sankar.G | Posted in | Posted on 12:14 PM

A star is a Computer Algorithm that is widley used in path finding
the process of plotting an eficiently traversable path between
points called nodes A* is a very general and flexible graph traversal algorithm noted for its performance and accuracy.
As such,it is the most widely used graph traversal algorithm
A* is uses best-first search and finds the least-cost path from
a given initial node to one goal node

we are going to use this A* in our actionscript3.0
Note:
1) Click ok the grid you will place a green box
2) second click you place a Blue Box in the Grid
3) And After the Third Click you will place a black
boxes in the Grid ....

First Green box is the Orgin and second Blue box is the
desitination and black boxes are the Hurdles....
after place this press spacebar in the keyboard ....

Orgin Box will move to the desination box in the correct Path...

Below Link is used to get the a star path finding algorithm in AS3.0

pathfinding.zip

Add a External SWF library item using AS3.0

2

Posted by Sankar.G | Posted in | Posted on 11:47 PM

if we want to add a External SWF Libraries item to another SWF file using AS3.0.
we want to create a loader and URLRequest and load the external SWF file
and put addEventListener for loader.contentLoaderInfo with Event.COMPLETE

create a class and catch the event.target.content.loaderInfo.applicationDomain.getDefinition("box")as Class
box=external SWF library item linkage name & convert it in to object like below

var clsObj:Object=new cls();
cls=class name

Below link is used to add a items from external swf library

Externallibrary.zip

Adobe Stratus

0

Posted by Sankar.G | Posted in | Posted on 11:16 PM

Adobe Stratus enables peer assisted networking
using (RTMFP) Real Time Media Flow Protocol using this protocol
we can communicate the another SWF with out any server
using (RTMFP) the communication establish between client to client
with out any main server

Most Important features in stratus is
1)Low latency
2)end-to-end peering capability
3)security and scalability

But this RTMFP Protocol works only in flash player 10 or greater

More Information

EventDispatcher example in as3.0

0

Posted by Sankar.G | Posted in | Posted on 11:04 PM

The EventDispatcher class is the base class for all classes that dispatch events.
The EventDispatcher class implements the IEventDispatcher interface and is the base class for the DisplayObject class.
The EventDispatcher class allows any object on the display list to be an event target and as such,
to use the methods of the IEventDispatcher interface.

In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher.
If this is impossible (that is, if the class is already extending another class),
you can instead implement the IEventDispatcher interface, create an EventDispatcher member,
and write simple hooks to route calls into the aggregated EventDispatcher.


EventDispatcher.zip

Prespective Ball Movement in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 11:29 PM

In Flash we have only 2 axis x&y ,we dont have z axis in flash but in some time we want to show the z axis in flash the below file is used to you to guide how to create a virtual z axis in flash using ActionScript 3.0

PrespectiveBall.zip

Distance Between 2 points in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 10:40 PM

Distance Between point A and B formula is
dx=point1.x-point2.x;
dy=point1.y-point1.y;
distance=Sqrt(dx*dx+dy*dy);
Below files is used to you to find the Distance Between
2 Points

distance.zip


distance.swf

LocalConnection Example in AS3.0

0

Posted by Sankar.G | Posted in | Posted on 9:09 PM

Local connections enable a communication between SWF files without the use of fscommand()
or JavaScript. LocalConnection objects can communicate only among files that are running on the same client
computer, but they can be running in different applications

LocalConnection objects to implement communication between two files,
it is helpful to identify the commands used in each file.
One file is called the sending file; it is the file that contains the method to be invoked.

The sending file must contain a LocalConnection object and a call to
the send()method.

The other file is called the receiving file;it is the file that invokes the method.
The receiving file must contain another LocalConnection object and a call to the connect() method.

Below link is useful to you to get the Example of a Local Connection

LocalConnection.zip

cell data in dataGrid in as3

0

Posted by Sankar.G | Posted in | Posted on 11:28 AM

Below files is used to handle the DataGrid Easily in as3.0
and it is used to take the cell data in DataGrid in as3.0

Below link is used to download the dataGrid handling file
DataGrid.fla

Below link is used to see the example of the file
DataGrid.swf

Local to Global in AS3.0

1

Posted by Sankar.G | Posted in | Posted on 8:32 PM

Local to Global in ActionScript 3.0

Local to Global.fla

Local to Global.swf