How to add an element to an array, and then be able to remove more precisely

So, I have a list of numbers. The user can then add numbers to this list. I have a button that allows the user to remove any number of their choice by typing this number in a text box. For some reason the numbers that the user adds to the list will not disappear once selected, while the original numbers go without problem.

The name of the table itself is mesEntiers and the name of the TextBox: IntegersIn_txt

Here is the code:


function supprimer(event:MouseEvent):void

{

var indiceChiffre:int;

indiceChiffre = (mesEntiers.indexOf (IntegersIn_txt.text));

The indexOf method returns the index of an element or - 1 if not found.

trace ("testBtn")

If (indiceChiffre! = - 1).

{

for (var i = indiceChiffre; i < mesEntiers.length; i ++)

{

mesEntiers [i] = mesEntiers [i + 1];

trace ("test")

}

mesEntiers.pop ();

}

} / / End of function remove.

Two things I can think (I ran a small test)...

(1) make sure your textfield is a single line, multi-line not... multi-line end up with additional stuff in them that you can't see.

(2) convert the text to a number unless the table is now strings... indiceChiffre = (mesEntiers.indexOf (Number (IntegersIn_txt.text)));

Tags: Adobe Animate

Similar Questions

  • How to add corresponding elements of two arrays in a continuous acquisition?

    Hi all

    I am writing a program (in version 9.0 of labview) to acquire the signal of a fast set. I use the acquisition rate of 1.25 Ms with an external trigger. Now what I need, is to add the "n" data these acqisitions and then further process.  E.g. If I signal to 200µs acqiring can total number of data points with the acquisition of 1.25Ms rate will be 250. I'll get a table 1 d of 250 data points whenever I run my acquisition.

    Let's say Array 1of acquisition number 1, 0.1, 0.3, 0.5, 0.6,... up to a total of 250 data points

    Table 2 of the acquisition by number 2, 0.4, 0.5, 0.8, 0.4,... up to a total of 250 data points

    ----------------------------------------------------------------------------------

    Added table should be 0.5, 0.8, 1.0, 1.3... .route to a total of 250 data points

    -----------------------------------------------------------------------------------

    To do this, I need first to save the table of acqisition number 1, then run the No. 2 acquisition and add points of data corresponding to the saved table. This should continue at a nuber defined by the user to purchase say 10, 20 or 50... I don't know how to do it. Can someone help me with this problem?

    Thank you very much in advance

    Kind regards

    Champion

    I guess that time avarages and acquisition will not change during the measurement, so keep a cela outside loops. If you know your settings for made her make it constant.

    you create task (outside the loop) and a narrow at the end.

    Avoid the dashboard generation where possible. With no.. AV., and no. acq.points declared, the size of the arrays is fixed and you can (re) use a single Bay and replace the elements in the array.

    No need to collect all the data and avarage them after the rally. Just add

    I add a suggestion

  • How to add structural elements in cs6? [was: martrells43378323]

    How to add structural elements in cs6

    You add HTML tags to your code in Code view.

    Or you can add them in Design view by opening the INSERT Panel and click on layout. In earlier versions, it was called Structure.

    Nancy O.

  • Upadate elements of an array and reuse them

    Hi all

    I have a problem with the update of the elements of an array and use these items again. Well, I have the clearer idea. I have a one-dimensional array of double. Now I'm just comparing two adjacent elements. If the difference is greater than a threshold, I need to update all other elements (for example, add 100 with all the remaining items). Then repeat the whole things until all elements are compared.  I tried the following. But I'm not sure how to use the updated table "Method 2" instead of "method 1" in the following loop. ' " In Place element Structure"has not helped.

    I know it's pretty simple in C++, where we can use the reference to the table. I'm new in labview and don't know how to do it here in labview.

    Looking for your help.

    BR.

    Rosen

    Have you tried just using the tool 'unwrap the phase"?

  • I would like to migrate from Aperture. What happens to my masters that are on a RAID array and then what should I do with my safe which is located on a separate drive please?

    I'm sorry, but I'm loud understand what happening to my master original RAW files, I keep offline on a RAID array and then what I do with my safe that, like all my photos modified? Sorry for this simple question, but would someone help please my lift the fog?

    Thank you

    Rob

    One of the major downfalls of Aperture is that it shows you where are your pictures. They always favored it as a feature (even as a ' new paradigm'), but it's not so wonderful when you need to do something about Apple never intended. Then, it sounds really like it led to you not knowing where your files or files that correspond to which elements of the UI opening. I suggest that you need to nail for yourself - images from Aperture to right click and choose Show in Finder, until you know where everything is.

    Otherwise, make sure you have plenty of available disk space, stop asking questions and just see what happens when you run plugin import LR with the options I suggested. It won't damage the opening.

  • How to ensure that my computer has microphones and then use them for talking to Cortana?

    How to ensure that my computer has microphones and then use them for talking to Cortana?

    Hi Walter,

    Please start by http://windows.microsoft.com/en-us/windows-10/cortana-privacy-faq

    Also, try to review this tutorial: http://www.tenforums.com/tutorials/4026-cortana-turn-off-windows-10-a.html

    They should help you get started.  Problems specific to the micro (existence, activation, volume,...) will be addressed (more than the troubleshooting steps if Cortana doesn't) that you go through the above; However, a "one-stop-shop" for microphones & recognition recording & speech covering all peripheral aspects are versatile control panel page (see the path in the blue header at the top of the screenshot pictured below for W10Pro 11102).

    Best wishes

    Kosh

  • How can I disable photoshop on one computer and then activate it on another computer?

    How can I disable photoshop on one computer and then activate it on another computer?

    It depends on. Versions of CS: help > Deactivate.../Help > Activate on the new PC

    Versions CC: help > disconnect / connect on the new PC

    Also, you should know that you have an activation limit of two PCs for a single product.

  • How to add listbox form in string array objects

    Hello

    I need help related to listbox

    1. currently, I am able to select and implement string in array

    Prob is

    ex.

    When I select the point 1 and 1 point will be created on arrayString but when I select article 2 and article 3 then arrary string poster article 2 and article 3 and article 1 is deleted.

    So please let me know how to add, add and delet listbox to string in array.

    2. how popup listbox and allow the user to add, delet or add the items in the listbox control and the transfer to the string table

    I have my code atatched. Please help me.

    Thank you

    Clement

    Sorry, try this:

  • How to use the elements in the array

    Hi, I am trying to automate a questionnaire using table.

    In the compositionReady for the scene

    SYM. Actual = 0;

    sym.arr = ['Hi', 'Love', 'You'] / / this is my picture of the issue.

    sym.checkArr = function() { / / this function I use to check the issue table whis I'll use.}

    sym. Question = arr [real];      I want to use the value 'Hi' and then increase my 'real' var and then use the value 'Love '.

    }

    In my symbol calendar, I use a trigger in the trigger that I use

    SYM. Stop();

    sym.quest = sym.getComposition () .getStage (). Question; / / I get the value of the Question;

    Sym. $("Ask") .html (quest);                                                        "Ask" is an empty textfield;

    sym.getComposition () .getStage (invested) ++;                    Increase 'real' for the nex time.

    But the code does not work, I think that the problem is the way I use the array index.

    Help, please!

    Thank you =)

    Hello

    chino_10 wrote:

    at the outbreak of timeline you why did you use a local variable?

    It is advisable to use local variables when possible. The quest variable apply only to this trigger, and it will not be postponed to another trigger in the same timeline. So when you use a trigger to set the HTML for a text element in the same timeline, I find cleaner to assign a new value of a local variable HTML.

    chino_10 wrote:

    and if you call the 'real' global variable of Manager compositionReady of why didn' there you call him with all the way like ' sym.getComposition () .getStage (invested) ++; '?

    I think I have didn't express it as clearly as I could have. When you declare sym.actual in compositionReady, you actually declared a variable whose scope is the symbol of the main stage - it is not a global variable. To declare a global variable (which is not always recommended), your code in compositionReady would be:

    real = 0;

    This real variable would now be accessible from any element/symbol in the composition simply by assigning a value to the membership. You can see how quickly this could be embarrassing.

    So back to the scope of variables: If you declare a symbol variable using sym.varName, any element in the same scope may call using sym.varName. If your main scenario triggers can call without using the full address of sym.getComposition () .getStage () invested ++. Instead, you can simply use ++ sym.actual. Less code and easier to read. But if you call from another symbol (outside), you need to use the full, addressing the address actually the variable, i.e., sym.getComposition () .getStage () invested ++.

    HTH,

    Joe

  • How to add HTML elements in a TextArea?

    I want to format fo the data to display on a text using HTML box.

    How to add updated HTML text in shape to a non-editable text box?

    https://www.BlackBerry.com/jira/browse/BBTEN-42

  • How to add an element with a namespace prefix.

    I have a very simple problem, but I think I go about it the wrong way.

    I have the following variable of XMLTYPE in pl/sql:

    <A xmlns="namespace" xmlns:def="myns_namespace">
         <B/>
    </A>
    

    In a separate step, I would like to add the following after B: element

    <C attr="attribute" def:defattr="def_attribute"/>
    

    To produce the following XML:

    <A xmlns="namespace" xmlns:def="myns_namespace">
         <B/>
         <C attr="attribute" def:defattr="def_attribute"/>
    </A>
    

    What is the best way to do it?  I tried the following:

    1. the following statement fails because when you create the item C, oracle complains "prefix 'def' is not declared."  It's logical.

    SELECT
    insertChildXML(
         eltA,
         '/A/B',
         'C',
         xmlElement("C", xmlAttributes('attribute' "attr", 'def:defattr' "def_attribute")),
         'xmlns="namespace" xmlns:def="myns_namespace"'
    )
    INTO ...
    

    2. I also tried to create C element with namespace attributes before adding to the element and then removing the namespace declaration attributes using deleteXML.  This does not apparently the function can remove attributes, but it cannot remove namespace declarations. I try to avoid ending up with this:

    <A xmlns="namespace" xmlns:def="myns_namespace">
         <B/>
         <C xmlns="namespace" xmlns:def="myns_namespace" attr="attribute" def:defattr="def_attribute"/>
    </A>
    

    I was hoping to find a function that could be one of the following:

    1 create fragments of the element, ignoring prefixes to namespace and does not throw an error.

    2 remove the specific namespace declarations, or any statement redundant namespace.

    3. Add a child element otherwise wherein the child element would not need to be created and validated independently before being added to the parent.

    4 maybe I treat everything the wrong way and need to rethink my strategy on this xml creation?

    You will have to do it in two steps in order to avoid the redeclaration of namespace at the level of the child:

    SQL > SELECT xmlserialize (document

    (2 insertchildxml)

    (3 appendChildXML)

    4 xmltype ("")

    5             , '/A'

    6, xmlelement ("C", xmlattributes ('attribute' is "attr"))

    7, 'xmlns = "namespace" '

    8             )

    9           , '/A/C'

    10, ' @def: attribute '

    11, "def_attribute".

    "12, ' xmlns ="namespace"xmlns:def ="myns_namespace""

    13           )

    14 indent

    15         )

    16 DOUBLE;

    XMLSERIALIZE (DOCUMENTINSERTCHI

    --------------------------------------------------------------------------------

  • How to add an element to the root of the Windows Explorer. Either by using the Extension of the Shell, registry, Windwos command or c#.

    IM responsible for customize Windows Explorer of the customer by adding an element similar to DropBox, where the user clicks on the element to load files and directories.

    This can be done in the following: Extension of the Shell, registry code, Windwos command or c# (preferably).

    Thank you in advance.

    Hello
    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums
    MSDN forums
    I hope this helps.
  • How to add the menu, under menu, forms and functions function and sub in resp.

    Can someone please provide me or direct me to the documentation, resources or the tuitorials "How to add menu, submenu and forms, function and functions in responsibility within the HRMS to the front end, not the example of back-end sub function responsibilities.»

    Appreciate your help.

    Published by: 931161 on December 14, 2012 10:55

    Hello

    PL. visit following links.

    http://erpschools.com/articles/sub-functions-in-Oracle-application#13554535205441&95816:resize_frame
    http://www.trutek.com/Serendipity/index.php?/archives/15-an-example-of-how-to-create-custom-functions, - the Menus - and - Responsibilities.html
    http://www.YouTube.com/watch?v=PKUiVIM0t94

    HTH
    Sanjay

  • How to add a Sprite in a container and animate it with AS3?

    I am quite experienced Actionscript 3 programmer (I mainly work in the Flash IDE), but come back to Flex after a 2 year hiatus.  I know this may seem ridiculously simple, but how do I add a container (i.e. a Sprite object) on stage in flex and animate a Sprite object inside?  I want to make a VU-meter for audio out an application which is simply two rectangles that will resize vertically to the level of the master channel volume.

    In AS Flash/pure, I would simply create 2 Sprite objects, add them to the stage or some other container Sprite and then proceed to change their scales Y at regular intervals with the following code:

    protected function enterFrameHandler(event:Event):void

    {

    If (isPlaying)

         {

    / / Level display update...

    var lftAmp:Number = 0;

    var rtAmp:Number = 0;

    lftAmp = Math.max (outputChannel.leftPeak);

    rtAmp = Math.max (outputChannel.rightPeak);

    leftPeak.scaleY = ((Math.round(lftAmp*40)) / 20);

    rightPeak.scaleY = ((Math.round(rtAmp*40)) / 20);

         }

         else

    {

    leftPeak.scaleY = 0;

    rightPeak.scaleY = 0;

         }

    }

    With MXML, I am at a complete loss!

    Where should I put the Sprites (what container in Flex should I add them also)?

    How can I add them to a container?

    What should I use to keep the regular calendar (EnterFrame or a Timer object)?

    I bought 2 books on Flex and doesn't really seem to take account of the fact that I want to animate in Actionscript 3, FLEX NO!  They suggest using the animate class and class AnimateInstance, etc...  This seems much more complex and adds layers of abstraction that is really not needed!  One of the reasons that I stopped using Flex 2 years has been done the same type of problem I'm facing here!  MXML is great when it comes to components and to simplify the page layout, however, when we want to do something out of pure standard with ActionScript, MXML adds a convoluted layer of complexity which is not always as intuitive as one would expect!  Maybe I go about it the wrong way, but I'm used to doing things with ActionScript only!

    Thanks in advance for any help/advice anyone can give!

    Matt

    MXML is a markup language and allows people to easily put all the applications using

    a setting that common componentizes models and features.  It is not

    As you complete as programming language can almost think MXML as a

    language of macros.

    If you look at the framework itself, it is almost entirely written in

    ActionScript (with the exception of the spark skins), because we try to encapsulate

    things at low altitude.

    Then write your component did you and add it to your application via MXML.  Follow it

    recipes for the custom components in the doc.  It's more work that simply write

    a simple flash application, but the standard benefits of encapsulation and reuse

    apply.

    And you can always stick a UIComponent in your MXML, give it a fixed

    width/height and use this as a sprite.

  • How to add groups of radio buttons values and show the answers?

    I have eight groups of option buttons. The student must select the button from each group. It is a survey of personal intrestet. If each of the groups will have a button with related values. I need to add values and display the results.

    I have been looking for help, but can't find anything that explains how to add values of radio buttons and display the answers.

    That's what I got so far:

    The option button ActionScript 3.0 / / Avraham Saltoun / / solutions to say-web dot com / / FREE to USE, COPY and DISTRIBUTE

    Import fl.controls.RadioButton;
    Import fl.controls.RadioButtonGroup;
    These libraries must be imported
    in order to access the properties and methods of the Radio button.


    We will Appply formatting
    for the radial buttons
    var format: TextFormat = new TextFormat;
    format. Size = 16;
    format.font = "Trebuchet MS"
    format. Color = 0xFFFFFF;

    myNonconformist.label = "a maverick".
    myConcreteThinker.label = "a concrete thinker."
    myNaturalWithNumbers.label = 'a natural with numbers. "
    myAnalytical.label = "Analytics."
    myAssertive.label = "assertive".
    myIdealistic.label = "Idealistic."
    myCareful.label = 'Careful ';
    myProblemSolver.label = "a problem solver."
    myConscientious.label = 'consciousness '.
    myCreative.label = "Creative."
    myPrecise.label = "precise."
    myEfficient.label = "effective."
    myEnergetic.label = 'energetic ';
    myExpressive.label = 'Expressive ';
    myFriendly.label = 'Friendly ';
    myPersistent.label = 'Permanent '.
    myHelpful.label = "fairly useful";
    myInnovative.label = "innovative";
    myInquisitive.label = ' Inquisitive/Curious. "
    myAccurate.label = "precise."
    myEnthusiastic.label = "enthusiasts";
    myInsightful.label = "insightful";
    myIntuitive.label = 'intuitive ';
    myMechanicallyInclined.label = 'mechanically inclined. "
    myObservant.label = 'observer ';
    myOutgoing.label = "outgoing";
    myPatient.label = "Patient";
    myPersuasive.label = "persuasive."
    myRealistic.label = 'realistic ';
    myPractical.label = 'practice ';
    myScientific.label = 'scientific ';
    mySelfconfident.label = "safe";
    myImaginative.label = "imaginative."
    mySociable.label = "Sociable".
    myStraightforward.label = "direct."
    myUnderstanding.label = "understanding."

    Now, let's apply the style
    created for our labels
    myNonconformist.setStyle ("textFormat", format);
    myConcreteThinker.setStyle ("textFormat", format);
    myNaturalWithNumbers.setStyle ("textFormat", format);
    myAnalytical.setStyle ("textFormat", format);
    myAssertive.setStyle ("textFormat", format);
    myIdealistic.setStyle ("textFormat", format);
    myCareful.setStyle ("textFormat", format);
    myProblemSolver.setStyle ("textFormat", format);
    myConscientious.setStyle ("textFormat", format);
    myCreative.setStyle ("textFormat", format);
    myPrecise.setStyle ("textFormat", format);
    myEfficient.setStyle ("textFormat", format);
    myEnergetic.setStyle ("textFormat", format);
    myExpressive.setStyle ("textFormat", format);
    myFriendly.setStyle ("textFormat", format);
    myPersistent.setStyle ("textFormat", format);
    myHelpful.setStyle ("textFormat", format);
    myInnovative.setStyle ("textFormat", format);
    myInquisitive.setStyle ("textFormat", format);
    myAccurate.setStyle ("textFormat", format);
    myEnthusiastic.setStyle ("textFormat", format);
    myInsightful.setStyle ("textFormat", format);
    myIntuitive.setStyle ("textFormat", format);
    myMechanicallyInclined.setStyle ("textFormat", format);
    myObservant.setStyle ("textFormat", format);
    myOutgoing.setStyle ("textFormat", format);
    myPatient.setStyle ("textFormat", format);
    myPersuasive.setStyle ("textFormat", format);
    myRealistic.setStyle ("textFormat", format);
    myPractical.setStyle ("textFormat", format);
    myScientific.setStyle ("textFormat", format);
    mySelfconfident.setStyle ("textFormat", format);
    myImaginative.setStyle ("textFormat", format);
    mySelfconfident.setStyle ("textFormat", format);
    mySociable.setStyle ("textFormat", format);
    myStraightforward.setStyle ("textFormat", format);
    myUnderstanding.setStyle ("textFormat", format);

    Event listeners
    Define waiting for the compiler
    for a click
    myNonconformist.addEventListener (MouseEvent.CLICK, whoAmI);
    myConcreteThinker.addEventListener (MouseEvent.CLICK, whoAmI);
    myNaturalWithNumbers.addEventListener (MouseEvent.CLICK, whoAmI);
    myAnalytical.addEventListener (MouseEvent.CLICK, whoAmI);
    myAssertive.addEventListener (MouseEvent.CLICK, whoAmI);
    myIdealistic.addEventListener (MouseEvent.CLICK, whoAmI);
    myCareful.addEventListener (MouseEvent.CLICK, whoAmI);
    myProblemSolver.addEventListener (MouseEvent.CLICK, whoAmI);
    myConscientious.addEventListener (MouseEvent.CLICK, whoAmI);
    myCreative.addEventListener (MouseEvent.CLICK, whoAmI);
    myPrecise.addEventListener (MouseEvent.CLICK, whoAmI);
    myEfficient.addEventListener (MouseEvent.CLICK, whoAmI);
    myEnergetic.addEventListener (MouseEvent.CLICK, whoAmI);
    myExpressive.addEventListener (MouseEvent.CLICK, whoAmI);
    myFriendly.addEventListener (MouseEvent.CLICK, whoAmI);
    myPersistent.addEventListener (MouseEvent.CLICK, whoAmI);
    myHelpful.addEventListener (MouseEvent.CLICK, whoAmI);
    myInnovative.addEventListener (MouseEvent.CLICK, whoAmI);
    myInquisitive.addEventListener (MouseEvent.CLICK, whoAmI);
    myAccurate.addEventListener (MouseEvent.CLICK, whoAmI);
    myEnthusiastic.addEventListener (MouseEvent.CLICK, whoAmI);
    myInsightful.addEventListener (MouseEvent.CLICK, whoAmI);
    myIntuitive.addEventListener (MouseEvent.CLICK, whoAmI);
    myMechanicallyInclined.addEventListener (MouseEvent.CLICK, whoAmI);
    myObservant.addEventListener (MouseEvent.CLICK, whoAmI);
    myOutgoing.addEventListener (MouseEvent.CLICK, whoAmI);
    myPatient.addEventListener (MouseEvent.CLICK, whoAmI);
    myPersuasive.addEventListener (MouseEvent.CLICK, whoAmI);
    myRealistic.addEventListener (MouseEvent.CLICK, whoAmI);
    myPractical.addEventListener (MouseEvent.CLICK, whoAmI);
    myScientific.addEventListener (MouseEvent.CLICK, whoAmI);
    mySelfconfident.addEventListener (MouseEvent.CLICK, whoAmI);
    myImaginative.addEventListener (MouseEvent.CLICK, whoAmI);
    mySelfconfident.addEventListener (MouseEvent.CLICK, whoAmI);
    mySociable.addEventListener (MouseEvent.CLICK, whoAmI);
    myStraightforward.addEventListener (MouseEvent.CLICK, whoAmI);
    myUnderstanding.addEventListener (MouseEvent.CLICK, whoAmI);
    Note that all lead to the same function.

    It will probably be better for you to do it the hard way and assign labels, values and groups in the programming environment using the settings panel.

Maybe you are looking for

  • Pavilion dv7 cl6157: USB Ports do not work

    All my USB 2.0 and 3.0 ports suddenly stopped working.  In Device Manager all have beside them yellow warning triangle.  When I click on the ports, it says "cannot load the driver for this hardware device.  The driver may be corrupted or missing (Cod

  • Outlook Express problem - when I receive an email in Outlook Express, it goes immediately into the "Deleted items" folder

    When I receive an email in Outlook Express in Windows XP, it will immediately in the "deleted items" folder  How can I fix it? Thank you

  • Question on HP recovery disks

    The thing is, im about to upgrade my motherboard and buy Windows 7 as my vista OEM license becomes zero, but on this upgrade, the parts that are remains a do a computer itself without a hard drive. Now the question is: if I do recovery HP discs will

  • Wireless card internal s3712f

    I have an old s3712f of flag and I was wondering if there is an internal port for adding a wireless card not to mention that the ports pci-e? And if there is, the wireless card I could use? Preferably a wireless n card.

  • MokaFive orphaned objects

    I'm new as a result of Mokafive, and I ran into a position where the main image store has orphaned objects.  These were created when I was trying to upload an image and it failed due to the main image bank ran out of disk space.  It's in our region o