{NEW} AS3 Flash/Flex Examples

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

{NEW} AS3 Flash/Flex Examples

Post 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
Last edited by Lapo on 25 Jan 2010, 22:50, edited 1 time in total.
Lapo
--
gotoAndPlay()
...addicted to flash games
rickywh
Posts: 25
Joined: 23 Jan 2010, 01:48
Location: Canada
Contact:

sticky this

Post by rickywh »

This should be sticky thread
Ricky
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

right, done!
Lapo
--
gotoAndPlay()
...addicted to flash games
mixart
Posts: 95
Joined: 08 Aug 2007, 20:32

Post by mixart »

Awesome!

Please also correct these AS3 errors in the docs...
http://forums.smartfoxserver.com/viewtopic.php?t=6483
danielfck
Posts: 12
Joined: 24 Sep 2009, 03:12
Contact:

Post 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?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post 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.
Paolo Bax
The SmartFoxServer Team
danielfck
Posts: 12
Joined: 24 Sep 2009, 03:12
Contact:

Post 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?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

No idea.
Are you sure you have no compile errors?
Paolo Bax
The SmartFoxServer Team
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post 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?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Didn't you notice this in the 1st post?
Which of the examples is giving you the error?
Lapo
--
gotoAndPlay()
...addicted to flash games
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post 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?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
dleimbach
Posts: 6
Joined: 21 Feb 2010, 19:39

Post by dleimbach »

How do you change the ip address in these tutorials?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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.
Lapo
--
gotoAndPlay()
...addicted to flash games
dleimbach
Posts: 6
Joined: 21 Feb 2010, 19:39

Post 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)
Post Reply