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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:27:09+00:00 2026-06-14T18:27:09+00:00

import fl.events.*; const PointsStart:int=0; var Points:int=PointsStart; youChose.text=String(Points)+ points; comboBox.prompt=’Contestants’ comboBox.addItem({label:John Smith,Points:10}); comboBox.addItem({label:Chris Tucker,Points:12}); comboBox.addItem({label:Paul

  • 0
import fl.events.*;  

const PointsStart:int=0;  

var Points:int=PointsStart;  

youChose.text=String(Points)+" points";  

comboBox.prompt='Contestants'  
comboBox.addItem({label:"John Smith",Points:10});  
comboBox.addItem({label:"Chris Tucker",Points:12});  
comboBox.addItem({label:"Paul Allen",Points:14});  

comboBox.addEventListener(Event.CHANGE, listevalg);  


function listevalg (evt:Event)  
{  
    Points=comboBox.selectedItem.Points;  
    youChose.text=String(Value)+" points";  
}  

I’d like to have a textbox that says what the current standings are. Say I choose Chris Tucker in the combo box, I want the textbox to say something like ‘He’s in second place’

  • 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-14T18:27:11+00:00Added an answer on June 14, 2026 at 6:27 pm

    First you need to know which rank each person is in. To do that you can copy the list of people and sort it by Points, then register their rank as their position in that list.

    import fl.events.*;  
    
    const PointsStart:int=0;  
    
    var Points:int=PointsStart;  
    
    youChose.text=String(Points)+" points";  
    
    comboBox.prompt='Contestants'  
    
    var people:Array = [{label:"John Smith",Points:10},
                        {label:"Chris Tucker",Points:12},
                        {label:"Paul Allen",Points:14}];
    
    // Copy of "people", sorted by Points, descending.
    var sortedPeople:Array = people.concat().sortOn("Points", Array.DESCENDING | Array.NUMERIC);
    
    for each (var person:Object in people) {
        // Register this person's ranking as its position in the sorted array + 1
        // (because indexes start at 0)
        person.Rank = sortedPeople.indexOf(person) + 1;
        comboBox.addItem(person);
    }
    
    comboBox.addEventListener(Event.CHANGE, listevalg);  
    
    
    function listevalg (evt:Event)  
    {  
        Points=comboBox.selectedItem.Points;
        // The ranking is now available as "item.Rank".
        youChose.text=String(Points)+" points, rank "+String(comboBox.selectedItem.Rank);
    }
    

    If you don’t actually need to keep the current order in the combobox, you don’t even need to make a copy of the array before sorting.

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

Sidebar

Related Questions

I have a timer script: import flash.utils.Timer; import flash.events.TimerEvent; var secs:Number = 30;//second var
package classes.events { import flash.events.Event; public class ASSEvent extends Event { public static const
package samples.flexstore { import flash.events.Event; public class ProductThumbEvent extends Event { public static const
I have the following custom event: package com.un.photoManager.events { import flash.events.Event; import mx.collections.ArrayCollection; public
is there way how to import events from non managed fan page? The problem
I've created an Event Handler/Listener like so: import flash.events.Event; public class DanielEvent extends Event
having problems adding parts of a snake on through timer events package { import
The class example: package { import flash.events.*; import flash.net.*; public class XmlLoader extends EventDispatcher{
import threading event = threading.Event() event.set() print event.wait(1) None event.clear() print event.wait(1) None So
import java.util.Collection; import example.Event; public interface Query { public boolean hasMore (); public Collection<Event>

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.