0 Replies Latest reply on Oct 11, 2007 8:36 AM by levancho

    AS3 Interfaces and Namespaces issue

    levancho Level 3
      I have Interface :
      quote:


      package ....core.interfaces
      {
      import mx.rpc.http.HTTPService;

      /***
      * this interface is needed for pages that need to communicate with container viewStack and
      * return neccessary information to viewStack so it can dinamically display one of them at a time and
      * bind httpService ,save , cancel buttons to their methods.
      *
      *
      *
      * */
      public interface IStackPage
      {

      /**
      * this method is called when caller is interested in service information of this page
      * this method should return a dictionary object that has following format :
      * <code>{
      url:"jsp/myjsppage.jsp",
      method:"POST",
      params:{"myparamname":"myparamvalue"}</code>
      *
      *
      * */
      function getServiceParams() : Object;


      /**
      * this method should let caller know if it components are all validated and valit or not.
      *
      * */
      function validatePassed() : Boolean;


      /**
      * this method is called when caller is interested in display information of this page
      * this method should return a dictionary object that has following format :
      * <code>{title:"mytittle",
      ok:"Create",
      cancel:"Cancel"}</code>
      *
      *
      * */
      function getDisplayParams() : Object;
      }
      }



      and I have a mxml-extended class :

      quote:


      <mx:Box
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      xmlns:custom="components.data.*"
      creationComplete="init()"
      width="323" height="132"
      implements="com.core.interfaces.IStackPage">



      now I want to use namespaces for all functions that this mxml should implement, but it seems that I cant do that,
      because if I prepend all interfaces methods with custom namespace using

      namespace mynamespace; it says namespaces are not allowed in interfaces.
      if I dont do it and change public namespace with my custon then it says this component does not implement methods defined in IStackPage.
      can someone give me some suggestion how to go about this?