BetaJS-Flash is a Flash-JavaScript bridging framework
ActionScript AngelScript JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demos
dist
docsrc
src
tests
.codeclimate.yml
.gitignore
.project
Gruntfile.js
LICENSE
README.md
package-source.json
package.json

README.md

betajs-flash 0.0.20

Code Climate NPM Gitter Chat

BetaJS-Flash is a Flash-JavaScript bridging framework

Getting Started

You can use the library in the browser and compile it as well.

Browser

	<script src="betajs/dist/betajs.min.js"></script>
	<script src="betajs-browser/dist/betajs-browser.min.js"></script>
	<script src="betajs-flash/dist/betajs-flash.min.js"></script>

Compile

	git clone https://github.com/betajs/betajs-flash.git
	npm install
	grunt

Basic Usage

	var registry = new BetaJS.Flash.FlashClassRegistry();
	registry.register("flash.media.Video", ["attachNetStream"]);
	registry.register("flash.display.Sprite", ["addChild"]);
	registry.register("flash.net.NetStream", ["play", "addEventListener"]);
	registry.register("flash.net.NetConnection", ["connect", "addEventListener"]);

	var embedding = new BetaJS.Flash.FlashEmbedding($("#embed-here").get(0), {
		registry: registry,
		wrap: true
	}, {
		flashFile: "betajs-flash/dist/betajs-flash.swf"
	});
	
	embedding.ready(function () {
		var main = embedding.flashMain();
		var stage = main.get("stage");
		stage.set("scaleMode", "noScale");
		stage.set("align", "TL");
		var video = embedding.newObject("flash.media.Video", stage.get("stageWidth"), stage.get("stageHeight"));
		main.addChildVoid(video);
		var connection = embedding.newObject("flash.net.NetConnection");
		var cb = embedding.newCallback(function () {
			var stream = embedding.newObject("flash.net.NetStream", connection);
			video.attachNetStreamVoid(stream);
			stream.playVoid("movie.mp4");
		});
		connection.addEventListener("netStatus", cb);
		connection.connectVoid(null);
	});
    <div id='embed-here'></div>

Links

Resource URL
Homepage https://betajs.com
Git git://github.com/betajs/betajs-flash.git
Repository https://github.com/betajs/betajs-flash
Blog https://blog.betajs.com
Twitter https://twitter.com/thebetajs
Gitter https://gitter.im/betajs/betajs-flash

Compatability

Target Versions
Firefox 6 - Latest
Chrome 18 - Latest
Safari 5 - Latest
Opera 16 - Latest
Internet Explorer 8 - Latest
Yandex Latest
Edge 12 - Latest

CDN

Resource URL
betajs-flash.js http://cdn.rawgit.com/betajs/betajs-flash/master/dist/betajs-flash.js
betajs-flash.min.js http://cdn.rawgit.com/betajs/betajs-flash/master/dist/betajs-flash.min.js
betajs-flash-noscoped.js http://cdn.rawgit.com/betajs/betajs-flash/master/dist/betajs-flash-noscoped.js
betajs-flash-noscoped.min.js http://cdn.rawgit.com/betajs/betajs-flash/master/dist/betajs-flash-noscoped.min.js
betajs-flash.swf http://cdn.rawgit.com/betajs/betajs-flash/master/dist/betajs-flash.swf

Unit Tests

Resource URL
Test Suite Run

Dependencies

Name URL
betajs Open
betajs-browser Open

Weak Dependencies

Name URL
betajs-scoped Open
betajs-shims Open

Main Contributors

  • Ziggeo
  • Oliver Friedmann

License

Apache-2.0

Credits

This software may include modified and unmodified portions of:

  • AS3CoreLib, BSD License, (c) 2008, Adobe Systems Incorporated

Sponsors

  • Ziggeo
  • Browserstack