what do you do when you are bored?
Posted: Sat Aug 18, 2012 5:17 pm
i was bored the other night at work and thought to myself "how come custom controls can't be called like first class controls?".. this is what i came up with < http://shaosean.tk/runrev/rnd/screencap ... andler.mp4 >
the two buttons are calling the "pig" command in the button "targetControl".. standard rev way is using send (I guess I could have used dispatch, but the idea is the same).. my way, well, you can see the code [if you can't, the code is posted here as well]
targetControl
standard rev way
shaosean's way
you can pass an arbitrary amount of parameters as well.. will work on doing functions next week.. i was working on a dot notation version, but rev crashed.. i wonder if the engine objected 
the two buttons are calling the "pig" command in the button "targetControl".. standard rev way is using send (I guess I could have used dispatch, but the idea is the same).. my way, well, you can see the code [if you can't, the code is posted here as well]
targetControl
Code: Select all
on pig
answer "squeal"
end pig
Code: Select all
send "pig" to control "targetControl"
Code: Select all
targetControl "pig"
