JXL DataProvider Extensions

Added 3 methods to the DataProvider class to add some features to it. It’s an old class, I know, but you can never stop improving!

– removeView = removes a listener, opposite of addView
– save = saves the DataProvider’s items to a local SharedObject
– read = reads the saved items from a local SharedObject, and then populates the DataProvider

I’ll update the DataProviderClass documentation later as I’d prefer not to add more XML files to your CustomActions folder; the more XML reference files you have in there, the more it slows Flash starting up for some people. For now, all methods return true if it worked, and false if it didn’t. The exception is save returns “pending” if the user needs to allocate more space for their local SharedObjects via the Settings Panel.

You can use either the Components as optional features or just include the as file. The as file is included in the MXP. I utilized <a href=”http://www.muzakdeezign.com/mxi_creator/index.asp”>Muzak’s MXI File Creator</a> to quickly package this component; phat product! Go <a href=”http://www.screenweaver.com”>Screenweaver</a>.

JXL DataProvider Extensions – <a href=”https://www.jessewarden.com/downloads/JXL DataProvider Extensions.mxp”>MXP</a> | <a href=”https://www.jessewarden.com/downloads/JXL DataProvider Extensions.as”>AS</a>

3 Replies to “JXL DataProvider Extensions”

  1. This is cool. I remember your post on figleaf about copy dp1 to dp2. Why don’t add a clone or copy method ? Not possible ?
    thnks

  2. Well, I don’t think that thread was ever resolved enough.

    Yes, you can copy one DP’s item, but what if that item has sub-object’s in it? I think the issue was, since there is no native Flash “clone” method on Object, then you have to use recursion, but no function was produced in the thread that didn’t have it’s pros and cons enough to deeply divide the fence.

    I guess I could add a copy, but that’s under the assume that your not “really” copying an array, but merely copying a reference to it.

    …this doesnt’ even touch of custom classes… There should be a way to save those as well via Branden Hall’s technique, but that get’s into shaky territory of, “Is it really DataProvider’s job to do something like that?” …well, I would say yeah, and it seems you would to.

    I’ll chew on it some more and maybe come up with something if it’s realistic.

  3. “Is it really DataProvider’s job to do something like that?”

    Hmmm, I understand.

    And hope there will be an “native Flash clone method on Object” in Flash 7

    Thanks for your reply Jesse.

Comments are closed.