Try use amf3 @service.amfrpc3('domain') def service1(): return "test"
and gateway.connect("http://127.0.0.1:8000/FlashSoldat_Server/default/call/ amfrpc3/"); gateway.connect("http://127.0.0.1:8000/FlashSoldat_Server/default/ call/amfrpc/"); On Dec 1, 4:55 pm, "dustin.b" <dustin.bens...@googlemail.com> wrote: > hi, > im stuck in getting flash to work with (web2py) amfrpc. i must confess > that i am very limited in my flash knowledge so far. > > i tryed the sample from the book and getting into "import" problems. i > think this is related to the flash version. im using flash cs5 and > flashdevelop .. with as3. > > i installed pyamf so there is no "missing lib warning" if i invoke the > call/amfrpc (3) ; and running w2p from source. im a little confused > with the libs an the flash/flex side ... the only version i found > which is not causing "import errors" is the following > > public class Main extends MovieClip > { > > public function Main() { > > var gateway:NetConnection = new NetConnection(); > gateway.addEventListener(NetStatusEvent.NET_STATUS , > gateway_status); > > gateway.connect("http://127.0.0.1:8000/FlashSoldat_Server/default/ > call/amfrpc/"); > var resp:Responder = new Responder(show_results, > on_fault); > gateway.call("service1", resp); > > trace("main started"); > stage.stageWidth = 100; > stage.stageHeight = 100; > > var textlabel:TextField = new TextField(); > textlabel.x = (stage.stageWidth - textlabel.width) / > 2; > textlabel.y = (stage.stageHeight - textlabel.height) > / 2; > > textlabel.text = "flex hello wold!"; > > addChild(textlabel); > } > > private function gateway_status(event:NetStatusEvent):void { > > trace("Level 0: "+event.info.level+" Code: > "+event.info.code); > if (event.info.code == "NetConnection.Connect.Success") { > trace("--- connected to: " + "hier"); > } > } > > private function show_results(event:ResultEvent):void > { > trace(event.result.toString()); > } > > private function on_fault(event:FaultEvent):void > { > trace(event.fault.message); > } > > } > > } > > on w2p side there is > > @service.amfrpc > def service1(): > return "test" > > in the default controller. > > every time i try to connect i get a "Level 0: error Code: > NetConnection.Call.Failed > " from my gateway_status handler > > what am i doing wrong?