You can pass parameters to My Coloring Book through the URL.
These can either be passed to the HTML Wrapper (mcb.html) or directly to the Flash file (mcb.swf).
For the HTML Wrapper, the parameters come after a hash (#) and are separated by ampersands (&).
For the Flash file, the parameters are included as part of the url, after a question mark (?) and separated by ampersands (&).
Here is a complete list of available parameters...
Page: The name of the .gif file for the coloring page.
Overlay: The name of the OPTIONAL overlay file to use.
Book: The current book file (or script1).
The tool to select2 (normally set in config.xml initially).
Can be one of "brush", "mbrush", "fill", "wash".
The color to select2 (normally set in config.xml initially).
An RGB color value. E.g. For red the value would be 0xFF0000
Base Directory: The directory where My Coloring Book should look for files3.
Alternate Config: An alternate directory for configuration files4 (relative to the base).
- You can use a script (such as PHP) to generate your coloring book files. This can be useful if you want to dynamically create the coloring book file, such as from a database, or to produce a random selection each time the user changes pages.
If your script requires it's own parameters then you should URL-encode special characters, such as "?", "&", "=", "/", etc. In PHP you would do this with the urlencode() function.
For example if your script with parameters is "book.php?mode=rand&sub=xmas/all" then you would pass this as...
- Tool and Color are usually set in the config.xml file, but are also passed as part of the reloadUrl to allow the current tool and color to be kept when changing pages in reload mode.
- My Coloring Book looks for its coloring pages, configuration etc, relative to the base directory, which by default is the current directory. You can change this using the Base Directory parameter.
- See the Alternate config files article.