Flash 8 Compatible ?

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

Moderators: Lapo, Bax

cuber3
Posts: 14
Joined: 30 Apr 2006, 14:38
Location: Belgium
Contact:

Flash 8 Compatible ?

Postby cuber3 » 30 Apr 2006, 23:26

I'm kinda new to smartfoxserver, and i'm wondering if it is Flash 8 Compatible ?

Locally, the examples work fine, but then I tried modifying the ip inside the examples from 127.0.0.1 (localHost) to my own IP.
However, as soon as I save the fla, it starts generating errors:

Code: Select all

**Error** Scene=Scene 1, layer={ code }, frame=16:Line 56: There is no method with the name 'getSpectatorCount'.
              label += ")-(" + room.getSpectatorCount() + "/" + room.getMaxSpectators() + ")"

**Error** Scene=Scene 1, layer={ code }, frame=16:Line 230: There is no method with the name 'getSpectatorCount'.
        label += ")-(" + roomObj.getSpectatorCount() + "/" + roomObj.getMaxSpectators() + ")"

**Error** Scene=Scene 1, layer={ code }, frame=16:Line 462: There is no method with the name 'getSpectatorCount'.
           newLabel += ")-(" + room.getSpectatorCount() + "/" + room.getMaxSpectators() + ")"

Total ActionScript Errors: 3     Reported Errors: 3

[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='080' /></body></msg>


I installed the Flash API for Flash 8 successfully, and yet it doesn't work.
I also tried exporting as MX 2004 file, but that also failed (probably because I installed the API for Flash 8 ).

Is there a way to make SmartFoxServer Flash 8 compatible ?
I really want to start using it, but it refuses to work with my Flash 8 :(
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 May 2006, 06:01

SmartFoxServer is Flash 8 compatible.
The problem I see is that you're running a very old version.

Your API are version 0.8.0, while the most recent are version 1.0.2

Make sure you're using the latest version. Also, if you have troubles with installing a new version of the API over the old one using the Macromedia Extension Manager, check this post -> viewtopic.php?t=16
Lapo
--
gotoAndPlay()
...addicted to flash games
cuber3
Posts: 14
Joined: 30 Apr 2006, 14:38
Location: Belgium
Contact:

Postby cuber3 » 01 May 2006, 08:41

*edit*
It seems to work now.
I copied the 'it' folder into my project's folder, and it works, but now it won't connect :?
It doesn't say "connecting..." for 7 seconds or so, but "can't connect" right away.
The IP I specified in my Fla is correct, and as I'm modifying an example, the coding is correct.
But why doesn't it connect ?
Last edited by cuber3 on 01 May 2006, 09:11, edited 3 times in total.
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 01 May 2006, 08:54

The class path should not include the it folder.
A correct class path would be like C:\program files\SmartFoxServerPro\Flash API\sources\AS2\
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
cuber3
Posts: 14
Joined: 30 Apr 2006, 14:38
Location: Belgium
Contact:

Postby cuber3 » 01 May 2006, 09:04

Virusescu wrote:The class path should not include the it folder.
A correct class path would be like C:\program files\SmartFoxServerPro\Flash API\sources\AS2\


Thanks a lot, it works now.
I placed the 'it' folder in my swf's folder, and it works now (thanks for the classpath correction though :)).
I configured the IP in the server/config.xml file to my computer's IP address, and now it finally connects...
(I tried that before, but I forgot to reboot the server, so that's why it didn't work).
Thanks a lot for all your help, I finally got it working :)


One more question:
My PC has a dynamic IP address, so it changes every time I restart my computer.
Say I made a game with SFS and put it online, I'd have to modify the IP address in the swf every day.
Is there anything I can do about that (so the swf automatically connects to my computer's IP, even if it changes), or more likely, can I turn off the dynamic IP, so it stays the same forever ?
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 01 May 2006, 11:21

The swf needs to be aware of the server's ip, or else how is it supposed to know where to connect?
You can talk to you ISP and request a static IP address that can be accessed from internet.

You can also make your swf file so that it recieves the IP from outside the html file in wich it's embeded. This will allow you to only modifiy the html with a simple text editor each time your ip changes (each reboot I think).
This would work, given the circumstances, but you should really ask for a static IP.

DING... :!:
I just had a revelation :P.
You can put in your startup folder a shortcut that would oppen a php script on your server and rewrite the html on each restart so that the IP string is the same as your IP.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 May 2006, 13:12

Virusescu wrote:DING... :!:
I just had a revelation :P.
You can put in your startup folder a shortcut that would oppen a php script on your server and rewrite the html on each restart so that the IP string is the same as your IP.


Cool 8)
Lapo

--

gotoAndPlay()

...addicted to flash games
cuber3
Posts: 14
Joined: 30 Apr 2006, 14:38
Location: Belgium
Contact:

Postby cuber3 » 01 May 2006, 13:48

Virusescu wrote:DING... :!:
I just had a revelation :P.
You can put in your startup folder a shortcut that would oppen a php script on your server and rewrite the html on each restart so that the IP string is the same as your IP.


Could I make a php thing that would store my IP in a database ?
Then I could make my swf so that it loads the variable from the database into flash, and connecting to the value (the IP).
The question is, is there anything in PHP that can trace your IP ?
I could of course check my ip and change it manually, but it would be cool if you could just press a button and the IP would be changed instantly :)
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 01 May 2006, 14:01

Of course there is. That's the whole point > to do this automatically.

There is a Server variable that returns the IP address of the machine requesting the file

Code: Select all

<?php echo $_SERVER['REMOTE_ADDR']; ?>


Enjoy

And you don't even need to press a button. Just make your script so that it executes automatically and the ip updates withouth you needing to press buttons ;).
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
cuber3
Posts: 14
Joined: 30 Apr 2006, 14:38
Location: Belgium
Contact:

Postby cuber3 » 01 May 2006, 16:16

Virusescu wrote:Of course there is. That's the whole point > to do this automatically.

There is a Server variable that returns the IP address of the machine requesting the file

Code: Select all

<?php echo $_SERVER['REMOTE_ADDR']; ?>


Enjoy

And you don't even need to press a button. Just make your script so that it executes automatically and the ip updates withouth you needing to press buttons ;).


Alright, awesome.
I only have limited knowledge about PHP, though, and no knowledge at all about MySQL.
How would I go about setting the database up, writing the IP to the database, and loading it into flash ?


*edit*
I fixed the firewall problem.
For the ones who have the same problem:
Just go to your network connections, right-click your internet connection, go to properties, and then to the advanced tab.
There should be a button named "settings", click it.
Then click "Add", type a name for the service "SmartFoxPro" for example.
In the IP, type 127.0.0.1 (localHost) or the name of your computer.
Set external and internal ports to "9339".
Click OK, and restart your internet connection.
Your firewall should no longer block users connecting to your local server :)

Actually, maybe I could do it simpler than PHP/MySQL.
I could make the PHP script write the ip address to a text file using fopen()
Then everyone connecting would automatically load the ip from the text file using loadVars().

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 87 guests