prev | index | next

MX-Local connection - sender
6
20
655 bytes
1431 bytes
2002-06-04 00:00:00
2002-06-04 14:22:14
oldes (oliva.david@seznam.cz)


local connection object demonstration - sender

For more info look at this document:
How to use local connection objects .

(mx-localconn-s.rswf)
background 152.174.149
fnt_Courier: Font [name "Courier New" bold]
shp_frame: shape [
    edge width 5 color #b0c4de fill color #006400
    box 0x0 295x20
    no edge fill color #000000
    box 295x0 320x20
]
txt_test: EditText x 295x20 [
    color #00ff7f Font [fnt_Courier 12]
]
txt_test2: EditText y 25x20 [
    color #ff4500 Font [fnt_Courier 12]
    ReadOnly layout [align: 'center]
]
place [shp_frame txt_test]
place txt_test2 at 296x0
es: emptySprite
sensor: place es [
    actions [
        load [
            constantPool [sendingLC infoObject _parent y]
            sendingLC: make LocalConnection
            sendingLC.onStatus: func[infoObject][
                if infoObject.level = "error" [
                    _parent.y: "KO"
                ]   _parent.y: "OK"
            ]
        ]
        keyDown [
            constantPool [sendingLC "lc_test" x]
            sendingLC.send("lc_test" "tick")
            if Key.getCode() = 'enter [
                with _parent [
                    sendingLC.send("lc_test" "processMSG" x)
                    x: ""
                ]
            ]
        ]
    ]
]
showFrame
end