After writing this for the 2nd time, I’m not writing it again. I’m saving this mofo to some easily retrievable AS file or a JSAPI command.
At any rate, here it is for you to copy and paste into your own component that you wish to implement the DataProvider API, but don’t feel like typing it again and again and again……….
<a href=”https://www.jessewarden.com/downloads/DataProvider_FillIn.as”>DataProvider_FillIn.as</a>
Jesse,
Thanks a bunch for this. I’ve been working with DataProvider recently, trying to apply labels and data to AccordianTabs… however, I seem to be running into a brick wall. Would you happen to have a piece of source code that shows you actually using the DataProvider functions as you built them in the .as file?
David
https://www.jessewarden.com/downloads/Test.as
– make a new FLA
– drop a List component to the stage
– delete it from the stage
– make a new movie clip
– give it a linkage ID of “Test” and an AS2 class name of “Test”
– put this code on frame 1
attachMovie(“Test”, “test_mc”, 0);
test_mc.addItem(“Cow”, “cow”);
As far as your Accordion issue, not sure. He’s a container, not a list, so he doesn’t follow the whole DataProvider thing (although, his button might like what you were messing with).
Now, naturally, my example uses an existing component, but YOURS would intercept modelChanged and simple call your redraw; which redraws your component. Loop through the dataprovider and display stuff. Like a custom label or shape:
var howMany = _dp.getLength();
var origY = 0;
for(var i=0; i