Link Search Menu Expand Document

selector.shuffle

description

See the action command shuffle

syntax

getSelector(ELEMENT_NAME).shuffle()

alternate(s)

  • getSelector(ELEMENT_NAME).shuffle( element1, element2, ... )


example(s)


@newImage("square", "square.png")
@,
@newImage("triangle", "triangle.png")
@    .before( getImage("square") )
@    .print()
@,
@newSelector("shapes")
@    .disableClicks()
@    .add( getImage("square") , getImage("triangle") )
$    .shuffle()
@    .keys(     "F"           ,        "J"           )
@    .wait()
  • Adds two images side by side. Initially, square is on the left, and triangle is on the right, but .shuffle randomly reverses (or does not reverse) the order. A press on the F key will select the image that ends up on the left (whichever it ends up being) and a press on the J key will select the image that ends up on the right (whichever it ends up being).