MooTools core team member Michelle Steigerwalt has a writeup about the MooTools 1.2 Swiff object which allows communication between Flash movie (.swf) files and a page's JavaScript. The Swiff object makes it substantially easier to interact with ActionScript allowing you to pass values or manipulate the Flash movie using JavaScript and MooTools:
Unless you're a diehard fan of the embedded Quicktime movie, you might see the benefit in a Flash video player to provide smooth playback of videos to your users, while still yearning for full control over the action using JavaScript and MooTools.
It's not even necessary for the Swiff object to be visible in order to benefit from its use. Using Swiff, you can utilize all of Flash's functionality, including its video, sound, file streaming, and clipboard accessing features, and lots more.
You get all the flashiness of Flash, while still being able to manipulate and display your content using the DOM and MooTools.
Instantiating a Swiff object instantly provides access to the referenced Flash movie and any exposed methods:
LANGUAGE:
//(JavaScript)
var obj = new Swiff('mySwf.swf', {
width: 1,
height: 1,
container: $('swiffContainer'),
events: {
onLoad: function() {
alert("Flash is loaded!")
}
}
});
In addition to this, the Swiff object's remote() method provides the hook to make calls to actual ActionScript functions:
LANGUAGE:
//(JavaScript)
var obj = new Swiff('mySwf.swf', {
//[...]
events: {
onLoad: function() {
Swiff.remote(obj, 'echoText', 'Hello Flash, meet Swiff.');
}
}
});
The Swiff object is currently available in MooTools 1.2 beta