B4J Question How to change variable with ws.eval

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi, I have following code run in client(browser) no problem.
I try to modify "motoren1" with ws.eval but I cann't change it with ws.eval("motoren1=true;",null). Why ???

B4X:
});
rootUrl = 'test1/';
assetUrl = 'test1/';
graphicUrl = rootUrl + 'archer.graphic.svg';
configUrl = rootUrl + 'archer.config.json';
contarcher1 = document.getElementById('archer1');
graparcher1 = archer.create(contarcher1);
graparcher1.document.setAssetRoot(assetUrl);
graparcher1.loadUrl(graphicUrl, configUrl);
graparcher1.on('ready', function () {
    graparcher1.view.zoomToFit(0,false);
    graparcher1.view.enableMouse(false,false);
var motorps1 = 0;
var motoren1 = false;   <<<--------------------------------------- I want to change it !!
setInterval(function() {
    if(motoren1) {
        motorps1 = motorps1 + 20;
        if(motorps1 > 100) motorps1 = 0;
        graparcher1.setValue('motor',motorps1);
    };
},100);
graparcher1.setValue('showbao',false);
graparcher1.setValue('showmap',false);
graparcher1.setValue('motor',0);
graparcher1.element('map').on('click', function(element, event) {
   b4j_raiseEvent('archer_event', {'id': element.id,'event':event.type});
 
Last edited:

jinyistudio

Well-Known Member
Licensed User
Longtime User
var motoren1=false(local) -->> motoren1=false(global )
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…