How to increment and decrement a counter with a single button

Is there anyway you can increment and decrement a counter using only one button?

I want this counter in place so that when I leave the stage and go back to it, the visibility of my button will remain the same because of being linked to the meter number.

What would be the best way to implement that it doesn't work when I do it this way.

function show_hide_MC(evt:MouseEvent):void {}

MC.visible =! MC.visible;

(Counter = 0) = (counter = 1);

}

btn.addEventListener (MouseEvent.CLICK, show_hide_MC);

Thanks in advance!

You can use a Boolean value (true/false) rather than a meter to keep track / affecting visibility.  You can use the counter simply to determine if you are starting the file or not.   When you click this button, you set the mc.visible property, and then assign the Boolean value of the visible property of the mc.

var mcVisible:Boolean;    These two variables need to extend the length off the coast of the timeline
var int count;

if(Count == 0) {/ / you just started things so set up}
mcVisible = mc.visible;
Count += 1;
} else {}
MC.visible = mcVisible; you refer then set the visibility of the mc
}

function show_hide_MC(evt:MouseEvent):void {}
MC.visible =! MC.visible; Toggle visibility
mcVisible = mc.visible;    Remember how you left it
}

You can just use the number of establishments, incrementing every time that you click the button and using the module to determine if it has been clicked on an even number of times compared to an odd number of times, and then have a conditional that tests, which affects visibility... something like...

var int count;           will start with a default value of 0

We need to increase the length of the timeline

If (count %2 == 0) {/ / this is the same value}
MC. Visible = true;
} else {/ / this is an odd value}
MC. Visible = false;

}

function show_hide_MC(evt:MouseEvent):void {}
MC.visible =! MC.visible; Toggle visibility
Count += 1;

}

Tags: Adobe Animate

