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

  • Home
  • SEARCH
  • 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 6580327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:00:48+00:00 2026-05-25T16:00:48+00:00

I am pretty new to flex, specially to mxml part. There are some confusing

  • 0

I am pretty new to flex, specially to mxml part. There are some confusing things for me.
For example I have custom component file Abc.mxml with code:

<s:Group>
   //Lots of code
   <s:Button id="someId" /*code*/ />
</s:Group>

And then I have Xyz.mxml which is also custom component file.

<s:Group>
  <fx:Scrip>
     //something happens here, for example some other button click or whatever
  </fx:Script>
  //code
  <comp:Abc />
</s:Group> 

So question is how do I access that button’s properties. I want when something happens in Xyz file, button’s (someId) visibility to become false. If Abc.mxml was AS class file then it would be easy, just make object etc., but how to get if it’s mxml file, I have no idea.

  • 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-25T16:00:49+00:00Added an answer on May 25, 2026 at 4:00 pm

    There’s no big difference between mxml and as. When you write Xyz.mxml:

    <s:Group>
      <fx:Scrip>
         //something happens here, for example some other button click or whatever
      </fx:Script>
      //code
      <comp:Abc />
    </s:Group>
    

    …you just specify class Xyz derived from Group. Mxml – is just markup language which makes building interfaces easier. During compiling mxml files are transformed to pure AS, so there’s nothing (on a large scale) you can do in mxml which you can’t in AS and vice-versa.

    ID property in mxml is similar to instance name in AS, i.e. it will be converted to public property in your calss.

    Answer to your question.

    You can write public function in Abc and call it in Xyz.

    Abc.mxml:

    <s:Group>
        <fx:Script>
            <![CDATA[
                public function doSomething():void
                {
                    someId.enabled = false;
                }
            ]]>
        </fx:Script>
       <s:Button id="someId"/>
    </s:Group>
    

    Xyz.mxml:

    <s:Group>
      <fx:Script>
          <![CDATA[
             private function somethingHappened():void
             {
                 abcComponent.doSomething();
             }
          ]]>
      </fx:Script>
      //code
      <comp:Abc id="abcComponent"/>
    </s:Group>
    

    In somethingHappened function you can access Button abcComponent.someId directrly, but I strongly reccommend not to do this, since it breaks encapsulation and makes your classes more cohesive (and so on).

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

Sidebar

Related Questions

i'm pretty new to flex 3 but it's really cool so far. i have
I'm pretty new to Flex, so there's probably a good chance I'm missing something
I am new to Java world but I am pretty good at using Flex,
I am pretty new to php, but I am learning! I have a simple
I'm pretty new to JSF and the many many related technologies out there. I'm
I'm pretty new to regular expressions. I have a requirement to replace spaces in
I'm pretty new in Flex development. Now I'm learning layouts in Flex. I try
I am pretty new to GraniteDS..So far I have been able to successfully configure
I'm pretty new to the SQL and need some help with a certain task.
Pretty new to threading and I have this QList that the threads share between

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.