Xentor's Domain

Do unto others before they can do unto you.

Home

Quotes

Software

XenSoft


XenSoft FlashNetwork

Download Current Version (v0.2.2 BETA)

Contents:

  1. Requirements
  2. Downloadable Files
  3. Change Log
  4. To-Do List for Improvements
  5. Overview
  6. How to Use (End-user)
  7. Known Bugs and Solutions
  8. Communication Protocols (How to write an XSFN-compatible movie
  9. Contact Info
Current Project Phase: Testing and API tweaking

Requirements:

[Back to Top]

Downloadable Files:

XenSoft FlashNetwork v0.2.2 BETA (Download)
Sample Movie (Download)
This is a simple chat application/movie written in Flash 5, to demonstrate some of the features of the XSFN API. It should show you how to communicate with XSFN, and how to send data over a network. The .fla and .swf files are included in the zip file.
[Back to Top]

Change Log:

v0.2.2 BETA
  • Added SWF_* fscommands to provide information about the movie
  • User is now prompted to choose a network name / player name
  • Added LAN search capability: User can now search for games on the local network
  • Added OldVersion event, triggered when SWF_REQUIREDVERSION is supplied and newer than XSFN version
v0.2.1 BETA
  • Fixed bug where buttons in flash movie could change network state at bad times (i.e. "Listen" when already listening).
  • Fixed bug involving setting of remotehost/remoteip variables in wrong location
  • Fixed error detection in certain network modes.
v0.2 BETA
  • Added ability to load movies from command line
  • Changed initial background color to black. Looks better
  • Added Help->Readme, displaying basic instructions
v0.1.1 BETA
  • SWF movies can now be drag-dropped from windows explorer to load
  • Protocol changed to allow Cr/Lf characters. Ascii codes 01 and 02 now restricted instead.
  • Added variable: /XSFN:localip, giving the IP of the local system
v0.1 BETA
  • Initial Release
[Back to Top]

To-Do List for Improvements:

Drag-Drop to Load MoviesDone
Transparent BackgroundQueued
Protocol Change to allow Cr/LfDone
Search for XSFN hosts on local networkDone
Support for multiple connectionsQueued

[Back to Top]

Overview:

XenSoft FlashNetwork (XSFN, for short), is a windows program that acts as a conduit for Macromedia Shockwave/Flash movies, allowing them to make peer-to-peer connections over a TCP/IP network.

Features Include:
  • Client and Server capabilities in the same program
  • Automatic lag timer - Checks and displays network lag every 5 seconds
  • Indicator lights to show RX/TX activity (Transmitting and Receiving)
  • Allows Flash Movies near-total control over network connection and some control over XSFN's appearance
  • Can be used offline as a standard flash player
  • Works over a LAN or the internet, as long as a TCP/IP connection is possible.
  • Can connect in either direction, in case one person is firewalled.

[Back to Top]

How to use:

  • Start XSFN by double-clicking the EXE file
  • Click the file menu, and select Load Movie. Select an SWF file from your hard drive.
  • Once the movie is loaded, the hosting player (Either one), should click the Network menu and select Listen for Connection. Their XSFN will go into listen mode, and wait silently.
  • The other person must click the Network menu and select Connect to another Computer. A small dialog box will pop up, where the user can enter the hosting computer's IP address. Click OK, and the connection will be made.
  • From this point, the flash movie is in control, so play!

[Back to Top]

Known Bugs and Solutions:

  • Program does not run with version 6r22 of the flash plugin (C:\Windows\System32\Macromed\Flash\Flash.ocx). Upgrading to a newer version of the plugin fixes this problem. (Thanks to xMCNUGGETx for finding this one)
[Back to Top]

Protocol:

Any Flash movie will run perfectly in XSFN, but in order to utilize the network capabilities, it must communicate with the program. The following fscommand()'s are currently available:

Network Commands: Give your movie control over the TCP/IP connection
LISTEN
Tell XSFN to listen for a connection. Same as the user clicking Network -> Listen
CONNECT address
Tell XSFN to connect to another computer. If address (Hostname or IP of remote computer) is provided as an argument, XSFN will immediately attempt to connect to it. If not, a connect dialog will be displayed, prompting the user to enter an address, as in Network -> Connect
DISCONNECT
Immediately terminate the network connection (Network -> Disconnect)
QUIT
Immediately exit XSFN
SEND data
Send data over the network to the flash movie on the remote computer. You can send any string data with the exception of ASCII codes 01 and 02 (Not the same as "1" and "2"). If you don't know what an ASCII code is, don't worry about it. The data you transmit is up to you, and XSFN does not interfere or modify it at all
Display Commands: Change how XSFN looks to the user
TITLE title
Change the title/caption of the XSFN window (The text in the titlebar to title. This allows your movie to "personalize" the XSFN window a bit. Expect more commands like this in future versions.
DISPLAYNETWORKMENU 0/1
Toggle the display of the Network menu. Sending "0" as a parameter will hide it, and "1" will show it. If you hide the menu, your movie has complete control over the connection. Of course, this also means you MUST provide an interface in your movie, and control the network functions manually.
Movie Information: Provide information about your movie to XSFN
SWF_NAME moviename
Tell XSFN the name of your movie. This must be alphanumeric with NO SPACES OR PUNCTUATION. Case doesn't matter, since XSFN will automatically make it uppercase (ex: XSCHATDEMO). This will be used during a local network search, so only hosts playing the same game as the searching user will respond
SWF_REQUIREDVERSION reqversion
Specify what version of XSFN is required to play your movie. Check the changelog to see what features were added in each version. The reqversion specified must be in the form "0.0.0". For example: "0.2.2". If you specify an invalid version or if an older version of XSFN is being used, an OldVersion event will be triggered
SWF_DEFAULTUSERNAME username
Normally, when the user tries to listen or connect, he/she is propmted to provide a name to use on the network. If you specify a default username, their name will automatically be set to this value unless they have already specified one of their own (ex: "Player").
SWF_AUTHOR author
Simply tell XSFN your name. Not used as of v0.2.2, but included for use in future versions.
SWF_DATECREATED date
The date the movie was completed/released. Not used as of v0.2.2, but included for use in future versions. The format is not set, but if standardized will most likely use "Jan 01 1900" to avoid ambiguity and confusion with date formats of different countries.

That takes care of sending information to XSFN... But you'll also want to receive replies and status reports. Since Flash's API doesn't support direct method calls, this is implemented in the old Flash 4 style of function-calling. Create a movie-clip in your main timeline, and give it the instance name (Not library name) of "XSFN" (No quotes). In this movie clip (MC), you need two labeled keyframes: "ReceiveData" and "ReceiveEvent". When a message arrives from the remote computer's flash movie, "ReceiveData" will be triggered. When XSFN generates an event, "ReceiveEvent" will be triggered. They are triggered with a standard Call() action, and the arguments are placed in variables within the MC. Currently, XSFN uses the following variables (Note that most are inside the XSFN movie clip):

VariableDescription
/:XSFNversionThe version number of XSFN being used. This is set in the main timeline immediately after loading the movie. Example: "0.1"
/XSFN:netstateCurrent state of the network connection: 0 = Offline, 1 = Listening, 2 = Connecting, 3 = Negotiating (Checking version compatibility), 4 = Connected/Online.
/XSFN:localipThe IP address of the computer XSFN is running on. This is set once when the movie is first loaded. (Requested by Ed Mack at FlashKit)
/XSFN:remoteipThe IP address of the computer you connect to. This is set when the computers connect, and is not changed afterwards. This means that even after they disconnect, it will still show the address of the last computer you connected to.
/XSFN:remotehostThe hostname corresponding to the above IP address. This may or may not be set, depending on whether a hostname or IP address is typed in when connecting.
/XSFN:messageWhen the remote computer's flash movie sends information, it will be placed in this variable and the ReceiveData frame will be called
/XSFN:eventWhen XSFN triggers an event, the event name will be placed here, and ReceiveEvent will be triggered.

Event NameDescription
NetStateChangeTriggered when the network state changes. This will happen when a listen/connect operation begins, when negotiation starts, when the connection is completed, and when the connection is terminated. Check /XSFN:netstate to read the current state
OldVersionTriggered in response to an SWF_REQUIREDVERSION command, if you specify an invalid version number, or if the XSFN version being used is older than the one specified.
ConnectTriggered when a connection is completed. This is provided for convenience, and will follow a NetStateChange event (With netstate = 4)
DisconnectTriggered when a connection is terminated. This is provided as a convenience, and will follow a NetStateChange event (with netstate = 0)
[Back to Top]

Contact Info:

Any suggestions, ideas, etc, can be sent to:

E-mail:
Xentor@usa.net
ICQ: 178793 (WWW Pager and EmailExpress disabled)
AOL IM: Xentor
FlashKit: Xentor

Created by Xentor (Xentor@usa.net)
100% Made in Pico!