Search

Archive for the 'Network Programming' Category

Flash Player 9 Local swf Security

Posted by Nate Chatellier on May 30th, 2007

Let's say you had an external settings file that you wanted to load using the following code:
PLAIN TEXT
Actionscript:

protected var _loader:URLLoader = new URLLoader();

_loader.addEventListener( Event.COMPLETE, function():void { trace("settings.txt was loaded successfully"); } );

_loader.load( new URLRequest("settings.txt") );

You finish writing your class, save your fla, and compile. After compilation completes, the code above properly trace s "settings.txt [...]

Registered Socket Functions

Posted by Nate Chatellier on May 3rd, 2007

Now that you know how to dynamically cast variables at runtime, we can create a very cool static class I dub RegisteredSocketFunctions. The purpose of this class is to allow any function to be "registered," which, by doing so, allows global access to the function directly.
The goals of the RegisteredSocketFunctions class:

Any function in any class [...]

Dynamic Casting and * in ActionScript 3

Posted by Nate Chatellier on April 27th, 2007

This discussion is necessary in order to continue with our network programming lessons.
Casting (converting one variable type to another) in ActionScript 3 is very easy. The following code casts a uint as a String:
PLAIN TEXT
Actionscript:

var  nNum:uint = 5;

var  sNum:String = String(nNum);

But what if you don't know what the variable should be cast as? For [...]

Flash Network Programming via TCP/IP, part 2

Posted by Nate Chatellier on April 26th, 2007

Today, I give you a free utility class that handles everything you need to handle in order to establish a connection. Tomorrow, I give you the world a class that make it seem like you are calling functions directly on the server and visa versa.
Download the latest version of the ConnectionEstablisher class here.
Usage example:
PLAIN TEXT
Actionscript:

// [...]

Flash Network Programming via TCP/IP, part 1

Posted by Nate Chatellier on April 23rd, 2007

A while back I led an ActionScript 2 project with two other classmates in a Network Programming class I was taking at EWU. We created a Flash game we called "Zelda Arena" in which multiple players on multiple computers would connect via TCP/IP to a C++ server. You could custom color your own hero (Link) [...]