Once I did something similar, except we were not using SWC's but SWF's, and
it was a Flash project (not flex).
We gave a third party agency the url to an swf that they would load at
runtime. That swf contained some library of classes, but there was just one
base class that they had to use directly (the rest were for internal use of
the library). They would create an instance of the class using the
getDefinition() method.
On their side, that class instance was typed as an interface to our main
class. So, in the end, we handed them an interface that covered all the
public methods in the main class (so they could compile in strict mode
without errors), and an extra class where we put all the public event
constants. It worked out fine.
Cheers
Juan Pablo Califano
2008/5/27, Helmut Granda <[EMAIL PROTECTED]>:
>
> I am creating a SWC file that will be given to the client with the basic
> API
> that they can use to reference to the main application.
>
> It all makes sense in my mind and in writing (create the methods that
> delegate to the main application).
>
> I have a basic format working but in order for it to work I have to include
> the classes that will handle all the process and that is what I am trying
> to
> avoid since we want full control of the base methods used within the
> application.
>
> For example:
>
> API:
> sumTwoNumbers(numA, numB) {
> baseApp.sumTwoNumbers(numA,numB)
> }
>
> but in order for this to work i need to import baseApp class or else i will
> get compile errors. My second option would be to dispatch events when
> necessary:
>
> sumTwoNumbers(numA, numB){
> dispatchEvent(new CustomEvent ( CustomEvent.sumTwoNumbers, numA, numB))
> }
>
> But i am not sure if this is the appropriate approach. Could some one that
> has dealt with similar situations share some wisdom here?
>
> TIA....
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders