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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:44:22+00:00 2026-05-28T07:44:22+00:00

Can someone show an example of how to create multiple view change events in

  • 0

Can someone show an example of how to create multiple view change events in a single list in flex?

I want each item in a list to change to a totally unique view file. Instead of 10 items in a list all going to 1 new view but with different info being generated I want 10 different view, 1 per item in the list.

I can’t find any examples of how to do this and I have been tryingo to make it for for a while. This is for a mobile app. Thanks!

<fx:Script>
<![CDATA[
import spark.events.IndexChangeEvent;
protected function myList_changeHandler(event:IndexChangeEvent):void {
navigator.pushView(views.EmployeeView,myList.selectedItem);
}
protected function myList2_changeHandler(event:IndexChangeEvent):void {
navigator.pushView(views.EmployeeView2,myList.selectedItem);
}
protected function myList3_changeHandler(event:IndexChangeEvent):void {
navigator.pushView(views.EmployeeView3,myList.selectedItem);
}           
]]>
</fx:Script>

<s:List width="100%" height="100%" labelField="firstName">
<s:ArrayCollection>
<fx:Object id="myList" change="myList_changeHandler(event)" firstName="Bill"/>
<fx:Object id="myList2" change="myList2_changeHandler(event)" firstName="Dave"/>
<fx:Object id="myList3" change="myList3_changeHandler(event)" firstName="Mary"/>
</s:ArrayCollection>
</s:List>
  • 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-28T07:44:22+00:00Added an answer on May 28, 2026 at 7:44 am

    You are missing a few things here. First, you need to listen to the change event on the List component:

    <s:List id="myList" width="100%" height="100%" labelField="firstName" change="myListChange(event)">
    

    Next, you need to create the method for changing the view:

    protected function myListChange( event:IndexChangeEvent ):void
    {
        var newView:Class;
    
        // You can decide a different view based on the newIndex property of the event
        // There could be many better ways than a switch statement - this is for brevity
        switch ( event.newIndex )
        {
            case 0:
                newView = EmployeeView0;
                break;
            case 1:
                newView = EmployeeView1;
                break;
            default:
                newView = OtherEmployeeView;
                break;
        }
    
        navigator.pushView(newView,myList.selectedItem);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone show an example on how to create an NSEvent that simulates pressing
Given the example below, can someone please show me how this could be called?
Can someone show a quick example on how to use NSTask and NSPipe in
Could someone please show me a example of how to create a custom control
Can someone show me some example for restricting user input (on input tag) in
Can someone show me how to use the System.Numerics.BigInteger datatype? I tried using this
Can someone show me how to print the ListView contents with the ColumnHeaders, without
can someone please show me documentation on this method? i have the following line:
Can someone tell/show me how to use PHP inside PHP. I'm trying to make
Can someone please tell me how to show all privileges/rules from a specific user

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.