video.print

getVideo(id).print() Adds the <video> element to the screen. Note that if you use play on the Video element without printing it, the video will play anyway in the background. Example: [js highlight=”2″ try=”true”]newVideo(“skate”, “skate.mp4”) .print()[/js] Show an interface to play the video file skate.mp4 onto the screen.

video.play

getVideo(id).play() Starts playing the video file. Example: [js highlight=”3″ try=”true”]newVideo(“beep”, “skate.mp4”) .print() .play()[/js] Starts playing the file skate.mp4.

video.pause

getVideo(id).pause() (since beta 0.3) Pauses the video file. Example: [js highlight=”10″ try=”true”] newVideo(“sentence”, “skate.mp4”) .print() .play() , newTimer(“preview”, 2500) .start() .wait() , getVideo(“sentence”) .pause()[/js] Starts playing the file skate.mp4 and pauses it after 2500ms.

standard.setVar

getElement(id).setVar( varName ) (since beta 0.3) Stores the current value of the element in the Var element named varName (if it exists). What the current value corresponds to is specific to each element type: For Audio elements, it corresponds to the timestamp of the end of the last playback so far (0 if never played …

standard.remove

getElement(id).remove() Removes the element from the screen. This has no effect for non-visual elements such as the purely interactive . Note that this leaves no space where the element previously was on the page (this is really removing the element, not just hiding it). Example [js highlight=”4″ try=”true”] newButton(“clickme”, “Click me”) .print() .wait() .remove() [/js] …

standard.test.printed

getElement(id).test.printed() (since beta 0.3) Tests whether the element was printed onto the page (and has not been removed since then). Example: [js highlight=”17-27″ try=”true”] newText(“instructions”, “Click on Top/Bottom to NOT print its word”) .print() , newButton(“top”, “Top”) .settings.callback( getButton(“top”).remove() ) .print() , newButton(“bottom”, “Bottom”) .settings.callback( getButton(“bottom”).remove() ) .print() , newButton(“print”, “Print the buttons’ words”) .print() …

standard.settings.visible

getElement(id).settings.visible() (since beta 0.3) Makes the element visible (again). This is useful if you previously hid the element with .settings.hidden. Example: [js highlight=”13″ try=”true”]newText(“instruction”, “Guess what fruit is in the image below”) .print() , newImage(“fruit”, “pear.png”) .settings.hidden() .print() , newButton(“reveal”, “Reveal fruit”) .print() .wait() , getImage(“fruit”) .settings.visible() [/js] Adds some text to the page, a …

standard.settings.size

getElement(id).settings.size(width, height) Resizes the element to a width of width pixels and a height of height pixels. Example: [js highlight=”2″ try=”true”]newImage(“smiley”, “pear.png”) .settings.size(40, 40) .print() [/js] Adds a 40x40px image pear.png onto the screen.

standard.settings.selector

getElement(id).settings.selector( selectorName ) or getElement(id).settings.selector( getSelector(selectorName) ) (since beta 0.3) Since beta 0.3, adds a .settings.selector command to all elements as another method for adding them to a selector. Example: [js highlight=”4,7″ try=”true”]newSelector(“shapes”) , newImage(“square”, “square.png”) .settings.selector(“shapes”) , newImage(“triangle”, “triangle.png”) .settings.selector(“shapes”) , newCanvas(“shapes canvas”, 825, 400) .settings.add( 0, 0, getImage(“square”) ) .settings.add(425, 0, getImage(“triangle”) ) …

standard.settings.right

getElement(id).settings.right() Makes the element appear horizontally aligned to the right. Note: the right means the right of the container of the element, not necessarily the right of the screen. Example: [js highlight=”5″ try=”true”] newText(“sentence”, “This is a longer sentence”) .print() , newText(“helloworld”, “Hello world”) .settings.right() .print() [/js] Prints Hello world onto the screen, horizontally aligned …