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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:52:06+00:00 2026-06-05T08:52:06+00:00

I got a new project. and some part of it, Flex was exist. <mx:

  • 0

I got a new project. and some part of it, Flex was exist.

<mx: Application xmlns:mx=...>
   <mx:script>
          import...

           function A() {
            }
    </mx:script>

    <mx:linkBar...>
    <mxViewStack ...>

       <mx:Canvas id="1st" ...>  **[HERE]**  </mx:Canvas>
       <mx:canvas id="2nd" ...>  ... </mx:Canvas>
       <mx:canvas id="3rd" ...>  ... </mx:Canvas>

** When Viewstack calls Canvas sequentially, A() has to work.

Is it possible to use function A() in **HERE**]?

Or please let me know the possible function or tag which can be used.

  • 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-05T08:52:07+00:00Added an answer on June 5, 2026 at 8:52 am

    Below example may help you: –

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
    
                private function A():void
                {
                    //Your code
                }
    
                private function viewStackHandler():void
                {
                    //Method One
                    if(viewStackID.selectedIndex == 0)
                    {
                        A();
                    }
                    else if(viewStackID.selectedIndex == 1)
                    {
                        A();
                    }
                    else
                    {
                        A();
                    }
                    //OR Method Second
                    //call only A()
    
    
                }
    
            ]]>
        </fx:Script>
        <mx:VBox width="100%" height="100%">
            <mx:HBox width="100%" height="20">
                <s:Button label="One" click="{viewStackID.selectedIndex = 0}"/>
                <s:Button label="Two" click="{viewStackID.selectedIndex = 1}"/>
                <s:Button label="Three" click="{viewStackID.selectedIndex = 2}"/>
            </mx:HBox>
            <mx:ViewStack width="500" height="400" id="viewStackID" change="viewStackHandler()">
                <mx:Canvas id="canval1" borderColor="#FF0000" width="100%" height="100%">
                    <s:Button label="One"/>
                </mx:Canvas>
                <mx:Canvas id="canval2" borderColor="#00FF00" width="100%" height="100%">
                    <s:Button label="Two"/>
                </mx:Canvas>
                <mx:Canvas id="canval3" borderColor="#0000FF" width="100%" height="100%">
                    <s:Button label="Three"/>
                </mx:Canvas>
            </mx:ViewStack>
        </mx:VBox>  
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Flex (got assigned to maintain an old project at work)
I've got a Java/Flex project that I'm building using Maven. After doing some research
I'm working on a new project and got some experience with Entity Framework 3.5.
I've got new project on the go and I'm looking at using the Entity
My company has got a new project upcoming and i need software that can
I am using mongoDB for a new project at work and I got into
I'm new in eclipse and I have got a project that can add and
Ok just got assigned to a new project and have never dealt with Javascript
I've got a freshly made C++ ( .vcxproj ) project that I've added some
I'm building a new project and I'm having some debate over how it needs

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.