Topic: execute remote script with virtual keyboard

Hello,
I'm trying to make a local flash in order to execute a script on a server.
I'm newby in flash.
I try to inspire me with some existing code but i don't manage execute script on the remote server (trying to use the load/onload function but I always have an error response from onload).
The other thing is I would like to have a keyboard like the one in the control panel when configuring IP address.
I see in the forum that someone made a keyboard but it's web site is down and so the source code isn't available.
Is there someone who can help me or have examples for both things?
Thanks a lot

2 (edited by thios 2008-03-03 01:57:16)

Re: execute remote script with virtual keyboard

For information this is my code for execute a script.
For the moment I try to load a XML file ut it doesn't works.
The XML file is ok for a classic web browser.


wifiButton.onRelease = function() {
var wifi:XML = new XML();
wifi.onLoad = function () {
        if (success) {
                                               testText.htmlText = ['success'];
        } else {
            testText.htmlText = ['error'];
        }
    }
   
var result = wifi.load("http://192.168.1.1:81/test1.xml");
};

stop();




and the result on th chumby is:

2008-03-03 10:55:43 NetStreamRequest::Open(1): Opening protocol 'http://' host '192.168.1.1' port 81 location '/test.xml'
2008-03-03 10:55:43 NetStreamRequest::Open(1) opened http object id 1
2008-03-03 10:55:43 NetStreamRequest::ProcessHeaders(1) content-type: text/plain
2008-03-03 10:55:43 NetStreamRequest::Step(1) done, closing stream (90 of 0 bytes, avail=0) status=200

Re: execute remote script with virtual keyboard

status=200 means that it loaded OK

wifi.onLoad = function () {

should be

wifi.onLoad = function (success) {

as you are testing for the success variable but it is not defined anywhere. it should be the variable that is passed to the onLoad function

Re: execute remote script with virtual keyboard

ok thanks for that.
I don't find the way to recover the data I download.
Do you know the method.
To display it in a text box for example.
Thanks

Re: execute remote script with virtual keyboard

http://www.actionscript.org/resources/a … Page1.html

In your case: wifi.toString();

Re: execute remote script with virtual keyboard

I tried that but it didn't work.
In fact I made a mistake in using it. It's works well now.
Thanks again.

Re: execute remote script with virtual keyboard

No worries

Re: execute remote script with virtual keyboard

In fact, It works well, but onl one time.
The flash movie need to be restarted.
Otherwise, the text in the text field doesn't change even if the XML changed.

the log for the second time is:
2008-03-04 19:18:46 NetStreamRequest::Open(3): Opening protocol 'http://' host '192.168.2.1' port 81 location '/cgi-bin/status-wifi.sh'
2008-03-04 19:18:46 NetStreamRequest::Open(3) opened http object id 2
2008-03-04 19:18:46 NetStreamRequest::ProcessHeaders(3) content-type: text/plain
2008-03-04 19:18:46 NetStreamRequest::Step(3) done, closing stream (9 of 9 bytes, avail=0) status=0

Does it necessite a reinitialize or something like that?

Re: execute remote script with virtual keyboard

Hmm, not sure. Perhaps the document has been cached?

To force a reload try calling the URL with some time related value added as a parameter on the end: http://192.168.2.1:81/cgi-bin/status-wi … 2472617348

Otherwise, read up on XML and Flash some more: http://www.webreference.com/xml/column82/