blockly-threex icon indicating copy to clipboard operation
blockly-threex copied to clipboard

Run Bug

Open randompast opened this issue 11 years ago • 1 comments

http://jeromeetienne.github.io/blockly-threex/apps/index.html#%3Cxml%3E%3Cblock%20type%3D%22controls_repeat_ext%22%20inline%3D%22true%22%20x%3D%2291%22%20y%3D%2271%22%3E%3Cvalue%20name%3D%22TIMES%22%3E%3Cblock%20type%3D%22math_number%22%3E%3Ctitle%20name%3D%22NUM%22%3E8%3C%2Ftitle%3E%3C%2Fblock%3E%3C%2Fvalue%3E%3Cstatement%20name%3D%22DO%22%3E%3Cblock%20type%3D%22draw_move%22%20inline%3D%22true%22%3E%3Cvalue%20name%3D%22DISTANCE%22%3E%3Cblock%20type%3D%22math_number%22%3E%3Ctitle%20name%3D%22NUM%22%3E0.5%3C%2Ftitle%3E%3C%2Fblock%3E%3C%2Fvalue%3E%3Cnext%3E%3Cblock%20type%3D%22draw_turn%22%20inline%3D%22false%22%3E%3Cvalue%20name%3D%22ANGLE%22%3E%3Cblock%20type%3D%22math_number%22%3E%3Ctitle%20name%3D%22NUM%22%3E180%3C%2Ftitle%3E%3C%2Fblock%3E%3C%2Fvalue%3E%3C%2Fblock%3E%3C%2Fnext%3E%3C%2Fblock%3E%3C%2Fstatement%3E%3C%2Fblock%3E%3C%2Fxml%3E

Pressing "Run" multiple times in a row gives weird results (The character twirls). Run shouldn't fire until the script has terminated.

Ex: Turtle Graphics: https://blockly-demo.appspot.com/static/apps/turtle/index.html

randompast avatar Dec 16 '13 00:12 randompast

very true. this is due because the page isnt reset when the button is pressed. so you end up with multiple instance of the program running

possible alternative

  • on button 'run' pressed
  • set a flag 'excecutionNeeded'
  • reset the iframe
  • on iframe load, check flag
  • if flag set, push the code in the viewer and run it

jeromeetienne avatar Dec 16 '13 06:12 jeromeetienne