Page 1 of 2

{NEW} AS3 Flash/Flex Examples

Posted: 19 Jan 2010, 08:23
by Lapo

Hello,
we have just finished porting some of the AS2 tutorials for Flash CS3 and Flex in Actionscript 3.

Each example comes with fully commented source code:

* Avatar Chat tutorial for Flash CS3 (or higher)
* Avatar Chat tutorial for Flex 2 (or higher)
* Realtime Maze tutorial for Flash CS3 (or higher)
* Realtime Maze tutorial for Flex 2 (or higher)

The related original AS2 tutorials are found here:
http://www.smartfoxserver.com/docs/docP ... vatarChat/
http://www.smartfoxserver.com/docs/docP ... ltimeMaze/



Download the tutorials

sticky this

Posted: 25 Jan 2010, 21:27
by rickywh
This should be sticky thread

Posted: 25 Jan 2010, 22:50
by Lapo
right, done!

Posted: 26 Jan 2010, 19:31
by mixart
Awesome!

Please also correct these AS3 errors in the docs...
http://forums.smartfoxserver.com/viewtopic.php?t=6483

Posted: 01 Mar 2010, 07:45
by danielfck
hi
first of all, thank you for posting up the AS3 version!
you really save my day!

by the way, in either one of the Flex project, i noticed that in the FLA's library have the Flex component.

I do know it's possible to install the Flex Component Kit for Flash CS4. but how do you make that movieclips in the Library into a proper SWC?

Posted: 01 Mar 2010, 10:08
by Bax
danielfck wrote:I do know it's possible to install the Flex Component Kit for Flash CS4. but how do you make that movieclips in the Library into a proper SWC?
When you in install the Flex Component Kit in Flash, the "Export SWC" in the FLA properties is checked. When you publish the FLA, also the SWC file is created.

Posted: 02 Mar 2010, 00:54
by danielfck
yeah, that is what i did exactly. but i still don't see the SWC anywhere. i know it should reside at the export location just the same as the SWF. what could be wrong?

Posted: 02 Mar 2010, 08:13
by Bax
No idea.
Are you sure you have no compile errors?

Posted: 06 Mar 2010, 07:56
by Soleil
Where is the tutorial? When I download this I just get a single fla file and a globals.as file. When I compile the fla and enter a username, I get this:
Internal error:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
If this is a tutorial shouldn't there be some instructions?

Posted: 06 Mar 2010, 09:21
by Lapo
Didn't you notice this in the 1st post?
Which of the examples is giving you the error?

Posted: 06 Mar 2010, 19:55
by Soleil
Thanks, that helps!

I get the "room list empty" error on the Maze game, but only the first time I run it. After that it works ok. I can open two different copies of the swf and see the two different players moving. The next step would be to see if I could get this example up on a real server and get two different computers to log in and play. Are there instructions on how to do that somewhere?

Posted: 07 Mar 2010, 15:34
by Lapo
You should deploy SmartFox on the real server and then publish the the SWF possibly on the same machine, for example in the root folder of the embedded web-server {sfs-install-dir}/Server/webserver/webapps/root

Posted: 08 Mar 2010, 09:21
by dleimbach
How do you change the ip address in these tutorials?

Posted: 08 Mar 2010, 09:27
by Lapo
For most of the Actionscript 2 examples you have to open the sources, change the IP/port values and recompile them.
Most of the Actionscript 3 examples are based on an external XML configuration file. Those that don't should be recompiled.

Posted: 08 Mar 2010, 09:39
by dleimbach
These two tutorials are avatarChat and realtimeMaze.

They both contain a <tutorial name>.fla and a global.as. It looks like the ip address is set in the connector component. I change it and save, but it still tries to connect to 127.0.0.1. Is there someplace else I should change it?

(I should say, yes I am recompiling)