Removal of specific items in a list

Hi all
I have the following problem:

I have a list on stage component.
I have 10 items in the list, selected index is 5.

Now I want to remove all items above 5 (6-10).
In my view, that a table would be a solution but I'm not so good with this so I need your help.

Thank you
Simon

If the instance of your list name is myList, then the following code removes all items after the currently selected element:

Tags: Adobe Animate

Similar Questions

  • How can I remove a specific item of a table?

    Hello.

    I have an array of movieclips and when my (controlled with the keyboard) circle hitTests true with one of the clips inside this table I want to delete this movieclip to the table, so when I hitTest it even once, it returns false (I hitTest using a ' for in ' with this table).

    How to remove a specific item of a table?

    Can someone help me? Thank you very much.

    Try:

    yourArray.splice (yourArray.indexOf (yourmovieclip), 1);

  • By clicking on specific items in a list

    Hey there,

    I am completely new to this (development of applications in general) so I apologize if these questions seem super simple.

    I created a list that appears on the half left of my screen, and I'm trying to load a second list based on which item in the list is selected.

    I am able to get the second list is loaded, but any item is selected in the first list, it still load the same. How can I specify what loading list?

    Thanks again. I searched on the forum and read multiple adobe resources and can't seem to understand this one.

    Well, ithink there are many solutions to your problem, but in my humble OPINION.

    I would not creat the rightlist where the Manager, instead, I got creat that it outside and just sets the data provider in the array/Collection you want as a result.

    i.e.

    rightlist = new List();
    rightlist.dataProvider = myData2;
    rightlist.setSize (list.width = 512 list.height = 300);
    rightlist.setPosition (512, 300);
    rightlist.selectionMode = ListSelectionMode.SINGLE;
    rightlist.allowDeselect = true;
    rightlist. Scrollable = true;
    rightlist.scrollBarAlpha = 0.5;
    rightlist.graphics.beginFill (0x5eff62, 1);
    rightlist.graphics.endFill ();
    addChild (rightlist);

    list.addEventListener (ListEvent.ITEM_CLICKED, onClick);
    }
                
    private void onClick(e:ListEvent):void {}

    If (leftlist. SelectedIndex == 0) rightlist.dataProvider = myData2

    else rightlist.dataProvider = myData3;

    You can make the switch box or something fancy you like...
    }

    It's the easiest way I think (with the exception of the link etc). But you can do many more things facny also...

  • remove the specific item in the arraylist

    Hey,.
    I just want to remove an element from a list of tables.

    private function addNewItem():void {
              object = new ObjectProxy();
              object.id = input.text;
              arrayList.addItem(object);
    }
    

    Now how can I remove the sound element identifying specific?

    something like this:

    arrayList.removeItem(object.id=="blabla");

    or

    for each (obj:Object in ArrayList){
              if(obj.id == "blabla"){
                   ArrayList.removeItem(obj.id);
              }
    }


    I hope you can help me.
    Greetings,
    Zombiecook

    Your second code example is close. Just remove the obj instead of the id when you find it like this:

    for each (obj:Object in list){          if(obj.id == "blabla"){               list.removeItem(obj);          }}
    

    Of course, it would be more efficient to simply do:

    for (var i:int = 0; i < list.length; i++){          if(obj.id == "blabla"){               list.removeItemAt(i);               break;          }}
    

    -Kevin

  • ADD ITEMS TO THE LIST DROP-DOWN LIST TO A TEXT FIELD (USER ENTERS THE ITEM) AND ALSO RELATED TO VALUE

    Untitled.jpg

    I have WANTED to ADD of ELEMENTS from the list drop-DOWN OF THE AREA of TEXT (the ELEMENT NAME) WHERE the USER BETWEEN of THE DESCRIPTION of POINT

    AND RELATED value SHOULD ALSO BE ADDED to THE SAME ELEMENT.

    LIKEWISE REMOVE ITEMS IN THE DROP-DOWN LIST

    PLEASE GIVE SHAPE TO SAMPLE OR JAVASCRIPT FOR THE ABOVE SCENARIO...

    INDEED USEFUL FOR MY PROJECT PLEASE SEND PDF FORM

    Hi Praveen,

    You can add items to the list in a specific order, which would be to load the elements in an array, sorting and then load in the dropdown list drop-down list.  This would be in the click event of the button Add.

    Create a table to hold all the list items, table drop-down list contains objects with a property 'displayItem' and 'value '.

    dropDownItems var = [];

    Add the new

    dropDownItems.push ({displayItem: ItemName.rawValue, value: BoundValue.rawValue});

    Add existing ones

    for (var i = 0; i)< dropdownlist1.length;="">

    {

    dropDownItems.push ({displayItem: DropDownList1.getDisplayItem (i), value: DropDownList1.getSaveItem (i)})

    }

    Sort by ascending order of displayed text

    () dropDownItems.sort

    function (a, b)

    {

    If (a.displayItem< b.displayitem)="" return="">

    If (a.displayItem > b.displayItem) return 1;

    return 0;

    });

    clear all items

    DropDownList1.clearItems ();

    load the sorted items

    for (var i = 0; i)< dropdownitems.length;="">

    {

    var dropDownItem = [i] dropDownItems;

    DropDownList1.addItem (dropDownItem.displayItem, dropDownItem.value);

    }

    clear the fields of the source

    ItemName.rawValue = null;

    BoundValue.rawValue = null;

    I added a button 'Add' sorted in my sample https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g

    Concerning

    Bruce

  • failure of the deletion of an item in a list

    Hello

    I am new to AIR und QNX and try to work through documentation of the RIM.

    Now, I'm at http://developer.blackberry.com/air/documentation/playbook/ww_air_developing/Create_a_list_ms_197099...

    The program creates a list. If I click on a button, it should remove an item from the list. But it doesn't work. Maybe someone has an idea why?

    Just a second question:

    Is there a difference between these two lines? Which variant is to be preferred?

    myList.removeItemAt (1);

    myList.dataProvider.removeItemAt (1);

    Here the important parts of the code:

    Import qnx.fuse.ui.listClasses.List;

    private function initializeUI (): void

    {

    arrMonth.push ({label: "Jan"});

    arrMonth.push ({label: "Feb"});

    ...

    myList.dataProvider = new DataProvider (arrMonth);

    }

    private void myButtonEvent(event:MouseEvent):void

    {

    now remove an item

    option 1: works well!

    myList.removeItemAt (1);

    HERE, THE ERROR SE PRODUCT

    option 2: does not work

    error message: the item to remove is not found

    myList.removeItem ({label: "Jan"});

    I still don't understand the etiquette thing. So I tried that, but it didn't work either

    myList.removeItem ("Jan");

    }

    Thank you very much

    Sebastian

    RemoveItem, you give him the real object that was originally registered on the data provider (pointer reference). You cannot give a new object that has the same values of the original object. If you don't, then you must create a function that makes a loop on your table of data provider and compare the unique field (usually, 'data') of the object is passed to, then call removeItemAt, based on the index in the array.

    It is also a good idea to not rely on the label to be unique in the list. AS3 convention will usually have a 'data' field that is unique for the list. The data field can then be matched to. Without it and you have multiple items with the same label, will lead to problems of selection.

  • How to remove a specific email inbox with the client application code?

    Hello

    How to remove a specific email inbox with the client application code?  Please suggest useful links.

    Advanced thanks.

    Concerning

    Sunil.G

    Your question is a bit broad, so it is difficult to give you details.

    First of all, you must have the ID of the original message. Usually, you get either by hanging the message when he came into the Inbox (by implementing FolderListener), or by retrieving a list of mail of enamel "Store".

    Once you have this message ID, you call Folder.deleteMessage ().

    Here, there is a laboratory of Developer:

    http://NA.BlackBerry.com/eng/developers/resources/Labs/listeningforemail.jsp

    Moreover, classes to look in the API of reference:

    Store

    Folder

    FolderEvent

    FolderListener

    Session

    ServiceConfiguration

    Message (message RIM, not the J2ME)

  • Remove the default value drop-down list

    I am currently working with Acrobat Pro XI version. I want to know if it is possible to remove the default value in a drop-down list.

    When the list less than 4 elements, it is possible to deselect the default value by pressing the spaces below. However, when there are no more elements, it is more possible.

    I read that you need to include white space as a component in the list of elements, however, then you will see an empty list item when people work with the pdf that is not preferable.

    So, nobody how to remove the default value in a drop-down list?

    Thank you!

    OK, I found a perfect solution to my problem by using FormsCentral for Acrobat. Here's what you need to do:

    Step 1:

    -Open FormsCentral

    -Create new form (choose the blank form)

    -Click the drop-down menu to create a new drop-down list

    -Fill out the items in the list by clicking on the timeline (you can also add a label if you want)

    -Click on: file > save as PDF form...

    Step 2:

    -Open the PDF saved (you will now see a blank pdf with a menu drop-down)

    -Click on: Tools > forms > Edit Form (when a pop-up window indicates that you should save a copy of the document in order to make changes, press 'Save a copy' and open the file with Acrobat pdf copy)

    -Select the drop-down list, the drop-down list to copy and paste it into the desired document

    Now you have a drop down without a default choice. Remember that you can not change the items in the drop-down list, because we will choose a default choice and you must use the copy pdf file once again. As long as you do not click on a list item, it is not choose a default choice.

    It is not a perfect solution, but it works for me.

    Good luck and thanks!

  • Removing a specific element of a vector

    I wonder how to remove a specific element of a vector.

    For example, suppose you have the following method:

    private var element:String;
    private vare Element:Vector<String>;
    
    //This function assumes that Element has elements in it.
    public function removeelement(element):Boolean
    {
         for (var i:int =0; i<Element.length; i++)
         {
              if (element == String(i)
              {
                   //How do I remove the element assuming it matches?
                   return true;
              }
         }
    
         return false;
    }
    

    So from the above example code I was using Element.pop () but it's wrong - I think - as it removes the LAST element. I need to remove the item at the location of the match.

    Hello

    You can use splice to delete items, but you must execute the loop starting with the last element (and precalc length as it will change if items are removed) to avoid errors:

    var len:int = element.length;

    for (var i: int = len-1; i > = 0; i--)

    {

    If (item is String (i))

    Element.splice (i, 1);

    }

  • How can I remove duplicate calendars displayed in my list of calendar on my MAC?

    How can I remove duplicate calendars displayed in my list of calendar on my MAC?

    OS X Version of El 10.11.6 (15-1004)

    MacBook Pro (17-inch, mid 2010)

    Intel Core i5 to 2.53 GHz

    4 GB 1067 MHz DDR3

    Macintosh HD

    alexmike,

    Using iCloud? If so, use iCloud: Apple Advanced calendar and troubleshooting iCal - supported

    If this is not the case, what calendars are duplicated?

  • I found the show/hide button toolbars, but you should know how to REMOVE toolbars that appear on this list?

    I found the show/hide button toolbars, but you should know how to REMOVE toolbars that appear on this list?

    Is attached a screenshot of my screen with the context menu to show/hide tabs. I want to delete some of them and let others. Please help me to know how. Thank you!

    Hmm, maybe this "one-time" imported into the new preference? Try this:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste the cust and make a pause so that the list is filtered

    (3) double-click the preference of browser.uiCustomization.state and the content must be highlighted in a small dialog box.

    (4) copy the whole line and paste it into Notepad and save it as a backup.

    (5) in Firefox, click on the button '3-bar' menu > developer > Notepad. Remove the comment that appears and paste data preferably, that must appear on a long line. Click on the "Pretty Print" button to make it more readable.

    So I hope that you can spot the extra toolbars and change them out, taking care to preserve the commas between the elements.

    I don't have the extra toolbars in mine, but I copied and pasted back this spaced format and Firefox was able to handle it well. I went into customize and moved a button, and when I left, Firefox has rewritten the preference set as a single line. Assuming that yours works fine, then you can get rid of the backup from step (4).

  • How to remove the preferences of sanitize Site list?

    What should I add to my userChrome.css file to remove the "site preferences" in the list of the disinfection in the menu history and preferences? I tried looking for him everywhere, I could think of and found nothing useful.

    Why was this topic never registered in the first place? There is very little logic and SeaMonkey does not include it.

    Hello finitarry, you could put this line in userChrome.css:

    listitem[preference="privacy.cpd.siteSettings"] { display:none!important; }
    

    or use a locking file with:

    lockPref("privacy.cpd.siteSettings", false);
    
  • Cannot remove two sent items

    I use outlook express with XP pro & I was able to remove all my items with the exception of two messages. We have a file size of 1283KB & other 8 KB. What can I do?

    Best regards, Mick.

    Close OE and delete the file sent items.dbx (hidden).  OE will create a new when it opens.

    Steve

  • Selecting the item in a list of images

    Hi @ll,

    I tried to get the selected item in a list of images (bbui - 0.9.2.js). If I try to get the selected item as described here

    https://github.com/BlackBerry/bbUI.js/wiki/image-list

    .. .the result is still "not defined".

    Here is my snip of code:

    var mc;
    var bb10HighlightColor = '#00A8DF';
    
    bb.init({bb10HighlightColor: bb10HighlightColor,
          bb10ActionBarDark: true,
          bb10ControlsDark: true,
          bb10ListsDark: false,
          bb10ForPlayBook: true,
    
          onscreenready: function(element, id) {
             if (id == 'dataOnLoad') {
           dataOnLoad_initialLoad(element);
        } else if (id == 'imagelist') {
                var resultList = element.getElementById('resultlist');
                for (var i = 0; i < mc.count; i++) {
                   var item = document.createElement('div');
                   item.setAttribute('data-bb-type', 'item');
                   item.setAttribute('id', mc.contactarray[i].ID);
                   item.setAttribute('data-bb-title', mc.contactarray[i].Company);
                   item.setAttribute('data-bb-img','img/company.png');
                   item.innerHTML = mc.contactarray[i].Zip + " " + mc.contactarray[i].City;
                   item.onclick = function() { onItemSelected('test'); };
                   resultList.appendChild(item);
                }
             }
          },
    
          ondomready: function(element, id) {
          }
    });  
    
    function doSearch() {
       parseJASONAndOpenList('{"count":3,"contactarray":[{"Company":"Acme Inc.","Lastname":"Jackson","Firstname":"Bill","City":"Maincity","ID":"45D6"},{"Company":"Backman Inc.","Lastname":"Burger","Firstname":"Marc","City":"Downtown","ID":"45D7"},{"Company":"Jingle Inc.","Lastname":"Sampson","Firstname":"John","City":"Outercity","ID":"45D8"}]}');
    };
    
    function parseJASONAndOpenList(jsonString) {
       mc = JSON.parse(jsonString);
       bb.pushScreen('imagelist.htm', 'imagelist');
    };      
    
    function onItemSelected(text) {
       alert(text);
       var selectedItem = document.getElementById('resultlist').selected;
       alert(selectedItem.getAttribute('id')); //selectedItem is always undefined here
    }
    

    The image list:

    
    
    
    
    
       
    Test item

    The image list holds something hard (id = "TEST1"), then I add three objects dynamically. After selecting one of the items, I would like to show more details in a new screen.

    I tried to solve in different ways, but the result of

    var selectedItem = document.getElementById('resultlist').selected;
    

    is always "not defined".

    I'm looking for any help!

    Hello!

    This javascript interface comes in 0.9.3 still not available in the version you are using.

  • How to remove unwanted contacts in my contacts list in Livemail

    Original title: removal of unwanted in livemail contacts.

    How to remove unwanted contacts in my contacts list in Livemail

    Right click on them, then choose Delete.

Maybe you are looking for

  • S70-B-118 - Minecraft satellite does not work

    Hello I have just just bought my son a laptop toshiba for his birthday as he wants to use it for playing minecraft, and when we load the program keeps crashing Sadley we are not pros pc if little help would be great the problem.This is what happens.

  • YouTube videos don't play do not.

    Since the update to Firefox 5 I can no longer read the Youtube videos. I get a black box without audio or video. YouTube works on Safari. I updated Adobe Flash, with no improvement.

  • Enter the administrator password

    On my screen appeared to enter a password and he showed a certain number [51428068] can someone help me? Please

  • The controller is restarted PXI of MAX has stopped working

    I have a PXi-8196 controller in which regularly need to be restarted (will post another message on this subject).  For the last 8 months, I was able to restart using MAX from the link to remote systems.  Last week, this method no longer works.  The c

  • HP Compaq Presario CQ62 blank display, solid caps lock light light orange, solid f12

    Good afternoon Currently, I'm stumped on troubleshooting lights error code for a hp compaq cq62 customers. I tried the hard reset, the reinstallation of the memory and even plug the laptop directly into the wall instead of a surge protector with batt