Jonesey007
asked on
How to pass a string using HTTP Service
Hi, im trying to pass a string through to a Ruby on Rails backend, at the moment im using:
<mx:Button x="163" y="92" label="Search" width="199" click="searchByType.send(' Hardware') ; "/>
But its not working, anyone know how i can do this?
thanks
<mx:Button x="163" y="92" label="Search" width="199" click="searchByType.send('
But its not working, anyone know how i can do this?
thanks
ASKER
Thanks for the reply, here's the error im getting, it seems to think im passing Hardware as a variable and not as a String
ReferenceError: Error #1065: Variable Hardware is not defined.
at global/flash.utils::getDef initionByN ame()
at mx.utils::DescribeTypeCach e$/describ eType()[E: \dev\3.0.x \framework s\projects \framework \src\mx\ut ils\Descri beTypeCach e.as:89]
at mx.utils::ObjectUtil$/getC lassInfo() [E:\dev\3. 0.x\framew orks\proje cts\framew ork\src\mx \utils\Obj ectUtil.as :780]
at mx.rpc.http::HTTPService/send()[E:\dev\3.0.x\frame works\proj ects\rpc\s rc\mx\rpc\ http\HTTPS ervice.as: 701]
at mx.rpc.http.mxml::HTTPServ ice/send() [E:\dev\3. 0.x\framew orks\proje cts\rpc\sr c\mx\rpc\h ttp\mxml\H TTPService .as:217]
at AssetDatabase/___AssetData base_Butto n4_click() [C:\Test\s rc\AssetDa tabase.mxm l:109]
Thanks
Pete
ReferenceError: Error #1065: Variable Hardware is not defined.
at global/flash.utils::getDef
at mx.utils::DescribeTypeCach
at mx.utils::ObjectUtil$/getC
at mx.rpc.http::HTTPService/send()[E:\dev\3.0.x\frame
at mx.rpc.http.mxml::HTTPServ
at AssetDatabase/___AssetData
Thanks
Pete
ya the send method take a Object as param let me digg in to it further
for now check it this works
add the following lines
<mx:Object id="myObj" name="Hardware" />
<mx:Button x="163" y="92" label="Search" width="199" click="searchByType.send(m yObj); "/>
for now check it this works
add the following lines
<mx:Object id="myObj" name="Hardware" />
<mx:Button x="163" y="92" label="Search" width="199" click="searchByType.send(m
ASKER
Hi, sorry for the long reply ive been away on business:
Unfortunately that didnt work, this is what I did,
private var myObj:Object = "Hardware";
<mx:Button x="163" y="92" label="Search" width="199" click="findByType.send(myO bj); "/>
This produced the same error as before ????
Thanks for the help,, really appreciate it
Unfortunately that didnt work, this is what I did,
private var myObj:Object = "Hardware";
<mx:Button x="163" y="92" label="Search" width="199" click="findByType.send(myO
This produced the same error as before ????
Thanks for the help,, really appreciate it
NO Please try this directly
<mx:Object id="myObj" name="Hardware" />
else specify [Bindable] on top of the above myObject declaration. try and let me know.
<mx:Object id="myObj" name="Hardware" />
else specify [Bindable] on top of the above myObject declaration. try and let me know.
ASKER
hmm, i tried <mx:Object id="myObj" name="Hardware" /> originally but get a compile error stating (component declarations are not allowed here(note visual children must implement mx.core.ICIComponent))
So i tried declaring the object in the ActionScript area, ive now tried making it bindable and that didnt help either?
So i tried declaring the object in the ActionScript area, ive now tried making it bindable and that didnt help either?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats better, the pair option works fine, thanks for the help
you can follow this example also
http://blog.flexexamples.com/2007/10/29/passing-parameters-to-an-httpservice/
but I think their is nothing wrong in the way you are doing it, and you are getting a n/w exception. check the fault message you will get to know better