I've been trying to extend some of the OSMF classes to add some custom behavior but I'm finding that way too many of the methods and variables are being declared ''private''. I'm finding it nearly impossible to not to copy and past code around or start changing declarations from private to protected.
For example:
- I want to create a VideoAdElement that essentially plays a video but needs to do an extra step before the standard NetLoader load process and otherwise behave idential to the the VideoElement.
- Basically I need to change the 1st URL to a second midway though the load process and then call/recreate the behavior of the default load method.
The specifics that I've run into so far are:
- 1st all the parsing methods of the URL classes are private and rawUrl is read only so extending a URL class to make it change inresponse to an event requires a bunch of changes from private to protected or the copy %26amp; paste of logic.?If you look at how the FMSURL class is written it is even doing an end around having parseURL() private buy adding more private parse methods instead of extending parseURL() and calling super.parseURL() or the like.
- 2nd the constants in the NetLoader are all pivate so when recreating the load method I have to adjust a bunch of declarations from private to public or duplicate a bunch of logic.
- Since load() is the entry point into the NetLoader and every other method in the NetLoader is declared private I have the choice of copy %26amp; paste or go and change things from private to protected everywhere.
This makes things a lot harder then they need to be.?I can understand some methods being private but this is taking it to the extreme and makes most of the objects involved totally inaccessable to extension.?Flex has mx_internal namespace which attempts to address the need to abandon a method down the road which the need to be flexable and accessable.?At least as Flex is revised and I get a compile error on something overriding mx_internal I know where to look.?If I'm having to modifiy random method/variable declarations from private to protected every time I update the framework its a messy situation.
I doubt I'll be the only one trying to extend the framework so it is probably better to address this need early then later on down the road after people give up on OSMF because it is too hard to extend.
Too many private methods, constants and...