Create HTML5-Based Mobile-Friendly Interactive Images and Maps
FLDraw Interactive Floor Plan Software  >  Developer Guide  >  JavaScript Interaction

JavaScript Interaction

You can use a browser scripting language, like JavaScript, to call these methods:

 

isReady(): Boolean

Indicates whether the Flash object is ready, and you can call its methods.

Parameters: None.

Returns: true/false (Boolean).

 

needToSave(): Boolean

Indicates whether there are unsaved changes in the plan.

Parameters: None.

Returns: true/false (Boolean).

 

load(path:String, file:String)

Loads a plan file using the specified path and file name.

Parameters:
  • path: The path of the plan to load.
  • file: The name of the plan to load.

Returns: Nothing.

 

save(path:String, file:String)

Saves the currently open plan file using the specified path and file name.

Parameters:
  • path: The path to be used for saving.
  • file: The name to be used for saving.

Returns: Nothing.

 

getValue(param:String):String

Returns the value of the variable that specified in the param parameter.

Parameters:
  • param: The name of the variable.
    Valid Values:
    • path: The path of the current plan file.
    • file: The name of the current plan file.
    • title: The title of the current plan.
    • xml: The source code of the current plan.
    • extra1: The first optional parameter to be included when the Flash object sends a request to the server.
    • extra2: The second optional parameter to be included when the Flash object sends a request to the server.
    • extra3: The third optional parameter to be included when the Flash object sends a request to the server.

Returns: The value of the specified variable.

 

setValue(param:String, val:String)

Changes the value of the variable that specified in the param parameter.

Parameters:
  • param: The name of the variable.
    Valid Values:
    • title: The title of the current plan.
    • xml: The source code of the current plan.
    • extra1: The first optional parameter to be included when the Flash object sends a request to the server.
    • extra2: The second optional parameter to be included when the Flash object sends a request to the server.
    • extra3: The third optional parameter to be included when the Flash object sends a request to the server.
  • val: The new value for the specified variable.

Returns: Nothing.

 

The package includes a sample file that shows how to use these methods. See Package.

Note
When calling a method, you need to encode the parameters in a URL-encoded format, and decode the returned values.