Help me Counter the Counter Object!

  1. 2 months ago

    HI $("#counterValueLabel").html(obj6262_counterValue):

    I have tried to learn how this Counter Object works but, I have failed and reading the forum so have many others since 2018 - possibly given up and gone to another product! Why is there no simple video to explain how to create the demo on the link below. I have also tried to learn to PubCoder examples - there is one for increase maths number -/+.

    I have worked out the font is created using Java code - why? Stick with basic for begineers.

    Bit I cant workout is this (from example on pubcoder functionality - number/maths example):
    $("#counterValueLabel").html(obj6262_counterValue):

    How does counter value get displayed? How can i find out Obj number e.g. 0bj6262? How is value max set to 5 max?
    As a beginner, I dont stand a chnace. It is fantastic product but, if there are no explainer video for essential tools such as a counter then, people like me will simlply give up! Its a shame product is excellent but, no simple tutorials - demo if on link below but, cant get hold of it to study it.

    Close to giving up with ths excellent product!

    HELP!

    https://docs.pubcoder.com/pubcoder_counter_object.html

    Anybody got examples or please exaplain - Thanks in advance

  2. Angelo S

    Sep 15 Administrator

    Hello Zahir,
    you can get the counter value and display it in a text object using a "run javascript" action like this in the counter "value change" event:

    var cnt = PubCoder.getCounterValue("#obj120");
    PubCoder.switchText("#obj138", "Counter Value: " + cnt);

    please change the #objXX to your object IDs.

    you can download an example here: https://www.dropbox.com/s/4k2tvyfjjzutxiu/counter.pubcoder?dl=0

  3. Angelo,

    Thanks very much, this has been really useful and so pleased that I can progress with my e-learning book

    I almost understand the Java code and how the counter is used.

    I have also poster a reply from Anna which was also very useful - this will help others in the future ;

    You can find the ID of the object by activating the hash symbol at the bottom of the levels window.
    The first ID is the counter, enter the ID of your counter.
    The second ID is the text box, enter the ID of your text box.

    The counter increases each time an item is dragged to the plate.
    A “Drag object” action is entered on each of the ingredients; if the object is dragged into the “Drop Zone,” the counter is incremented by one value.
    Here is a link to the documentation on how the “Drag Object” action works: https://docs.pubcoder.com/pubcoder_events_and_actions.html#drag-object

    Best,
    Anna
    Support Team PubCoder

  4. Once I have fully mastered the example, I might even attempt to do short YouTube video on this to help others.

    Thanks the support team

  5. NOTE typo above - it not the level panel - it should say LAYERS PANEL # code at the bottom.

 

or Sign Up to reply!