
ROBIN Readme

Robin is a Flash / PHP Multiuser Solution
http://robinflash.wordpress.com
Written by Inventor Dan Zen
http://www.danzen.com

~~~~~~~~~~~~~~
Robin is open source and free to use
If you are using Robin for commercial purposes please consider donating
Look for the Karatja links on the site for happy donating ;-)

~~~~~~~~~~~~~~

There are two main sections: PHP and FLASH

------------------------------------------------------
PHP
------------------------------------------------------

Put all the folders and files in a robin folder on your server

In a Web browser run http://yourdomain/robin/admin/ip.php and copy your server IP address

In an editor, open the mysetup.php file and paste your IP address into the first line

For example: $address = "75.125.175.19";

If you are running XAMPP - go to the trouble section otherwise continue here

In a Web browser, go to http://yourdomain/robin/

An admin site should appear - the default password is egg 

You can change the default password by editing the mysetup.php file

Once logged in to the admin site click Start Robin

Check that Robin is running by clicking the Robin Status link

If Robin does not start then please read the Trouble section below

--------
CRON
--------

robin.php creates a socket connection and these sometimes stop working

runrobin.php loops to check that the socket is still running and if not starts it again

You should run runrobin.php from a cron job perhaps every hour 

If you do not know how to set up a cron job then ask your server folks

My server folks run a cron.php file for me every hour

In that cron.php file is this:

<?php 
	file("http://yourdomain/robin/runrobin.php"); 
	// other files I might want to run hourly...
?>


--------
SAMPLES
--------

See the Flash section below for instructions to make your samples work


--------
TROUBLE
--------

The files have been tested on Windows with XAMPP and on Linux with Apache as of 2009

For Robin to run from the admin or a cron, your PHP must support posix_kill (it does not kill anything!)

The posix_kill allows us to check if a process is already running

Without posix_kill a cron job would run the risk of running many Robin socket processes - BAD!

XAMPP does not support posix_kill (at least we could not seem to make it work)

XAMPP still works well for a testing server but we do not automatically check the socket server

If your server PHP does not support posix_kill - for instance if your server is XAMPP 

then follow these steps carefully:

	1. Do not use the admin site to start robin
	2. Find this line in the robin.php file:
		if (RunCheck::checkExists($logroot."robin_runcheck.txt")) {exit;}
	3. Comment out the line like so:
		// if (RunCheck::checkExists($logroot."robin_runcheck.txt")) {exit;}
	4. To start Robin go to http://yourdomain/robin/robin.php in a Web browser
	5. The Web browser will hang as the socket goes "forever" - just close the browser
	6. Robin should now be running and a robinlogs directory is created with a robin_forcestop.txt file 
	7. Before you run the robin.php page again make sure you delete this file
	
Use the debugging feature on the admin site to help solve any unforseen problems.

You can see how the debugging logs are written to so you can carefully check other places too

Do not leave the debugging log running as it will get big quickly

Have a read over any comments on the site and if you have a problem leave a comment ;-)



------------------------------------------------------
FLASH
------------------------------------------------------

The provided samples will only work once you install your classes and do the following:

	In your Robin class, put your server address as instructed in the class

	Then <ctrl enter> each of your sample FLA files to make swf files

	Then your sample links in the admin should work when Robin is running

Read the comments in the sample .as files in the samples/samples/ folder

and the Robin.as file in the com/danzen/utilities/ folder

In the samples there is a concise explanation on how to install classes

The section below is for those who have not used classes or not used classes often

--------
CLASSES
--------

Classes are what objects are made from in Object Oriented Programming (OOP).
Pretty well everything is made from a class - numbers, strings, dates, movieclips, etc.
Many classes are provided by Flash (Adobe) but we can also make our own "custom" classes 
Classes are stored in text files with the .as extension
Classes are organized in folders and we call these folders "packages"
Each FLA has what is called a document class that gets run when the swf starts
You can specify the document class in the properties panel when you click on the stage. 
The document class should NOT be one of the Dan Zen provided classes.  
See the provided FLA's for examples of document classes.  
You need will need to import any provided Dan Zen classes into your document class
Please see http://www.flickr.com/photos/danzen/1382459629/ at full size for visual reference.
See below for a recommended installation

--------
HOW TO INSTALL CUSTOM CLASSES
--------

A "class path" is how classes are located in Flash
you should make a folder called "classes" in a generic location on the computer
"generic" means do not put the classes folder in the same folder as a specific project
once you have made the classes folder - for example c:\classes then add the folder to the class path
like so: from the top Flash menu choose Edit > Preferences > ActionScript - ActionScript 3 Settings 
then use the + sign for the source path box to add the path to your classes folder

people who distribute classes often use the reverse domain technique
this allows you to put many people's classes in your classes folder without overwriting other classes
com/danzen is how Dan Zen distributes classes		
so you should have a com folder in your classes folder and a danzen folder in the com folder
folders that contain classes are called packages so com is a package and danzen is a package
danzen distributes classes in a variety of packages like utilities, effects, interfaces, etc.
any further packages like these should also be added to the danzen package 
inside these are the classes (with .as extensions)

--------
HOW TO USE CLASSES IN YOUR DOCUMENT CLASS
--------

The samples show you how to set up a document class that calls the provided class
the document class is the class that gets called when you test or publish your FLA
the document class starts with a package declaration as its first line
just inside that you need to import com.danzen.packagename.ClassName; along with other classes you use
next, there is a class definition and inside that is a constructor method that gets run first
in your constructor (or some other method), you create a new object from the provided class like so:
var myObject:ClassName = new ClassName(); replacing ClassName with the provided class
if you need access to your class in more than one method then you can set a property on the class
just above your constructor you declare your property:
private var myObject:ClassName;
and in your constructor (or some other method), you assign your new object to the property:
myObject = new ClassName();
follow the examples for specific usage as some classes require parameters (extra information)

Consider taking interactive multimedia at Sheridan if you want to learn all this ;-)

http://imm.sheridanc.on.ca
http://interactivemultimedia.wordpress.com

All the best,


Dan Zen
http://www.danzen.com
http://danzen.wordpress.com

mad inventor
meets internet
finds peace


