Create a "State Table" with states by Flexscript

Create a "State Table" with states by Flexscript

royjuventus29
Enthusiast Enthusiast
318 Views
4 Replies
Message 1 of 5

Create a "State Table" with states by Flexscript

royjuventus29
Enthusiast
Enthusiast

Hello, I used the following script to create a "State Table". However, there is nothing inside. I would like to have states in it by default like the default state table. Can anyone tell me how to do it? Thank you very much!

treenode statetable = Tools.create("StateTable");

royjuventus29_0-1776255758731.png

 

0 Likes
Accepted solutions (1)
319 Views
4 Replies
Replies (4)
Message 2 of 5

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

You can create a default state table by adding "Default" as the second parameter of the create method. Once created you can edit the table like a global table by casting the data node as table.

Object stateTable = Tools.create("StateTable", "Default");
Table data = getvarnode(stateTable, "data");
data[1][2] = "VeryIdle";     // Set name of first state

 

Message 3 of 5

royjuventus29
Enthusiast
Enthusiast

By the way, do you know how to attach this state table to a dashboard "State Bar" by Flexscript?

0 Likes
Message 4 of 5

FelixMoehlmann
Collaborator
Collaborator
Message 5 of 5

royjuventus29
Enthusiast
Enthusiast

Thank you for the answer. It works now.

0 Likes