2 Replies Latest reply on Oct 16, 2011 11:32 PM by luke3design!!

    Can a spark custom component inherit from another custom component?

    luke3design!! Level 1

      Hi everybody!!

      I must develop an application which has several "panel" components. Each "panel" will be different, but will share some basic characteristics with the others(round corners, a  linear gradient, two buttons which dispatch events, and so on).

      What I thought to do is to develop a base "panel" component  and then create all the other components basing them upon this base component.

      Once created the base component I attempted to create another component (file->new mxml component) and filled out all the fields. On the "Based on" field I clicked "browse" and then selected the component I created (which resides under components.panel). The wizard completed successfully, but when I enter in the new component , supposed to be based on the other one, nothing of the base component is displayed. I thought was a problem of flash builder, but even if I run the project nothing is displayed

       

      Both the base and derived component are mxml component.

      Am I missing something?

      I can't using just a skin because I also need the buttons to be present and dispatch events in order to capture them in the child component and handle them differently accordingly to what the component is supposed to do.So I don't need to ineherit just visual appeareance but also functionality

      Any idea???????

       

      Thanks in advance for the attention.

      Best regards

      Luke