Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 902645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:45:02+00:00 2026-05-15T15:45:02+00:00

This could potentially be a dumb question so apologies in advance if it is.

  • 0

This could potentially be a dumb question so apologies in advance if it is.
I’m wondering if theres an equivilant of Interfaces in MXML?

Everytime I feel the need to use an interface I always wind up making an actionscript and not an MXML file because I don’t know if / how you can.

For example I was going to have a component based on vbox. I have 4 different implementions of the same thing so I decided to use an interface. But instead of making a single MXML interface and implementing it I’ve created an interface in as3. I’ve implemented this interface in 4 different classes.

I then have made 4 different vbox containers each with one of the different implementations in the script tag.

Does this sound like a reasonable approach or am I going against the grain here?

EDIT — adding examples

The interface

package components.content.contents
{
    public interface IContent
    {
        function init():void;
        function doSearch():void
        function setSearchTerm(term:String):void
    }
}

Implementation (1 of 4)

package components.content.contents
{
    public class ClipContent extends AbstractContent implements IContent
    {
        public function ClipContent()
        {
        }

        public function init():void
        {
        }

        public function doSearch():void
        {
        }

        public function setSearchTerm(term:String):void
        {
        }

    }
}

MXML File (1 of 4)

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
        <mx:Script>
            <![CDATA[
                              // ClipContent Container
                import components.content.contents.ClipContent;
                public var content:ClipContent= new ClipContent()

                public function dostuff():void

                {
                  content.init()
                  content.doSearch()

                }
            ]]>
        </mx:Script>

</mx:VBox>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:45:02+00:00Added an answer on May 15, 2026 at 3:45 pm

    You can use interfaces with MXML components this way:

    // YourClass.mxml
    <mx:HBox implements="IYourInterface">
    

    is an MXML equivalent of

    // YourClass.as
    class YourClass extends HBox implements IYourInterface
    

    But you still need to create the interface (in this example IYourInterface) in Actionscript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I suppose this question could just as easily be applied to PHP with regard
Is this wise, what potential issues could you run into?
This could be weird, Have you ever come across a blog which you wanted
This could be a little off the ballpark, but a friend asked me about
Can anybody please explain how this could possibly happen? I am completely aware of
I am busy writing my thesis (so, I guess this could count as a
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
I have a lot of classes in the App_Code directory could this be a
I have roughly the following code. Could this be made nicer or more efficient?
I could do this in C#.. int number = 2; string str = Hello

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.