OpenSpace not working on an internet page?

Post here your questions about the OpenSpace 1.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

OpenSpace not working on an internet page?

Post by Senshi »

Hi there,

I have a pretty weird problem going on here. The file works fine when I test (ctrl + enter) it in Flash, but it fails on me once I put it on a php or htm page. Am I doing something wrong? The script stops right after connecting to the database. This is the first line that doesn't work anymore is: smartFox.loadConfig("config/sfsClient.xml", true). Any help will be much appreciated =)

~Senshi
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

DId you upload the config folder together with the swf? Also, the sfsClient.xml contain connection parameters that you should modify in order to make the Flash application connect to the right SmartFoxServer instance.
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Make sure you don't have problems with the Flash player security sandbox.
Take a look here -> http://www.smartfoxserver.com/docs/docP ... ooting.htm
Lapo
--
gotoAndPlay()
...addicted to flash games
Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

Post by Senshi »

Thanks for the replies but it´s still not working. I uploaded the entire folder to my xampp -> htdocs -> greedisland folder (including the fla for testing purposes). Now when I open the fla in this directory, it works without problems. However, when I export the swf and place it on my page, it stops right after connecting to the DB and checking the login data.
Also, Lapo, I tried a lot of troubleshooters that were described there, but to no effect. Even with my firewall turned off it didn't work.

~Senshi
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Can you test one of the basic examples provided with SmartFoxServer?
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

it stops right after connecting to the DB and checking the login data.
How is this done? Via SFS or is it a dynamic page?
Lapo
--
gotoAndPlay()
...addicted to flash games
Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

Post by Senshi »

I tried an example like you said by opening the accompanied html page, but that didn't work either. It just doesn't load.
The MySQL DB is called upon via a PHP script and the Zend Framework.
I really don't know what I'm doing wrong here.. =(

~Senshi
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Can you please write a list of the steps you did to publish the example?
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The 1st thing to check is: are you loading the crossdomain policy file from socket? If no, that's the first thing to fix.
Lapo
--
gotoAndPlay()
...addicted to flash games
Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

Post by Senshi »

Bax, I used the HTML file that was in the folder, but these are my steps for the game:

1) File > export > export movie > greedisland.swf
2) Copy the folder containing the swf, libraries, maps, etc. to C:/XAMPP/htdocs/greedisland (making the full path C:/....../greedisland/greedislandfiles)
3) In a dreamweaver document I make a new AP Div Tag and place the swf in the tag.

And I have SFS running, of course. ;)


Lapo, what do you mean by loading it from the socket? I found the crossdomain.xml in my htdocs folder containing this:

<?xml version="1.0" ?>
- <cross-domain-policy>
<allow-access-from domain="77.251.103.247" />
<allow-access-from domain="localhost" />
</cross-domain-policy>

~Senshi
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Senshi wrote:Lapo, what do you mean by loading it from the socket? I found the crossdomain.xml in my htdocs folder containing this:
What I mean is explained step by step in the document that I already suggested here -> http://forums.smartfoxserver.com/viewto ... 6889#16889

Please take a look at the socket policy loading.
Lapo
--
gotoAndPlay()
...addicted to flash games
Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

Post by Senshi »

I'm actually doubting it's that.. I've tried allowing it from domain * and placing it in the server folder, web roor folder and even adding it to the sfs config.xml file.

I was just thinking: Would it matter where the SFS is running? I.e.: would I need to copy all SFS files to my site-root and start it from there?
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Senshi if you're running Flash Player 9.0.115 or later you should be aware of the new restrictions.
From Adobe's documentation:
Specifically, the strict rules always require permission from a socket policy file in order to make a socket connection, even when the socket server appears to be the same as a connecting SWF file's domain of origin. In addition, beginning with version 9,0,115,0, Flash Player matches socket connections to their corresponding socket policy files based on IP addresses, not just domain names.
always require permission from a socket policy file in order to make a socket connection

Source: http://www.adobe.com/devnet/flashplayer ... urity.html
Further info: http://www.smartfoxserver.com/whitepape ... index.html
Lapo
--
gotoAndPlay()
...addicted to flash games
Senshi
Posts: 12
Joined: 02 Nov 2008, 21:23
Location: the Netherlands, Friesland

Post by Senshi »

Ugh, I feel like such a noob now, but I really can't figure it out.. I've tried wresteling though all the text and made some changes in my crossdomain.xml, loading it in flash etc, but it just doesn't work. However, I also found out that when I test the SWF without embedding it on a page, it fails to connect because of the flash player configuration, though I already changed that to allow all connections. I know this is a lot to ask, but can you please tell me on a short, step-by-step basis what to do? *feels superstupid right now* x.x

~Senshi
function signature():void{
if(currentsig == boring){
readervoteboring+=1;}
else if(currentsig == ok){
readervotekeep+=1;}}
public var readervoteboring:Number = 0;
public var readervotekeep:Number = 0;
Carson
Posts: 2
Joined: 10 Feb 2009, 19:25

Having the same problem with .swf.

Post by Carson »

I had a look at the white papers, but I could not understand exactly what I would need to change in the crossdomain.xml to make the .swf version connect exactly like the .fla version.

I'm playing with the advanceBuddyList example. Everything works as expected, in the Flash (CS3) editor. But when I run the .swf, and type a log in and click 'Connect' nothing happens.

I assume that its a sandbox thing, but I don't actually know for sure.

Where are those Flash player config settings that Senshi was talking about.

Please help. Can someone explain the socket-sandbox-permissions-stuff in small words? :) Thanks
Post Reply