How can I replicate the counter used in the html in the blocks.
<script>
$(document).on("pagecreate","#page1",function() {
$("body").on("swipeleft",function(){
$("span").text(window.AppInventor.getWebViewString());
});
});
if ( counter !== pages ) {
counter = counter + 1;
window.AppInventor.setWebViewString(counter);
}
</script>
<script>
$(document).on("pagecreate","#page1",function() {
$("body").on("swiperight",function() {
$("span").text(window.AppInventor.getWebViewString());
});
});
if ( counter !== 0 ) {
counter = counter - 1;
window.AppInventor.setWebViewString(counter);
}
</script>