Step-1: Create 4 input texts(boxes) and give them names n1, n2, n3, n4
respectively in the properties panel.
Step-2: Create 3 buttons with the test on them as “sort” ,”reverse”,
“sort and reverse”.
Step-3: Create another 4 input texts(boxes) and give each of them names
like r1, r2, r3, r4 respectively.
Step-4: Select the “sort” button and write the following code in the script
pane
on (release)
{
a=[t1.text,t2.text,t3.text,t4.text];
a.sort();
r1.text=a[0];
r2.text=a[1];
r3.text=a[2];
r4.text=a[3];
}
Step-5: Select the “reverse” button and open the action panel and write
the following code in the script pane.
on (release)
{
a=[t1.text,t2.text,t3.text,t4.text];
a.reverse();
r1.text=a[0];
r2.text=a[1];
r3.text=a[2];
r4.text=a[3];
}
Step-6: Select the “reverse and sort button” and open the action panel and
write the following code in the script pane.
on (release)
{
a=[t1.text,t2.text,t3.text,t4.text];
a.sort();
a.reverse();
r1.text=a[0];
r2.text=a[1];
r3.text=a[2];
r4.text=a[3];
}
Step-7: press ctrl+enter and enter any 4 names in 4 input boxes and select
any one button then the appropriate action will be performed