How can the value of the increment on stage?

Hello

I'm doing a game where, when the user presses a button it increments a score on stage.

So far, I put a text field on stage with the counter name:

set the value of a variable symbol

sym.setVariable ("score", "0");

SYM.$("counter").html (sym.getVariable ("score"));

How to code a button to increase this score every time on it?

Thank you

Very close, but not quite.  You will need to increment your counter and then store it so that it continues to increment.  A good example of this is in the sample of the Cracidae Catch on the site to animate:

http://HTML.Adobe.com/edge/animate/showcase.html

More specifically, it's what I would do:

1. in compositionReady, initialize the variable like this:

sym.setVariable ("counter", 0);

2. in your scenario where you get a point:

var counter = sym.getVariable ("counter");

counter ++;

SYM.$("counter").html (Counter);

sym.setVariable ("counter", counter);

-Elaine

Tags: Edge Animate

Similar Questions

  • Hello, how can the form in Adobe Muse run on a third-party hosting site?  MANDIC use the server to host the site. More the form of error. I couldn't find the solution to this problem.

    Hello, how can the form in Adobe Muse run on a third-party hosting site? MANDIC use the server to host the site. More the form of error. I couldn't find the solution to this problem.

    Please see this document for troubleshooting:

    https://forums.Adobe.com/docs/doc-3581

    Thank you

    Sanjit

  • How can the PSD CC 2015, I remove the ToolTip of information when you draw a shape layer?

    HI -.

    I don't know what his name but on win 10 / Photoshop CC 2015, whenever I have to draw a shape layer, I get a little window indicating the angle/length/width/etc, I draw.  While I don't know that it is a great tip for some people - for me it's annoying and it covers what I'm trying to see that I draw.

    On 10 of win / Photoshop CS5 - I do not have this information box.

    I looked in preferences under Interface and sliders, but couldn't find out how to turn this "feature".  (Probably because I don't know what his name.)

    How do I turn it off?  How can I disable contact information indicator bit appears so when I draw a shape layer?

    Thanks in advance for your comments-

    J2

    Try

    Photoshop > Preferences > tools > show Transformation values > never

    Concerning

    Pfaffenbichler

  • How can the information of the page

    Dear all,
    I have the original Version contain the values of emp_id, name, number,

    If I click on save button I will be able to get the values in the table by object Row iteration


    How can I able to get the values of the formulas currently appeared in the screen

    (String) (row.getAttribute ("EmployeeID"));

    Other ways to retrieve attributes, see documentation.

  • Dell XPS: HOW can the YEAR BE the CHANGE FOR THE CALENDAR of BUTTERFLY 12 IN HP PHOTO CREATIONS

    I want to make a calendar of 12 months but do not want to use the default date for 2016. How can I change the year of the calendar for 2017?

    Thanks, that's the info I needed.

  • HP 15af131dx laptop: How can the 15af131dx be upgraded to 8 GB of ram if slots are not available?

    I recently bought a HP 15af131dx laptop.  I read the manual and was led to believe it was expandable up to 8 GB of ram.  I just read an ad that says that the two ram slots are not accessible by the client.  So, how can I bring my laptop?  I already bought a stick of ram to 8 GB of Crucial.

    HP 15 - af131dx Notebook PC product specifications and the HP Notebook PC (AMD) / HP 255 G4 Notebook PC - Maintenance and Service of Guide, , it seems that this model is limited to 1 x 8 or 2 x 4 GB. In both cases, the maximum memory based on the MSG is 8 GB of DDR3L/PC3L, 12800 1600 MHz. In addition, removal/replacement of the module memory is listed as a "procedure for only authorized service providers. There are 56 screws that must be removed, replaced or loosened when the upgrade of the memory of this unit. Please begin on page 24 of the GMS and see page 44 for the extent of what it takes.

    If you have any other questions, feel free to ask.

    Please click the 'Thumbs Up' white LAURELS to show your appreciation

  • Accidentally, I chose different language that I don't understand on Apple TV. How can I go back to this first stage in?

    Accidentally, I chose different language that I don't understand on Apple TV.

    How can I return to the language selection?

    See change the language on your Apple TV - Apple Support.

    TT2

  • How can the value of the increment on press the hold button?

    Hello

    When I press the button and hold the button I want to increment _global.lines

    nextline_btn.onPress = function() {}
    If (_global.lines < 25) {}
    _global.lines = _global.lines + 1;
    txt_lines. Text = _global.lines;

    }

    Please help me.

    Thanks JaxNa

    var nTolerance:Number = 500;

    var nIncSpeed:Number = 200;

    var nIntId:Number = null;

    _Global.lines = 0;

    nextline_btn.onPress = function()

    {

    Increment();

    nIntId = setInterval (fastincrement, nTolerance);

    }

    nextline_btn.onRelease = function()

    {

    clearIntervalId();

    }

    nextline_btn.onDragOut = function()

    {

    clearIntervalId();

    }

    function increment (): Void

    {

    If (_global.lines<>

    {

    _Global.lines = _global.lines + 1;

    txt_lines. Text = _global.lines;

    }

    }

    function fastincrement (): Void

    {

    clearIntervalId();

    nIntId = setInterval (increment, nIncSpeed);

    }

    function clearIntervalId (): Void

    {

    clearInterval (nIntId);

    nIntId = null;

    }

  • How can the consumption of ram for a game?

    Original title:;

    RAM problem.

    Hi all, I have 4 GB of ram on Windows XP (32-bit), but games says it's using 500 MB, and I want to know if this is TRUE and if it is true how to use my all concerts.
    Thank you.

    Hello

    1. where exactly do you see that game uses 500 MB?

    2. what game you play and how?

    3. are you with all the questions?

    Provide us with more information about the issue so that we can better help you.

  • How can the world I get rid of this? (Mac)

    I have creative cloud installed on my Mac, but who has caused this icon appears on my menu bar when there are updates available for my software Adobe (Photoshop, CC). I tried to get rid of this icon by uninstalling Photoshop CC and by uninstalling creative cloud - somehow, it's still there!

    It's the icon in question:Skærmbillede 2014-07-11 kl. 02.11.58.png

    Maybe it's stupid, but it bothers me a lot. I looked through the settings and can't find an option to turn it off.

    Help, please! Thanks in advance

    Disable the update for Adobe Update Manager notification icon.

    1. Launch the Adobe application that presents an update that is available in the Adobe Update Manager.
    2. Choose Help > check for updates.
    3. When Adobe Update Manager opens, choose Preferences.
    4. Disable update notification icon. Adobe Update Manager still works, but it no longer displays an icon.

    Please refer to

    Concerning

    Baudier

  • How can the browser get the previous page?

    Here, the code http://supportforums.blackberry.com/t5/Java-Development/Browser-Field-Not-displaying-page-properly/t.... I tried the succeedfully code and I have a question how the browser will access the previous page? If wo wants to return to the page that I watched earlier, how do I do?

    Try: browserField.back ();

    [edit] if it returns false, then there is no page to return (without history).

    E.

  • How can the player WIndows Media 'save' the last place, seen in a video?

    I wish WMP to be able to remember the last place/place in a video, so if I close it accidentally (instead of minimize the window), I can't spend too much time trying to find the exact location. Is this possible?

    AFAIA he can't. Note the time when you close it.

    Try a search on Google for what you want. If you find something, re post because it is of course an annoying problem. !
    See you soon,.
    J
  • Clause type SQL how can the others cannot?

    Hi all

    I met a topic called the type Clause when I was reading Pro Oracle SQL by Karen Morton, Kerry Osborne, Robyn SandsRiyaj Ntanguand Jared still. I just read the chapter and did some practice on my local machine. It is obvious that it is a very powerful feature. And I also reachered on the web and found out that it is used for spreadsheets (excel etc.). Can someone please give me a simple example which, in which case one must use the clauses types SQL Analytic Functions or group Advanced functions cannot cure?

    Either said by the way, I recommend strongly Pro SQL Oracle book to all who want to learn the knowledge of SQL.

    Thanks in advance

    Hello

    In short Yes, the TYPE clause allows you to perform calculations of "spreadsheet-like". With the help of the clause TYPE is quite rare. Now with the introduction of the WITH recursive clause in 11g 2, you can almost everything in SQL, do not even talk about the pattern match feature introduced in 12 c.

    You can probably do now with analytical functions / recursive clause the clause of MODEL can do. And I must say that it is a shame that the TYPE clause has never been improved since its introduction in 10g.

    In my view, the clause TYPE can come in handy when you need cross reference calculations (typically dealing with periods such as dates, years, weeks). For example, I personally used a MODEL clause for an analysis of sales time, where I watch the sales of previous years to find a pattern for the current. References of cells in a MODEL clause allows to easily, something like [my_year, my_week] model = local_pattern [(y ENTRE CV()-2 ET CV) (-1, w BETWEEN (CV-2) RESUME AND () + 2)]

  • How can THE CS6, I change the size of multiple objects without widening the space between them?

    I would extend about 400 tiny ellipse but I need them to fit in the same space and not distributed.

    Select all, then take a look at object > transform > transform each. You can make a difference to the individual Center of each object, rather than as a group.

  • How can the touchpad disabled when my logitech mouse is plugged in via usb. When I used Control Panel to disable tp, it says that it is disabled.

    touchpad and mouse are active, even if the touchpad is disabled

    In some extreme cases, I helped people a piece of lightweight cardboard of stripes on their touchpad... Unless you have two panels of control parameters of competitors, it should really be disabled systemwide with a notch.

Maybe you are looking for