prev | index | next

SWF5-SET variable
5
12
549 bytes
1247 bytes
2002-08-20 00:00:00
2007-09-13 01:36:16
Oldes (oliva.david@seznam.cz)


To show how to set dynamically created variables

Since 20.8.02 the set function is able to set dynamically created variables.
The syntax is:
set [some expression] = value or expression
and is equal to:
set(variable,expression);
in the ActionScript.
The sign = after the 'set' block is not necessary!

(swf5-setvar.rswf)
background 153.165.139
fnt_Arial: Font [name "Arial" bold]
txt_test: EditText info 320x100 [
    Font [fnt_Arial 12] border
]
place txt_test
doAction [
    b: 1 a: "var" c: "ccc"
    set [a add "_number_" add b] "Rebolution"
    set ["test" add 2] = "random number " add random 100
    set ["blk"] [1 "2.value in block" 3]
    set ["test" add 3] make date! []
    set ["obj"] make object! [value: 100]
    set ["obj.va" add "lue"] var_number_1
    info: rejoin [
        {Variable 'var_number_1' is: } var_number_1
        {^/Variable 'test2' is: } test2
        {^/Variable 'blk' is a block: } blk.toString()
        {^/Variable 'test3' is: } test3
        {^/Variable 'obj.value' is: } obj.value
    ]
]

showFrame
end