rebol [
title: "local-with-networking"
type: 8
file: %local-with-networking.swf
background: 255.255.255
rate: 25
size: 320x350
author: "Oldes"
email: oliva.david@seznam.cz
date: 16-03-2006
purpose: {Just an example how to set local-with-networking flag in your file.}
comment: {The same thing you can do with The Local Content Updater tool. More info about security (in Flash 8) is available here. (There is nothing to see in this example (it just sets the flag in tag number 69 to 1 if you want to allow it or 0 in not)}
]
local-with-networking on
;or:
;network privileges on
;or:
;allow networking on
;!!! it must be the first tag !!!
background 255.255.255
es: EmptySprite
m: place es
fnt_arial: Font [name "_sans"]
txt_data: EditText 'value 315x100 [
WordWrap html text "Loaded" ReadOnly
Color #000000 Font [fnt_arial 12]
]
place txt_data
doAction [
;HERE ARE SOME TESTS
;??
;System.exactSettings: true ;<- this allow to load files from other domains
;System.security.allowDomain("box.lebeda.ws")
;will be the file from foreign domain loaded?
m.loadMovie("http://laco.wz.cz/elasticboy.swf")
value: "test"
data_out: make LoadVars []
data_in: make LoadVars []
data_out.c: "hello"
data_out.sendAndLoad("http://box.lebeda.ws/~hmm/rswf/msg.php" data_in "get" )
;the data are not loaded if I'm running it from localhost,
;but the local-with-networking seems to have no effect:-(
data_in.onLoad: func[][
value: rejoin [value "
" data_in.value ""]
]
]
show 14 frames
doAction [
_global.socket: make XMLSocket
myOnConnect: func[success][
value: reform [value "
socket connection:" success]
]
socket.onConnect: myOnConnect
socket.onData: func[src /local data][
value: value add src
]
socket.connect("box.lebeda.ws" 9000)
]
stop
showFrame
end