click
09-22-2009, 05:49 PM
I have problem with Flex 3(AS3,PHP,AMFPHP)..if someone is good and willing to help..please contact me
mail,msn,gtalk:mstanarevic@gmail.com
skype: mstanarevic
Thank you!
..it's hard to post and explain it here...but let's try
I am getting this error
TypeError: Error #1010: A term is undefined and has no properties.
at comp::SERVERS/founded()[C:\Users\click\Documents\Flex Builder 3\Bircuz-Gaming\src\comp\SERVERS.mxml:31]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.amfphp.callers::Server/_read()[C:\Users\click\Documents\Flex Builder 3\Bircuz-Gaming\src\com\amfphp\callers\Server.as:35]
with this code
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"
creationComplete="{init()}"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.Application;
import com.amfphp.callers.AMFPHPCaller;
import com.amfphp.callers.Server;
import com.amfphp.events.AMFPHPEvent;
import com.amfphp.events.AMFPHPErrorEvent;
import com.amfphp.AMFPHP;
public var caller:Server;
public var Object2:Object;
[Bindable]public var grid2:ArrayCollection;
public function init(...res):void
{
AMFPHP.GATEWAY = "http://localhost/amfphp/gateway.php";
caller = new Server();
caller.addEventListener(AMFPHPEvent.ITEMS_FONDED, founded);
caller.read();
}
public function founded(e:AMFPHPEvent):void
{
grid2 = new ArrayCollection(e.result.ServerInfo.InitialData);
}
]]>
</mx:Script>
<mx:DataGrid x="49" y="62"
id="grid"
dataProvider="{grid2}"
>
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="0"/>
<mx:DataGridColumn headerText="Column 2" dataField="1"/>
<mx:DataGridColumn headerText="Column 3" dataField="2"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
but when i change grid2 with object ..i get result but he is lost when function founded is finished i.e when it comes to this line (which goes right after function founded) dispatchEvent(new AMFPHPEvent(AMFPHPEvent.ITEMS_FONDED,false, false ,o));
and i get this error
Object2\r\n = <errors during evaluation>
No such variable: Object2
Any Ideas?
best regards and sorry for bad english
mail,msn,gtalk:mstanarevic@gmail.com
skype: mstanarevic
Thank you!
..it's hard to post and explain it here...but let's try
I am getting this error
TypeError: Error #1010: A term is undefined and has no properties.
at comp::SERVERS/founded()[C:\Users\click\Documents\Flex Builder 3\Bircuz-Gaming\src\comp\SERVERS.mxml:31]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.amfphp.callers::Server/_read()[C:\Users\click\Documents\Flex Builder 3\Bircuz-Gaming\src\com\amfphp\callers\Server.as:35]
with this code
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"
creationComplete="{init()}"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.Application;
import com.amfphp.callers.AMFPHPCaller;
import com.amfphp.callers.Server;
import com.amfphp.events.AMFPHPEvent;
import com.amfphp.events.AMFPHPErrorEvent;
import com.amfphp.AMFPHP;
public var caller:Server;
public var Object2:Object;
[Bindable]public var grid2:ArrayCollection;
public function init(...res):void
{
AMFPHP.GATEWAY = "http://localhost/amfphp/gateway.php";
caller = new Server();
caller.addEventListener(AMFPHPEvent.ITEMS_FONDED, founded);
caller.read();
}
public function founded(e:AMFPHPEvent):void
{
grid2 = new ArrayCollection(e.result.ServerInfo.InitialData);
}
]]>
</mx:Script>
<mx:DataGrid x="49" y="62"
id="grid"
dataProvider="{grid2}"
>
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="0"/>
<mx:DataGridColumn headerText="Column 2" dataField="1"/>
<mx:DataGridColumn headerText="Column 3" dataField="2"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
but when i change grid2 with object ..i get result but he is lost when function founded is finished i.e when it comes to this line (which goes right after function founded) dispatchEvent(new AMFPHPEvent(AMFPHPEvent.ITEMS_FONDED,false, false ,o));
and i get this error
Object2\r\n = <errors during evaluation>
No such variable: Object2
Any Ideas?
best regards and sorry for bad english