API's tend to be exposed through Interfaces. This allows you to program
agains an interface, keeping the implementation (concrete class) out of
sight.
You wrote:
*sumTwoNumbers(numA, numB)
{
baseApp.sumTwoNumbers(numA,numB)
}*
You should make sure that baseApp is typed as an interface (for example
IBaseApp). Make sure that the BaseApp class implements IBaseApp. The
IBaseApp would look like this:
*public interface IBaseApp
{
function sumTwoNumbers(numA:Number, numB:Number):Number;
}*
I hope this helps you.
Greetz Erik
On 5/27/08, Helmut Granda <[EMAIL PROTECTED]> wrote:
>
> 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