PDA

View Full Version : assign shortcut in script


Grakus
06-25-2005, 02:00 PM
I need assign shortcut to some buttons in rollout in script.
How does it make the easiest?

I know only one solution and that creates buttons function like idividual scripts and then it somehow connects through.
But unfortunetly i don't know how can i connect more script. :( e.g. that I can from one script make a reference to (e.g. spinner) in rollout in different script.
Could you HELP me pls?
It should help me the most some tiny example.
(sorry for my english)

Grakus
06-26-2005, 09:45 PM
I'm really desperate :(

So i show some sample:
If i have 2 scripts and in first script i have e.g. spinner (spn1). If i change spn1.value i want to change some global variable (e.g. X). And then in second script i want use the variable X.

I tried a lot of syntax global variable and i don't know what i do.

Grakus
06-28-2005, 12:06 AM
:sad:
so i show next specific sample.

Here's first script:
rollout test "test" width:162 height:300
(
spinner spn1 "" pos:[22,19] width:118 height:16
on spn1 changed val do
(
global g = 5
spn1 value:g
global g = spn1.value
)
)
createdialog test

Here's second script Box length:g width:g height:g

I want to if i change in first script value on spinner to change the global variable "g" and when i run the second script so i want to e.g. create BOX with length, width, height = g (global variable). But it doesn't work :(

Could somebody HELP me pls pls pls?

Grakus
06-28-2005, 11:41 PM
The problem was edited

First functional script:
rollout test "test" width:162 height:300
(
spinner spn1 "" pos:[22,19] width:118 height:16 range:[0,100,0] scale:1
on spn1 changed val do
(
global g=spn1.value
)
)
createdialog test

galagast
06-29-2005, 03:06 AM
say you have this rollout for example:

rollout my_first_rollout "My First Rollout"
(
spinner spinner_one "Height: "
)
createdialog my_first_rollout


to be able to access the spinner from anywhere in max (assuming you've run the script), you can type this:

my_first_rollout.spinner_one.value


so you can create a simple box by typing:

box height:my_first_rollout.spinner_one.value


hope this helps:)

Grakus
06-29-2005, 12:13 PM
galagast: SUPER... so it's best.:)

THX a lot

CGTalk Moderation
06-29-2005, 12:13 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.