Ore Landau edited this page Apr 8, 2018 · 18 revisions

Snap.SVG Animator leverages the Snap.SVG javascript library for accessing and drawing SVG content. You can leverage the entire Snap.SVG API found in their docs as well as the following API's which are specific to this plug in.

SVGAnim

This is the base animation object of an exported FLA.

SVGAnim(json, width, height, fps)
Class for a root animation. Takes the JSON data exported from flash custom platform plugins, as well as width, height, and frames per second as parameters. var _anim = new SVGAnim(json, 550, 400, 24);

this
In the context of a framescript this refers to the current timeline's movieclip object. Children can be referenced by their instance name on this object.

linkage
The object containing all the exported movieclip references from the library. var mcTimeline = _anim.linkage.myMcLinkageName;

mc
Reference to the root movieclip of the animation.
_anim.mc.addChild(child);

s
The Snap.svg surface. For leveraging Snap.svg API's.

resourceManager
The resource manager. For access to assets.


MovieClip

MovieClip(timelineData, SnapSurface, resourceManager, name)
Class for movieclip. Can be initialized on the root animation instance. See generated output for example.
var myMC = new _anim.MovieClip(tl, _anim.s, _anim.resourceManager, name);

play()
Play the current movieclip.

stop()
Stop the current movieclip.

gotoAndPlay(frame)
Go to defined frame number or label and continue to play.

gotoAndStop(frame)
Go to defined frame number or label and stop.

addChild(child)
Adds a child to the movieclip.

click(callback)
Snap element click handler forwarding

mouseover(callback)
Snap element mouseover handler forwarding

mouseout(callback)
Snap element mouseout handler forwarding

mousedown(callback)
Snap element mousedown handler forwarding

mousemove(callback)
Snap element mousemove handler forwarding

el
Reference to the Snap() element for the current movieclip. For providing easy access to manipulating movieclips with Snap.svg.
introClip.el.transform('translate(100, 190)');

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.