Hey everyone! I’m back with another experiment in Flash! This time I’m using another class path by Flash master Dan Zen! It’s called Robin. For my small demo I decided to mix things up and use avatars from the Rap Board. My ambition was initially to create a demo that involved the disembodied heads of everyone’s favourite rap stars that you could make talk in one line sentences via a chat prompt (the text would float underneath the head). Due to time constraints I was only able to get the heads moving and randomizing upon entering a “circle”. I called it Chizzat.
Only 5 people are allowed in the room at a time, and each person receives a unique avatar based on the order they enter the room. Users can drag their little head avatar over a circle in the corner and randomly generate a new one (out of a set of about 15!).
Easier shown than said, so here’s a pic:
Note the two windows and that each avatar has a different glow around it. The glow indicates which avatar the user can control on their end. You can see the circle in the corner, too, with the caption “change yo’ dude, change yo’ mood”. It’s kind of fun to try and land on a new rap star every time.
To do this all I had to do was send the information to the other users with a handy “setProperties();” function given to us in Flash. Everytime data changes Robin searches and grabs it for you across the network. See my code:
It really wasn’t that hard to do. Once you get used to the framework of Robin and play around with it. The hardest part was getting Robin to display locally on my system! Usually you’d just load this stuff on to a web server with MySQL and Apache active. If you’re like me — just a dude tryin’ to get by — don’t be intimidated by the network stuff. I have ZERO back end experience and I was able to get it up and running with 6 simple steps:
1) Place the Robin working files in your C drive under xampp (get xampp installed first) and the htdocs folder. Plop everything in there!
2) Open Robin.as and change the server name/address to localhost (all one word)
3) Open robin.php and comment out line 33 – it’s a run check for the server and since we’re not connecting to an external server we don’t need it — it will just give us an error.
4) Publish the .FLA files in the samples folder so you have a .swf and .html file!
5) Open up a browser and dial localhost/robin/robin.php – NOTE: This will just continually load over and over. That’s fine! It’s not SUPPOSED to go anywhere except run the robin.php file so users can connect to each other.
6) Open a new tab and dial up your robin sample — localhost/robin/samples/ball.html is the one I tweaked for Chizzat.
That’s pretty much it!
If you want to try it please download Robin and play around. It was a lot of fun and in about 3 hours I was able to get a half decent looking multi-user room up and running (including graphic design!). Dan Zen has other cool classes, too. Read below for my venture in to gesture technology with ostrich. Together he calls all of these bird classes Flash Feathers.
That’s it fellas. Till next time!
– Andrew Corway