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……….
2 Replies to “DataProvider API already written for you”
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?
– 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);
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
Comments are closed.