2

I was wondering what is everyone's experience are on why a network request would work in FlashCS5 and in a browser locally but when I post it online it fails. The survivorId is sent from the string query. Both tests were done calling a network database.

I've tried the following:

Outputting the survivorId in a text field and seeing if the parameter variables were being sent correctly.

Set the "Networking Only" option in the publish settings.

Also is there a way to output trace actions from browsers for more in depth debugging?

*EDIT: I have recreated the bug locally in a browser. Without trace actions i don't know if i can figure it out.

*EDIT2: That bug only showed up because its from localhost (apologies, this is just weird)

Here's my code, there is the "Stage" then it goes "localSurvivor"(movieClip) then in side that localSurvivor movieclip the "lPlayer" class is addChild() to localSurvivor MovieClip

Stage-> localSurivor-> lPlayer(survivorId);

On the stage is this code:

//Set localP Id
var survId:Number = root.loaderInfo.parameters.sId;
//Object(root).informationTxt.text = survId;

//Load Movie Clip Classes_____________________________

//Load Local Survivor
var localP:MovieClip = new lPlayer(survId);

//Add to stage
Object(root).localPlayer.addChild(localP);
//------------------------------------------

Then inside the lPlayer Class:

public function lPlayer(survId:Number) {
    //First retrieve player information(Position, SWF File, MapId, etc, etc)
    //Prepare data to request
    netVariables.act            = "fortDetails";
    netVariables.survivorId     = survivorId;
    netRequest.method           = URLRequestMethod.POST
    netRequest.data             = netVariables;
    netLoader.dataFormat        = URLLoaderDataFormat.VARIABLES;

    //Attach Event Handler to proccess data
    netLoader.addEventListener(Event.COMPLETE, proccessFirstRun);
}

private function proccessFirstRun(rawData:Event) {
    var playerInfo = rawData.target.data

    //Player Info Loaded, Load the player onto the board
    this.x = playerInfo.setx;
    this.y = playerInfo.sety;

    //Activate remote Survivors with fortId
    Object(root).remotes.changeLevel(playerInfo.fid);
    Object(root).zombieContain.changeLevel(playerInfo.fid);
}

//Request Data
netLoader.load(netRequest);
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Xenland
  • 510
  • 1
  • 6
  • 19

2 Answers2

1

You are probably hitting cross-site restrictions. There can be restrictions if the server you're querying is different from the server hosting the swf.

jhocking
  • 5,527
  • 1
  • 24
  • 38
  • Everything is hosted from the Saladbowlers.com website but the game it self it in an iFrame from Facebook. Do you think flash looks at the iFrame and puts up those restrictions? – Xenland Apr 01 '11 at 00:15
  • Does the game work fine directly from Faceplant... um Facebook? I think you have your answer. – d-_-b Apr 01 '11 at 01:07
  • The main game does, and most of the mini game's code is copy and paste from the main-games engine with barley any tweaks. I'd also like to note that I ran the game locally with the local database and it worked with no problems. I was really hoping someone had experience with networking to have another clue as to what was wrong. – Xenland Apr 01 '11 at 03:26
1

hm, you just added a note that you've reproduced the bug locally. In that case we no longer have any information to go on. To trace in Firefox use http://blog.coursevector.com/flashbug

jhocking
  • 5,527
  • 1
  • 24
  • 38
  • Thanks that flashbug program works more the infinite ways i can imagine, I believe you are right about crossdomain restrictions the following output shows of something related to this. Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://www.saladbowlers.com/fleshvirusv3/claimfort/claimfort.swf?sid=4 cannot load data from http://saladbowlers.com/fleshvirusv3/claimfort/lPlayer.php. – Xenland Apr 01 '11 at 03:38
  • Fixed the crossdomain.xml policiy that error dosent show up anymore but this one is the last one that stills show: SecurityError: Error #2000: No active security context. – Xenland Apr 01 '11 at 04:22