This content has been marked as final. Show 6 replies
I tried out your code and got the same results as you. I can't see where the problem is either. I know that doesn't help but I'll continue to try and find out why.
One question, and I know this probably comes across as a bit of a novice question, but do you have to put the lines
on every frame that you are using the DataSet component?
You left out a step
I pulled some info I had in an old FLA and added a combobox. This script requires that the combobox be placed in the library of the FLA.
This will place the state names in one combobox and field names of the object array in a second combobox that can be used for sorting.
Selecting a state name traces out (in test mode) the infor found for that state.
Selecting from the other combobox will sort the data set based on that parameter and repopulate the state name combobox in descending order for the item sorted on.
What a splendid response. Thanks for your time rlc5611, those two lines did the trick. I get the point about "label" and "data" they were a carry over from the combobox dataProvider which is where this quest started.
Could you clarify what these two lines do? They appear not only to specify a data type for each property - both string - but to declare them as variables. The following (rather confusing) extract from the components reference shows similar lines described as schema types. The two lines specify one variable per data type, rather than specifying a data type for each of the three properties involved. Is this a different process to the one you describe? How do i and j, get applied to id, firstName and lastName?
Extract from components reference - Creating an application with the DataSet component:
Add the three properties and their required data types to the DataSet schema:
Select the DataSet component on the Stage, open the Component inspector, and click the Schema tab.
Click Add Component Property, and add three new properties, with field names id, firstName, and lastName, and data types Number, String, and String, respectively.
Or, if you prefer to add the properties and their required data types in code, you can add the following line of code to the Actions panel instead of following steps a and b above:
// Add required schema types.
Actually I think you are right in that you only have to load once the data type you will be using so the script in the help file will work.
Thanks very much.