Similar Questions

  • How to group and summarize the values with a vertical drop of 100?

    Dear gurus
    How to group and summarize the values with a vertical drop of 100 as the data indicated below:

    Cas_Cod_ Cas_Amt_ Description
    300 1000A
    301 200 B
    302 350 C
    400 500 A
    401 100 B
    402 25

    Now the data should be grouped like this
    A (300,400) = 1500
    (301,401) B = 300
    C (302,402) = 375

    Make sure that I don't have a column as description in my table to group data on description, its here just to give u an example.

    Hello

    using mod for hundreds:

    with x as
    (
      select 300 code, 1000 amt, 'A' descr from dual union all
      select 301 code, 200 amt, 'B' descr from dual union all
      select 302 code, 350 amt, 'C' descr from dual union all
      select 400 code, 500 amt, 'A' descr from dual union all
      select 401 code, 100 amt, 'B' descr from dual union all
      select 402 code, 25 amt, 'C' descr from dual
      )
       select mod(code,100) code, sum (amt)
        from x
       group by mod(code,100);
    

    Using the mod you get the rest of a division, so mod (300,100) = 0, mod (301,100) = 1, etc.

    Herald tiomela
    http://htendam.WordPress.com

  • can perform us two actions with a single button in two clicks, one after the other?

    Mr President.

    can perform us two actions with a single button in two clicks, one after the other?

    I want that when I click on the button Add once it add data to the database and when I click again on this button it clears the form data to the empty fields.

    Concerning

    Tanvir

    In the code, it should be easy.

    The following code adds that a button called butman with text 'ADD '.
    It then registers a listener that will be called if the user clicks the button.

    This listener then calls the runAddData method if you clicked butman while it contained the text of "ADD" and it calls the runClearData method otherwise.
    That's why he will swap the functionality of the button between ADD and CLEAR on each click.

    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});
    

    I hope that's what you wanted.

    Further reflection.
    You might want to run the ADD and CLEAR methods in their own son so that it can run in the background without slowing down your user interface.

    I also reuse rather a single button for several features instead of to apply with hundreds of nodes used only rarely with masses of code to show and hide as needed.

  • Two actions with a single button Oracle adf

    Hello
    Dear all,
    I want two action with a single button. Before posting, I studied this thread, but it seems that it cannot solve my problem two actions with a single button?
    It's my button and its action http://4.bp.blogspot.com/-tpP5wIW8JLI/T66zhLZgG0I/AAAAAAAAAPY/F1A-Ka8KGPY/s1600/req1.JPG
    getReqID button is actually a call to a procedure that returns a value to his class of action. The cb1_action function is...
    public String cb1_action() {}
    BindingContainer links = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("getReqID");
    Object result = operationBinding.execute ();
    int id = Integer.parseInt (result.toString ());
    System.out.println ("result =" + id);
    If (! operationBinding.getErrors () .isEmpty ()) {}
    Returns a null value.
    }
    Returns a null value.
    }
    It works very well. Don't know I want to, click this button, it also opens a page of .jsff. but I'm unable to open this page.
    Help, please
    Thank you
    Muhammad Nasir

    The first image you provided shows a small 'Attention' sign on the "request for quote-global-TF" which, I guess, gives you the sentence.
    This warning tells you that there is a problem with the task flow that you imported from the pot. Move the mouse over the warning sign a see what message you get from the frame on the error. If you don't get one, in 'source' view and look for red or orange squares in the gutter of the right hand. Scroll to the position of the red square and move the mouse over the underlined part red or orange of the code.

    Timo

  • Removal of MSQL 2 tables with a single button

    As I was able to add data from two tables mysql with a single button, I guess I should be able to delete the two entries in a similar way, but I can't seem to get there. The code is written in large part by DW and I have only the level minimum idea of the meaning of the php, so please be patient in no explanation as to where I'm wrong!
    At the present time, to the chk_sixmonth of the table entry is removed, but at table cel_contents incorrect records are deleted.
    The corresponding code is, I think;
    If ((isset($_POST['ck_pk'])) & & ($_POST ['ck_pk']! = "") & & (isset($_POST['gone']))) {}
    $deleteSQL = sprintf ("DELETE FROM chk_sixmonth WHERE ck_pk is %s",
    GetSQLValueString ($_POST ['ck_pk'], "int"));

    @mysql_select_db ($database_tormented3, $tormented3);
    $Result1 = mysql_query ($deleteSQL, $tormented3) or die (mysql_error ());

    $deleteGoTo = "chk_insert.php";
    If (isset {}
    $deleteGoTo. = (strpos ($deleteGoTo, '?'))? « & » : « ? » ;
    $deleteGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $deleteGoTo));
    }

    If ((isset($_POST['cel_pk'])) & & ($_POST ['cel_pk']! = "") & & (isset($_POST['gone']))) {}
    $deleteSQL = sprintf ("DELETE FROM cel_contents WHERE cel_pk is %s",
    GetSQLValueString ($_POST ['cel_pk'], "int"));

    @mysql_select_db ($database_tormented3, $tormented3);
    $Result1 = mysql_query ($deleteSQL, $tormented3) or die (mysql_error ());

    $deleteGoTo = "chk_insert.php";
    If (isset {}
    $deleteGoTo. = (strpos ($deleteGoTo, '?'))? « & » : « ? » ;
    $deleteGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $deleteGoTo));
    }

    $colname_rstSix = "1";
    If (isset($_GET['scrap'])) {}
    $colname_rstSix = (get_magic_quotes_gpc())? $_GET ["scrap"]: addslashes($_GET['scrap']);
    }
    @mysql_select_db ($database_tormented3, $tormented3);
    $query_rstSix = sprintf ("SELECT * FROM chk_sixmonth WHERE ck_pk = %s", $colname_rstSix);
    $rstSix = mysql_query ($query_rstSix, $tormented3) or die (mysql_error ());
    $row_rstSix = mysql_fetch_assoc ($rstSix);
    $totalRows_rstSix = mysql_num_rows ($rstSix);

    $colname_rstCont = "1";
    If (isset($_GET['scrap2'])) {}
    $colname_rstCont = (get_magic_quotes_gpc())? $_GET ['scrap2']: addslashes($_GET['scrap2']);
    }
    @mysql_select_db ($database_tormented3, $tormented3);
    $query_rstCont = sprintf ("SELECT * FROM cel_contents WHERE cel_pk = %s", $colname_rstCont);
    $rstCont = mysql_query ($query_rstCont, $tormented3) or die (mysql_error ());
    $row_rstCont = mysql_fetch_assoc ($rstCont);
    $totalRows_rstCont = mysql_num_rows ($rstCont);
    ? >
    <! DOCTYPE etc...

    < form action = "" method = "post" name = "scrap" id = "scrap" > "
    < input name = "gone" type = "checkbox" id = "gone" value = "gone" / >
    < input type = "submit" name = "Submit" value = "Remove" / >

    < input name = "ck_pk" type = "hidden" id = "ck_pk" value = "<?" PHP echo $row_rstSix ["ck_pk"];? ">" / >
    < input name = "cel_pk" type = "hidden" id = "cel_pk" value = "<?" PHP echo $row_rstCont ["cel_pk"];? ">" / >
    < / make >
    Thanks for any help

    Problem has now well sorted.

  • How to avoid the stalemate between count with all and several calls from an EP getBackingMapEntry...

    We have a processor input, which initiates a transaction lite by calling getBackingMapEntry on several similar entries.  The same cache distributed these similar entries of accommodation also simultaneously services count with all call and we often a blocking scenario comes from the fact that the count with all call trying to access/key in the same cache block - but in a different sequence - date entry processor accessed (for example, the European Parliament access to similar input 1 then similar input 2 while the count with all attempts to block the same but entries in sequence 2) then the entry 1).  The obvious solution is to change the sequence entry processor accesses these entries to match the sequence used by the count with all operation, but we do not know what sequence consistency applies to operations NamedCache.getAll.  Anyone know?  We believe that we excluded (e.g., consistency does not consider wrt the count with all access sequence) the following:

    • The sequence in an ordered collection of keys such as a list that is passed as an argument to count with all operation
    • The hash code of the key value
    • Any use of Comparable on the keys

    We use 3.7.1 consistency where it varies between 3.7.1 and 12 c.

    Thanks in advance.

    We've thought of it (always happens shortly after the publication on a support site).  If anyone is curious, it seems that the binary class implements Comparable and that consistency sorts instance converted by binary key and access the Scriptures based on this order sorted.  If the entry processor converts the keys to binary instances, sorts and accessed in sorted order, there is no potential blocking (of our observations, at least).  It would be nice if Oracle should document this that people better understand how to write safe concurrent code.

  • Increment and decrement

    I want to do a simulation of increasing numbers and decrements up to a point. Let's say that I start with a constant of 10. I want to increment this 10 until it reaches 50. When he reached 50, I want to decrement, until the return to 10. And from there, it goes back to 50 and so on.

    I'm new to LabVIEW, and by looking at a few examples, I can do the part of the increment. However I can only stop the simulation when he reached 50, and it is not I want.

    Can someone help me with this?

    See attachment.

  • Outlook Express broke down. With XP SP3 can get detailed instructions on how to uninstall and reinstall Outlook Express with the original disc?

    Outlook Express broke down.  With Windows XP SP3 can get detailed instructions on how to uninstall and reinstall Outlook with original disc?

    OE gives an error message standard it is not correctly installed.  Its a remnant message from OE4 and is false.  You probably corruption with folders.dbx and you should remove it.  See www.oehelp.com/OETips.aspx#7 then, after departures OE you must back up your messages and given the corruption, go to file | Identities and setup a new identity for you give a fresh message store and then you can use file | Import | Messages to bring them from the old identity.

    Steve

  • How to stop and restart a .vi with a button front?

    Hey guys, a newbie here.

    I have a .vi with a stacked sequence. First frames are few parameters (LIN master node) and initialization of hardware and hardware data should pass on (the frame response table). In the next section, there is a loop in which the data of sends and receives material (LIN monitor). If I want to change the initialization, settings, or data values, I need to stop the .vi and restart it. I was wondering if there is a simple way to do this with a single click (a button on the front panel).

    An alternative would be to put another loop outiside all stacked sequence, then run it once with a push of a button (the inner loop should leave the reboot on the outside), is it possible?

    I hope I made any sense. Thanks for your suggestions.

    Tomaz

    Ideally, redo the code with a state machine would be the best way to go, if this is so you can add this powerful tool to your Toolbox. That being said, wrapping your existing code in a while work loop, with its own stop button to stop the program, if the execution of the entire sequence is ok. Where you might encounter problems with this, is if there is a step in the sequence that should not be run again, there should be the encapsulation of code from the image of this sequence in a case statement that only runs the first time through. If you have the time, learn how to use a state machine would be a real advantage, really take your LabVIEW knowledge to the next step, if you pardon the pun.

  • How to query and make general dashboards with BSO cubes

    Hello community,

    Does anyone have the General information on how to make dashboards and repository with bso cubes. We did some dashboards with a few cubes of aso, but we know not even how do data appear in an analysis with bso cubes. We really don't know a lot about the difference between these types of cubes. Help demo or resources would be appreciated.

    Thank you!

    Hello

    If you have managed to do with a cube ASO just do the same.

    The ASO or OSB cubes in the end are cubes...

    The different main, that's how you build your cubes as they probably contains different things with different structures.

    Remember that ASO cubic automagically total when you query it, a BSO cube does almost nothing in itself, so if you don't calculate it you have generally not all aggregates, etc.

    If you failed to get the data of your OSB the question is probably more your cube itself: there data? is it calculated? (if you are using SmartView you something?) you model right? etc.

  • increment and decrement variable

    Hi guys

    I m new in the Labview programming and I m working with the NXT module in Labview 2010, and I have a few problems, because I m used to programming in C

    LabView is a kind of diferent than C

    The thing is wath I want to do a speed controller using the NXT brick

    Using the left arrow key increases the speed and by using the arrow button to the right the speed will decrease

    I m usin the actuator connected to the PORT has the NXT brick,

    Thank you

    Diego

    There is a communication i2c vi on the NXTI/O: Advanced palette that allows you to read/write the i2c data. You can take a look at the sensor ultrasonic VI, or saw HiTechnic sensors for examples of the use of this vi. You also need to configure the sensor i2c use port. You can use the VI 'Port of sensor installation' also in the palette of the advances to set the port for Lowspeed9V / RawMode

  • How to insert and remove fragments by clicking on a button, and how to add script?

    I have a question about livecycle. I collect the information from the inventor as a bunch of text fields, each a request some details. Please see below

    inventor.JPG

    Now, I have grouped them all in a fragment called inventordetails and saved as file .xdp, if I could reuse this entire block. I want to add a button under this block, 'ADD MORE INVENTORS' and when you click it it will insert another block and so on and so forth. However, I was not sure how to insert and remove a fragment. Do you think that you can help with this? I appreciate any help in this regard.

    Best

    Luc Marie

    Responded with a solution in a private email.

    Paul

  • How to get out of edit mode tex with a single button?

    Hey,.

    Is there a way to escape from the editing of text with a single click or a button?

    Until now I always press CTRL + ENTER, then V and then I click outside the canvas so that the subsection is not highlighted. But it's a pain in the butt! Cant it be a single button for this?

    Thaks

    AO

    Something interesting, I just noticed: double click outside a text box can have different effects depending on the context.

    • With the selected pointer tool, double click on a text box allows you to edit the text. In this "quick editing" mode, double click outside the text box to go back to the pointer tool.
    • If the text tool has been manually selected, double click outside a text box will create a new text box.
  • How to focus on a web page with a single shortcut?

    I like to use the keyboard, scroll web pages with arrows... If the body of the page loses focus (for instance by pressing Alt + D) the only way (AFAIK) to focus the page again is by pressing Tab several times until I can continue with the scroll arrows. It would be good to focus a page with a single shortcut, is think?

    Press F6.

  • Switch between two intelligent forms with a single button?

    Hello!  I work at 8 Captivate and try to use a single button to switch between two smartshapes.  I can't for the life of me figure out how to do it.  I know its possible to make it 'show' and 'hide', but is it possible to simply create a user click on a button and whenever we click on it, it comes and goes between two different smartshapes?

    Im trying to show the user the functionality on a piece of equipment when they press a button.  When they push the button, it comes and goes between two different read out on the screen.

    Thanks in advance!

    Have you looked at the blog post that I posted a link: I offer 4 scenarios.

    It can also easily be done, if you have a separate (shape) button to switch between two different objects:

    1. Create a user with a default value of 0 v_visib variable
    2. Create two objects and one of them is visible, the other invisible output ("eye" in the Properties Panel icon); I've tagged the ShapeOne and ShapeTwo, where ShapeOne is visible at the beginning
    3. Create this advanced conditional action (you can also turn it into a shared action):

    IF v_visib equals 0
    Hide ShapeOne
    See the ShapeTwo
    Toggle v_visib
    ON THE OTHER

    Hide ShapeTwo

    See the ShapeOne

    Toggle v_visib

    4 assign this action to the success of the button event

Maybe you are looking for