npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

a-svg

v0.0.7

Published

Convert SWF files to animated playable SVG

Downloads

3

Readme

a-svg

Flash Animate CC extension that converts swf animation to svg.

This tool aims to provide a simple & quick way to convert flash animations into a self contained svg witdh a small footprint Javascript Player.

Requeriments

  • Adobe Animate CC
  • Node 8.5.0
  • Java JRE
  • wget running

Features

Export

Don't expect to make all the Animate features work, this is the list of what currently works:

  • Main timeline animation ( Not nested timelines )
  • Mask(s) ( One at the moment due to a ffdec bug )
  • Multiple Layers
  • All kind of transforms
  • Gradients
  • Bones
  • Alpha
  • Guides
  • Instance Names
  • Frame Labels
  • Small Javascript Player

Installation

Install it globally

npm install a-svg -g

On completion it will automatically open Animate. Choose "Run as command" when prompted.

Installation is complete.

Conversion Server

To be able to convert animations, you need to start the conversion server in the command line:

a-svg --serve

This will start the server that is charged of conversion, and listen for incoming conversion tasks.

Animate CC workflow

Work as normally respecting this norms:

  • Convert all assets to Graphics/Movieclips in the library.
  • Put 1 asset per layer
  • 1 only mask

When your production is ready:

  • Make a clone of the .fla file
  • Open the cloned file
  • Go to Commands [ a-svg ] Convert to a-svg Document

This will process the current fla file and make the needed changes before it can be published.

Now we ar ready to finally convert the file to svg / html, to do it:

  • Test your movie, it will go through all the movie frames.
  • At the end will call the Conversion Server with the needed metadata.
  • Your browser will be opened with a demo preview of the animation.
  • You will get the resulting files aside the cloned .fla file.

JavaScript Player

( will move to his own repository )

Minimal Code

	var player = new SVGPlayerMatrix({
    	svg: 'svg[asvg-movie="walk"]',
        frameRate: 24,
        timeline: {},
        loop: true
        });
    player.play();

Methods

  • play()
  • pause()
  • stop()
  • gotoAndPlay(frame)
  • gotoAndStop(frame)
  • attach() => Attaches the instance to the frame loop
  • detach() => Detaches the instance to the frame loop

Properties

  • totalFrames => Total number of animation frames
  • direction => Playing direction 1 | -1
  • isPlaying => Indicates is player is currently playing
  • played => Indicates that movie has been played at least one time
  • currentFrame => indicates the frame number the player is rendering
  • frameRate => sets the movie frame rate

Timeline

Full timeline control with per frame actions

    	const timeline = {
        	initialize: function() {
            	// custom var
            	this.loopedTimes = 0;
            },
    		70: function() {
            	this.loopedTimes++;
                if( this.loopedTimes > 3) {
                	this.detach();
                } else {
                	this.gotoAndPlay(15)
                }
            }
    	}