Index of /lingo/js_framework

Icon  Name                    Last modified      Size  Description
[PARENTDIR] Parent Directory - [DIR] mac/ 2012-03-20 02:24 - [DIR] win/ 2012-05-01 17:18 - [TXT] readme.txt 2012-03-20 02:24 1.8K
/*
 * Simple Framework v0.3
 *
 * A simple Framework for coding Director apps in JavaScript (or Lingo)
 * without the Director IDE.
 *
 * Copyleft 2012, Valentin Schmidt
 * Date: 2012-03-19
 *
 * Contains some Code from jQuery 1.7.1
 * http://jquery.org/license
 */


The stub projector on start automatically loads all JavaScript (*.js) or Lingo files (*.ls) 
found in folder "scripts" into the castlib.

Put your own code into "demo.js" and/or add arbitrary other script files to the folder.

The framework provides various useful functions (some of which are stolen from JQuery, see
http://api.jquery.com/). All functions can be accessed under the global object "$".

To see a list of all provided functions, enter

  dir($) (+RETURN-BUTTON)

in the "JS console" window.

To open the JS console, put

  $.jsconsole.open()
  
in your code, and use

  $.jsconsole.close()
  
to hide it.

When you press the RETURN-Button in the JS console, either the contents of the active line or
the current selection (in case of a multiline selection) is evaluated and the result is shown
in the line below.

For example, if you enter:

  2+2 (+RETURN)

as result you will see the new line:

  // 4

Using

  $.log(x[, y, z,...])
  
in your code will print the contents of x( and y and ...) to the JS console.


  $.dir(x)

will show a (recursive) listing of all properties of array or object x.


	$.clear();
	
clears the contents of the console window.


Hints:

All code entered into the JS console is evaluated in the scope of $, so here you can as well
omit "$." and only enter "log(x), "dir(x)" etc.

Of course dir() also works with the core director objects, so you can e.g. use:
  dir(_system)
  dir(_player)
  dir(_movie)
	etc.