Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
I_DONT_WANT_A_NICK #1
AMFPHP and Flex3
Using AMFPHP and Flex3, got this remote object:.
But, I'm getting an error:
Client.Error.MessageSend
Send Failed
Don't know what caused it or anything.
Any ideas??
<mx:RemoteObject id="RosterService"
source="Roster"
destination="amfphp"
fault="faultHandler(event)"
showBusyCursor="true" >
<mx:method name="getRoster"
result="getRosterHandler(event)"
fault="faultHandler(event)">
<mx:arguments>
<teamid>{teamid.text}</teamid>
<teampin>{teampin.text}</teampin>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
This code (in my mxml):
[Bindable]
private var dp:ArrayCollection;
private function faultHandler(fault:FaultEvent):void
{
Alert.show(fault.fault.faultString, fault.fault.faultCode.toString());
}
private function getRosterHandler(evt:ResultEvent):void
{
dp = new ArrayCollection( ArrayUtil.toArray(evt.result) );
}
This control:
<mx:DataGrid id="roster_list"
x="10"
y="61"
width="345"
dataProvider="{dp}" >
<mx:columns>
<mx:DataGridColumn headerText="playerid" dataField="playerid"
visible="false"/>
<mx:DataGridColumn headerText="Player Name" dataField="playername"/>
<mx:DataGridColumn headerText="Jersey" dataField="jersey"/>
<mx:DataGridColumn headerText="Age" dataField="age"/>
</mx:columns>
</mx:DataGrid>
The PHP class returns a mySQL dataset or an error message:
PHP Code:
<?php
class Roster
{
function Roster()
{
$this->methodTable = array(
"getRoster" => array(
"description" => "Returns a Team's Roster based on passed TeamID and
TeamPIN",
"arguments" => array("teamid", "teampin"),
"access" => "remote"
)
);
}
function getRoster($teamid, $teampin)
{
include("/home/dbutil/dbconnect.inc");
mysql_connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$pinsql = "SELECT PIN from teams WHERE id = $teamid";
$pinquery = mysql_query($pinsql);
if ((mysql_num_rows($pinquery) == 0) || (mysql_result($pinquery, 0) <>
$teampin)) {
return "You did not enter a valid PIN for the team selected, try again.";
} else {
$teamsql = "SELECT playerid, playername, jersey, age FROM players WHERE
".
"teamid = $teamid ORDER BY jersey, age";
$teamquery = mysql_query($teamsql);
if (mysql_num_rows($teamquery) > 0) {
return $teamquery;
} else {
return "There are no players for this team, to add players, click the
Add Player button.";
}
}
}
}
?>
I_DONT_WANT_A_NICK Guest
-
INSERT statements in AMFPHP
I am unable to do an insert, despite a week of trying. Here is my AMFPHP class, with some passwords omitted: I think my error has to do with... -
AMFphp
Hello, Is there anyone who has some experience with AMFPHP? (www.amfphp.org). I have trouble setting it up and I wonder if anyone has succeeded... -
migrating from php/mysql/amfphp to microsoft sql 2003
Hi There Have running (internally) flash app with php/amfphp and mySQL Customer wants to migrate to SQL2003. I assume that this is possible, but... -
URGENT HELP: Flex 2 with PHP (amfphp)
Hello. (sorry, but my english is not very well...) Can i developer a app using flex 2 with php(amfphp)? I need select data in mysql database... -
Flex2.0 and amfphp
Hi guys, I've just start to give a look at Flex2.0 but I can't make my application working. I have a simple mxml page which connect to a php... -
I_DONT_WANT_A_NICK #2
Re: AMFPHP and Flex3
More details on the error:
code:
Client.Error.MessageSend
Message:
Send failed
Detail:
Channel.Connect.Failed error NetConnection.Call.BadVersion: : url:
'http://localhost/amfphp/gateway.php'
I_DONT_WANT_A_NICK Guest
-
I_DONT_WANT_A_NICK #3
Re: AMFPHP and Flex3
Ok, I've installed amfphp-1.9.beta.20080120.zip and now it enters the getRosterHandler but nothing is shown in the grid.
I_DONT_WANT_A_NICK Guest



Reply With Quote

