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 8977671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:25:30+00:00 2026-06-15T19:25:30+00:00

My goal is to change the visibility of a component from another component which

  • 0

My goal is to change the visibility of a component from another component which is in another state. I been reading about the event but I can Flex it to work, I get this TypeError: Error # 1009: Can not access a property or method of a null object reference.

<<fx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.events.FlexEvent;


        protected function buttonChange_clickHandler(event:MouseEvent):void
        {
            Tab.selectedIndex=1;    
            border.visible=true;
            border.setStyle("backgroundColor",'#8000FF');

        }



    ]]>
</fx:Script>
<mx:TabNavigator x="197.7" y="147.35" width="514" id="Tab" height="335">
    <s:NavigatorContent label="State 1" width="100%" height="100%">

        <s:Button x="65" y="103" id="buttonChange" label="Change state" click="buttonChange_clickHandler(event)" />

    </s:NavigatorContent>
    <s:NavigatorContent label="State2" id="state2"  width="100%" height="100%">
        <s:BorderContainer x="191"  y="37" width="249" height="223" visible="false"  cornerRadius="20" borderWeight="5" id="border">
        </s:BorderContainer>
    </s:NavigatorContent>
</mx:TabNavigator>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

  • 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-06-15T19:25:32+00:00Added an answer on June 15, 2026 at 7:25 pm

    The error occurs because your BorderContainer is not “created” when the tab navigator change the index. There are two fast ways to resolve that:

    1) Use callLater to ensure that the border will be created when the tab change:

            protected function buttonChange_clickHandler(event:MouseEvent):void
            {
                Tab.selectedIndex=1;
                callLater(turnVisible);
            }
    
            private function turnVisible():void{
                    border.visible=true;
                    border.setStyle("backgroundColor",'#8000FF');
            }
    

    2) Or set the creationPolicy to “all” of the second </s:NavigatorContent>. That way will increase the startup time of the application:

    <s:NavigatorContent label="State2" id="state2"  width="100%" height="100%" creationPolicy="all">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to change the onclick attribute of a link. I can do
I want to change the goal from S x = S y to x
My goal is to create a usercontrol which will redraw when I change its
My goal is to transfer entries from one ldap server to another - preserving
I can change prompt_alternatives_on flag in the REPL. But how do I change this
My main goal is to change the volume on one sound card based on
The main goal of my issue is to put specific colors on Donut Change.
Goal : I wants when I drag image it become fade so we can
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Produce an Excel document with information from 3 associated models that is similar

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.