For most things, you can just use EaselsJS and SoundJS docs. Read below about NanoFL-related features.
Important rules:
cache() method: if your object have none empty filters then NanoFL cache it automatically.nanofl.DisplayObjectTools.smartUncache(myObj) for this.Bitmap/Button/MovieClip directly. Use generated children classes in src folder for that.NanoFL classes:
createjs.DisplayObject.TextField.Extends createjs.Bitmap. Has no own public fields. Example:
var bmp = new nanofl.Bitmap(nanofl.Player.library.getItem("myBitmap"));
container.addChild(bmp);
Extends nanofl.MovieClip. Has no own public fields. Example:
var btn = new nanofl.Button(nanofl.Player.library.getItem("myButton"));
container.addChild(btn);
Helper methods applicable to createjs.DisplayObject.
smartCache(myObj:DiplayObject) - cache objects in the tree (depend on filters and masks). In most cases NanoFL cache objects automatically.smartUncache(myObj:DiplayObject) - uncache myObj display object and dependent objects (depend on masks). In most cases NanoFL uncache objects automatically.getOuterBounds(myObj:DiplayObject) - returns object bounds include filters bounds (invariant to cache).getInnerBounds(myObj:DiplayObject) - returns object bounds exclude filters bounds (invariant to cache).dump(myObj:DiplayObject) - trace objects tree.Examples:
nanofl.DisplayObjectTools.smartCache(myMovieClip);
nanofl.DisplayObjectTools.smartUncache(myMovieClip);
var bounds = nanofl.DisplayObjectTools.getOuterBounds(myMovieClip);
var bounds = nanofl.DisplayObjectTools.getInnerBounds(myMovieClip);
nanofl.DisplayObjectTools.dump(myMovieClip);
Extends createjs.Container
This is a special container to store layer-related children
(automatically when constructed from library symbol).
Also can contain children not related to any layer (so you can call addChild() to add your DisplayObject to MovieClip).
Example:
var mc = new nanofl.MovieClip(nanofl.Player.library.getItem("myMovieClip"));
container.addChild(mc);
paused - a boolean to specify not to advance to the next frame on tickloop - a boolean to specify go to the first frame on movie is finishedcurrentFrame - readonly integer which represent current frame index (zero-based)play() - set paused to falsestop() - set paused to truegotoAndStop(labelOrIndex) - go to specified frame and stopgotoAndPlay(labelOrIndex) - go to specified frame and playgetTotalFrames() - returns most long layer lengthonEnterFrame() - override this method for your needsonMouseDown(e:createjs.MouseEvent) - override this method for your needsonMouseMove(e:createjs.MouseEvent) - override this method for your needsonMouseUp(e:createjs.MouseEvent) - override this method for your needsThis class is accessible anywhere. Use it to control global properties.
library - a object with a getItem(namePath) method; use that function to get symbols from librarystage - a createjs.Stage object (use to customize native CreateJS stage)scene - a nanofl.MovieClip scene object (use to control global scene object)Use this class for gapless background music loops. Example:
var music = new nanofl.SeamlessSoundLoop(createjs.Sound.play("mySound"));
...
music.stop();
new(sound:createjs.AbstractSoundInstance) - constructorstop() - stop playing (create new object to start again)This class represent a multi-line and multi-format text on canvas. Example:
var tf = new nanofl.TextField();
tf.text = "My text";
border - set to true to show black border around text fieldheight - current height of text fieldminHeight - minimal height calculated on text; readonlyminWidth - minimal width calculated on text; readonlytext - allow get or set whole text as a stringtextRuns - array of TextRun which contains field's text blockswidth - current width of text fieldnew() - constructorThis class represent a piece of text and it's format. Used in TextField to store text blocks.
align - a string ("left", "right", "center" or "justify")characters - text stringfamily - font family (like "Courier New")fillColor - fill color ("red", "#ff0000", "rgba(255, 0, 0, 0.5)")kerning - a boolean to do auto kerningletterSpacing - space between letters (ignored if kerning is on)lineSpacing - additional space between linessize - font sizestrokeColor - stroke color (used only if strokeSize > 0)strokeSize - stroke thickness (zero for regular text)style - font style ("", "bold", "italic" or "bold italic")new([characters], [fillColor], [size]) - constructorclone() - returns a copy of this object