List Component - return number of item clicked

I have populated a List component with data from an XML file.  I simply want the index of the line clicked returned so I can gotoAndStop to that Frame number. I have found the 'selectedItem' property but I don't want the text, I want the number of the line. Thanks.

You said you wanted the index of the line clicked, so you don't need to look further than the selectedIndex value.  There is no data property for the selectedIndex value (which is merely a number);
trace(event.target.selectedIndex);
Now if your intention is to associate this with a frame number, then you have to adjust for index values starting at 0 and frame numbers starting at 1.

Similar Messages

  • Using a List Component to create a photo gallery.

    This feels like a lot to be asking but i'm gonna go ahead and
    ask to see what happens.
    I'm trying to figure out how to use a list component to
    select 6 items from a large list, display the words to the 6
    selected items (in a text field), then finally (by pressing a
    button) I would like to load the 6 corresponding pictures for the
    selected items into a seperate frame. If there is anyone that could
    point me in the right direction it would be greatly appreciated. I
    have been trying to find information online about programming the
    List Component but haven't had any luck. Is there a book that
    anyone recommends that could help me? I've been doing simple
    animations and websites in flash but i'm now looking to learn some
    actionscripting as well. Thanks.

    Hi PinkPowerRanger,
    Per my understanding that you have two fields in the table "Date and Time picker" which is Date/time type and another is "Item ID", you need to get the Month from the Date field to display in the X-axis and count(Item ID) related to each
    month to display in the Y-Axis, right?
    I have tested on my local environment and can do this by create two calculated fields to get the month and year values from the Date/Time field.
    Details information below for your reference:
    Right click the main dataset to select the "Add Calculated field", specify an name of the new calculated field and add the expression in the field source as below:
    Year:    =Year(Fields!Date.Value)
    Month:  =MonthName(Month(Fields!Date.Value))
    Add the three field in the Chart as below and remember in the Value area you have got the Count(ItemID) but not SUM(ItemID):
    Preview you will got the chart like below:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Highlight current Index label in list component

    Hi,
    I'm writhing http xml video playlist. i was took 'List' component for playlist.
    if i click on label, that is working (i mean playing video & highlighting label).
    but after video ending, video automatically playing but label not highlighting, How can i highlight current playing video label?
    Code:
    var videoURL:String = "playlist_http.xml";
    var bolLoaded:Boolean;;
    var intActiveVid:int;
    var urlLoader:URLLoader;
    var urlRequest:URLRequest;
    var xmlPlaylist:XML;
    var nConnection:NetConnection;
    var ns:NetStream;
    var video:Video = new Video();
    nConnection = new NetConnection();
    nConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    nConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    nConnection.connect(null);
    function connectStream():void
              ns = new NetStream(nConnection);
              ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
              ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, ayncErrorHandler);
              ns.checkPolicyFile = true;
              ns.client = this;
              vidDisplay.attachNetStream(ns);
              ns.play(videoURL);
              vidDisplay.smoothing = true;
              urlRequest = new URLRequest(videoURL);
              urlLoader = new URLLoader();
              urlLoader.addEventListener(Event.COMPLETE, playlistLoaded);
              urlLoader.load(urlRequest);
    function netStatusHandler(event:NetStatusEvent):void
              trace(event.info.code);
              switch (event.info.code)
                        case "NetConnection.Connect.Success" :
                                  connectStream();
                                  break;
                        case "NetConnection.Connect.Closed" :
                                  break;
                        case "NetStream.Play.Stop" :
                                  playNext();
                                  break;
                        default :
    function securityErrorHandler(event:SecurityErrorEvent):void
              trace("securityErrorHandler: " + event);
    function ayncErrorHandler(event: AsyncErrorEvent):void
              //Nothing
    //PlayList SetUp
    //=====================
    var listBox:List = new List();
    addChild(listBox);
    listBox.setSize(194, 339);
    listBox.move(484,0);
    function playlistLoaded(e:Event):void {
              xmlPlaylist = new XML(urlLoader.data);
              //trace(xmlPlaylist.vid[0].@src);
        for (var i:int=0;i<xmlPlaylist.vid.length();i++) {
                                  listBox.addItem({label:xmlPlaylist.vid[i].attribute("desc"), data:xmlPlaylist.vid[i].@src});
                                  listBox.addEventListener(Event.CHANGE, playVidlist);
                                  listBox.selectedIndex = 0;
    // set source of the first video but don't play it
              playVid(0, false);
              if(!bolLoaded) {
                        ns.play(videoURL);
                        bolLoaded = true;
              else{
                        ns.resume();
    function playVidlist(e:Event):void
              //intActiveVid=int(String(e.currentTarget.selectedItem.data));
              ns.play(String(e.currentTarget.selectedItem.data));
              lblDescription.text = e.currentTarget.selectedItem.label;
              if(!bolLoaded) {
                        ns.play(videoURL);
                        bolLoaded = true;
              else{
                        ns.resume();
    function playVid(intVid:int = 0, bolPlay = true):void {
              if(bolPlay) {
                        // play requested video
                        ns.play(String(xmlPlaylist..vid[intVid].@src));
              } else {
                        videoURL = xmlPlaylist..vid[intVid].@src;
              lblDescription.text = String(xmlPlaylist..vid[intVid].@desc);
              // update active video number
              intActiveVid = intVid;
    function playNext(e:MouseEvent = null):void {
              if(intActiveVid + 1 < xmlPlaylist..vid.length()){
                                  playVid(intActiveVid + 1);
    function playPrevious(e:MouseEvent = null):void {
              // check if we're not and the beginning of the playlist and go back
              if(intActiveVid - 1 >= 0)
                        playVid(intActiveVid - 1);

    Thankyou.... working good, but after adding next previous buttons that selection not working currectly.
    if i click some label, selection is working after if i click next not working selection.
    function playNext(e:MouseEvent = null):void {
               if(intActiveVid + 1 < xmlPlaylist..vid.length()){
                                  playVid(intActiveVid + 1);
      listBox.selectedIndex = intActiveVid + 1;
    function playPrevious(e:MouseEvent = null):void {
              if(intActiveVid - 1 >= 0)
    playVid(intActiveVid - 1);
    listBox.selectedIndex = intActiveVid - 1;

  • How to print a gift return label if only know the return number and order number

    I have a macbook pro, it's a gift, and I want to return it. But at first time, I forgot to print the return label, now I know the order number and return number, when I click "Print return label", it appeared I need to sign in, but I don't have a apple ID

    Call Apple sales and ask them. The number should be on your order receipt or look at the Contact Us link at the bottom right hand corner of this page.

  • List component trouble

    Hello!
    I have some trouble with the list component in my
    application. The thing is that the keyboard interaction don't work
    proper. I've found out that it is my function "transferParameters"
    who spoils it. The function looks like this:
    Object.prototype.transferParameters = function(ref)
    var i;
    for(i in this)
    ref[ i ] = this[ i ];
    I am using the function to duplicate objects without making
    the instances refer to each other.
    What should I do to get the keyboard interaction to work?
    Regards Toben

    Nope that doesn't seem to solve the problem. I tried putting
    the listListener function and all the variable definitions outside
    of the onData, but still have the same problem! Is there a thing
    with the List component that you have to click into them before
    they're activated or something? Or might it be something with
    Firefox? It works almost all the time in IE.
    Thanks,
    Mukul

  • List component scroller eventlistener for finished scrolling ?

    I have a list component which contains an item renderer. I would like to know if it is possible to detect when the scoller that is built into the List has finished scrolling can fire an event. Is there a built in eventlistener ?

    Arrghh, not the right one. I am also moving the scroller bar by using a linkbar to tab the scrollbar to different positions. I need to fire an event when the scroller has reached those new positions. The FlexEvent.CHANGE_END only works when you use the scroller manually.

  • Error :cannot show the value of the filter.The Field may not be filterable or the number of items returned exceeds the list view threshold enforced by administrator

    Issue : In sharepoint 2013, I am experiening below error while using filter in the list view due to the number of items in this list exceeds the list view threshold, which is 10000 items. Tasks that cause excessive server load (such as those
    involving all list items) are currently prohibited.
    Error :cannot show the value of the filter.The Field may not be filterable or the number of items returned exceeds the list view threshold enforced by administrator
    Could you please suggest a way to avoid this issue apart from incrementing the list view threshold limit .
    Prashanth

    Reorganizing content, or creating more specific views. sharepoint is warning you that the content is structured in such a way that it can cause performance issues, which should be addressed in some way.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • How can I select an item from a list component with a seperate button

    This is a repost, I decided it'd probably be better here than
    in the general discussion board. I will try to delete the other
    one.
    Hello Everyone,
    This is my first post here. I am trying to figure out how to
    select an item within a list component with a button. This button
    is calling a function. I have searched for the past 3 hours online
    and I can't find anything about it. I thought perhaps I could set
    the selectedItem parameter, but that is read only, and I believe it
    returns an object reference rather than something like a number so
    even if i could set it, it would be pointless. I also found a get
    focus button, thought that may lead me somewhere, but I think that
    is for setting which component has focus currently as far as typing
    in and things like that. I am lost.
    Basically I am looking for a way to type this
    myList.setSelected(5); where 5 is the 5th item in the list.
    Any help would be much appreciated.

    Never mind found it. It is the property called selectedIndex
    and it is writable

  • Cannot return to message list while in a message without clicking on "compose new message icon" and then cancelling it.

    After updating to 8.1 from 8 i cannot return to my message list from inside a message without clicking on the "compose new message" icon and then canceling out of that.
    Also, where it used to say return, it now says "Edit" and the word "Message" on the top of the screens is scruched together.
    Here is a link to a screenshot of my phone from the main messages listing.
    And here is a link to a screen shot of my phone from within a message.

    Hi Sir,
    Code snippet for reference:
    Private Sub Application_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean)Handles OutlookApplication.ItemSend
    Try
       Dim SentMailItemObject As Outlook.MailItem
    SentMailItemObject = CType(Item,
    Outlook.MailItem)
    ‘Can
    we add here User property in Mail Object Reference?
     Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Information)
     End Try
    End
    Sub

  • Cannot get more than 8 item in list component

    Hi,
    I can't get more than 8 items in list component using getItemAt(), it returns null. I will search more for this but no result.
    Please Help me here to move to next step.
    Thanks
    Sureshkumar G

    If you're asking if you can overall, yes you can:
    http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f41.html
    If you're asking if you can do this in the same context, off-screen, no you still get the same error as the .enabled property.
    I hate to throw a hunch but I feel as though Adobe is employing something I'm used to in native iOS programming (Apple Devices). In lists they have something called "dequeue". It's the reason an extremely long list scrolls smoothly. What it does is render ONLY the rows that are in view. When a row is about to scroll off view it deallocates it from memory and then recreates the next row. They do this so you only ever have the current amount of viewable rows in memory and it speeds up scrolling. Although, I can make property changes to items in an iOS list that's off-screen so they don't have this issue ;(.  Just food for thought.
    I'd submit it to the bugbase and see what Adobe states. They may say they intend you to get the item in view, alter it and then go back to your previous position. That would be silly but at most I can tell you I definitely get errors trying to access an element outside my view. They're probably not used to items needing visual toggles when you can't even see them.
    edit:
    On a further note I tried the scrollToIndex() method, tried to disable, that much worked fine. The second I then scrolled back to the previously selected index the list screwed up.
    I even daisy chained functions a second apart (30 frames worth of wait). I scrolled down and that worked so I waited 1 second. I disabled the visible item I wanted to and that worked so I waited another second. I scrollToIndex(0) to get back to the top of the list, the list blew up. Random items (several items) were disabled and the one that I explicitly disabled was enabled.

  • How to limit the number of items in a KPI Status list web part?

    How to limit the number of items in a KPI Status list web part? There is no paging option for Business Category Status list or any limit can be made by changing the Item limit in default view unlike other SharePoint List web parts. So How to achieve it?
    Kindly help.
    Regards,
    ZA
    zzzSharePoint

    Hi,
    According your post, I know you would like to set the item display limit in Status List web part.
    In the web part, the number of items to display is based on the view which you selected when configuring the web part. The default view for status list is status list view.
    However, I am not able to limit the items’ display number of the status list view. After changing the items limit, the list item displayed would not match the number specified by Item Limit. Thus, it is not possible to limit the number
    of items in the Status list web part.
    It could be a potential issue in SharePoint 2010.
    We will log this issue to our suggestion box. As after the submission, we may not have any time guarantee when the fix may be released, but it may come out on next cumulative update.
    Appreciate your time and efforts.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • How to limit the number of items that a list control can hold?

    Hi,
    I am using a Flex3 List control for one of my projects.
    I add drag & drop functionality to it, so that i can drag & drop elements from one control to another.
    How to limit the number of items that a list control can hold / can be dropped in a list control ?
    - Sen.

    1. Listen for the dragdrop event on the control you are dragging onto.
    2. check the length of the items in the dataprovider - if it exceeds your maximum override the default drop action with e.preventDefault(); (assuming you used e for the event on the handler).
    Regards,
    Mark.

  • Displaying items in different colors in a List component

    Hi.
    How can I make each label of an item in a List component
    appear in a different color? I can change the color of the items in
    the list, but I want the items to appear in different colors...
    Thanks,
    - Yuval

    Hi.
    How can I make each label of an item in a List component
    appear in a different color? I can change the color of the items in
    the list, but I want the items to appear in different colors...
    Thanks,
    - Yuval

  • Highlighted default item in list component???

    I can't seem to find how to have an item in a list component
    highlighted by default. I'm sure its right there in the docs
    staring me down, but I dont see it.
    I've found scrollToIndex method, but that doesnt seem to
    actually highlight the index item. How do I highlight an index item
    in a list in as3?
    Thanks,
    Matt

    Oh, I forgot to mention that I am using ActionScript 3.

  • Error: List View Threshold. The number of items in this list exceeds the list view threshold, which is 5000 items.

    Hi, i had created a SharePoint List in cloud ( office 365) using List Template.
    List template contains 12000 items taken as template from SharePoint on Premise.
    I am getting this error message, in SharePoint Online (Office 365)
    The number of items in this list exceeds the list view threshold, which is 5000 items. Tasks that cause excessive server load (such as those involving all list items) are currently prohibited.
    How to resolve it, to get data in my SharePoint list, any help will be appreciated.

    With O365 lists over 5k items are now officially supported but they will have limited behaviour due to the threshold. There are no workarounds or options to increase the threshold either temporarily, for specific users or for the list itself as you have
    with on-prem.
    You'll need to remove enough items to get it below the threshold limit, add indexed columns to support indexed views, then re-add the items again. This article is for 2010 but the section around indexed columns and views is still accurate:
    https://technet.microsoft.com/en-us/library/cc262813(v=office.14).aspx
    It may be possible to add the indexes on your on-prem list where you can increase/avoid the threshold, then re-export the list. That would rely upon the list creation script adding indexes before it uploads items but it's a logical assumption.

Maybe you are looking for

  • Driver issue msi gtx 560 ti hawk

    Which driver to use with msi 560 ti hawk currently using 275.33 but after installing battlefield 3 the game freezes in just 5 minutes of the gameplay the game requires latest drivers 285.xx from nvidia should i update to the latest driver from nvidia

  • Importing via iMovie?

    I want to take parts from DVD's made by recording from television, edit them and write them to a new DVD. The DVD's I want to take parts from for editing in iDVD are in 'TS' format, i.e. opening the DVD in Finder shows one folder called 'VIDEO_TS' an

  • Trouble finding Color of Pixel

    Hello all, I've put together a program which, should return "Success!" if the color if a pixel is equal to the value supplied in an if statement. The values are exactly the same, retrieved from the same pixel, but still when I run the program, the pr

  • Automator "Download URLs completed - 38 warnings. Could not download... The operation couldn't be completed. (NSURLErrorDomain error - 1100.)

    An affifilate company has a website that has a website with a number of web pages, each containing a number of hyperlinks to pdfs. I am trying to create an Automator workflow that allows me to download the linked files on a particular page. I am usin

  • Raw does not open for me ...

    I have a Panasonic Lumix GX7 and CC.  In shooting Raw my pics don't open in Raw.  The camera is supported according to info.  What am I doing/not doing?  Thanks so much. Jim