Hello Talal,
Sure, no big deal. As I described before, the basic HTTP communication framework is already in place. You can just make a copy of default.py from the "Be My Lips" application, and add the following code.
# top of the default.py
import messaging
# scroll to the bottom of the default.py file and replace code after "# Make changes below" to following:
# ======================
# Make changes below
# ======================
def get_policy():
print ">> sending: crossdomain.xml"
return '<?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>'
def close_server(self):
server.stopServer()
def send_sms(attributes):
print ">> SMS: " + attributes["msg"]
messaging.sms_send(attributes["phone"], attributes["msg"])
server = MyServer('127.0.0.1',2190)
server.addCallBack("crossdomain.xml", get_policy)
server.addCallBack("close_server", close_server)
server.addCallBack("send_sms", send_sms)
server.startServer()
Now, in your Flash Lite application, you can call this function via loadVariables call, something like:
loadVariables("http://localhost:2190/send_sms?phone=00112312345678&msg=This+is+testing+message", "GET");
Notice that current version of HTTP framework only supports HTTP GET requests. So, you have to pass the data in URL. I am working on an update which also supports POST. I will post it on wiki soon.
I hope this helps,
// chall3ng3r //