Posts tagged: ActionScript

Moodle SWF Activity Module developer preview

SWF Activity ModuleOK, this is going to be a very techie post as it’s aimed exclusively at developers who are interested in integrating Flash and Moodle. If you’ve never written a line of computer code, then this article will most probably bore you to death!

What is the SWF Activity Module?

The SWF Activity Module deploys Flash learning applications as activities in Moodle courses. It uses standards compliant XHTML 1.0 Strict embed code and leverages SWFObject 2.2. For Moodle users, especially non-developers, it’s a quick, easy, reliable, and mostly importantly, non-techie method of embedding Flash.

What’s the developer preview?

I’ve just uploaded a two-part installer package to the SWF Activity Module project site on Google Code. The first part, like any other Moodle activity module, performs the installation in Moodle and acts as the user interface. The second part is the Flash Remoting service library which handles communication between Flash and Moodle. The particular implementation of this is AMFPHP. This package is a developer preview. It has not been extensively tested, has not been proven to be stable and is not intended for installation on public servers.

What does it do?

So far, the activity module does the following:

  • Installation
  • Backup and restore
  • Creates and manages SWF Activity Module instances
  • Creates and manages grade items in Moodle’s grade book
  • Custom grade reports

The Flash Remoting service library does the following:

  • Establishes fast, lightweight, powerful two-way communication between Flash learning applications and Moodle
  • Handles user authentication, capabilities and permissions
  • Allows Flash learning applications to push and retrieve grades and user data in Moodle’s grade book
  • Allows Flash learning applications to retrieve user data such as avatars, VoIP client IDs, groups, etc. to facilitate social networking and web communication between learners and teachers

Accurately track learners’ activities while on-line

The custom grade reports are particularly interesting because they provide a much asked for function in Moodle activities, namely tracking the amount of time that learners spend on activities accurately. The problem at the moment is that Moodle can only record the time elapsed between requests sent to the server while learners are using a module. Between server requests, Moodle can’t tell whether a user was studying or if they went for a tea break, either way the elapsed time logged is the same. Since Flash learning applications run on learners’ computers, they can track mouse, keyboard, camera and microphone actions over any given period of time. If a learner goes for a tea break, mouse, keyboard, camera and microphone actions stop and Flash learning applications can take this into account, for example, by discounting inactive time. I had to create the custom grade reports because Moodle has no provision for this kind of user data.

Open up Moodle to more web services

The SWF Activity Module is far more than we’ve come to expect from Flash based learning interactions. The Flash Remoting gateway opens up Flash and Moodle to a wide range of 3rd party web services. Here’s a few possibilities to consider:

  • Deploy web conferencing clients that use open VoIP and chat protocols. Here’s an example of an existing project could be leveraged.
  • Deploy Flash clients that leverage Google Wave’s open protocol, when it goes fully public, for real-time multimedia collaborative projects.
  • Consume map, video, search and data services from providers such as Google and Yahoo!
  • Or any combination of protocols and services for media-rich, collaborative learning interactions. The sky’s the limit.

How can I use the developer preview?

This is where I need your help. I’d like this module to be tested in as many environments as possible except, of course, public servers so if you are a developer and have a development server with Moodle installed, this is where you can help. Installation instructions are included in the developer preview package and the Flash Remoting gateway comes pre-configured for Moodle. There’s also a sample “Grade Pusher” Flash application that simply pushes grades into Moodle’s grade book. Please try it out on your development servers and let me know if you encounter any problems with it.

The SWF Activity Module project site is at: http://code.google.com/p/swf-activity-module/ where you’ll find downloads, documentation, examples, source code and the issues tracker.

The SWF Activity Module is proud to be open-source.

VN:F [1.8.3_1051]
Rating: 9.0/10 (4 votes cast)
  • Share/Bookmark

Flash MP3 player for tests

GNU GPL Open Source ProjectEver wanted to control the number of times a learner can listen to a recording in a listening test? Well, I’ve seen this request a number of times on Moodle.org’s forums recently and not so recently. So I’ve decided to develop and share this Flash MP3 player for tests.

What does it do?

It streams (progressive download) and plays a single MP3 (or AAC) audio file once. It has no play back controls whatsoever so there is no way for a learner to listen to the recording again except by refreshing the web page in the browser. There is an optional parameter that sets the number of times the MP3 file plays.

What is it for?

It’s for deploying in listening tests or activities where it’s necessary or desirable to limit the number of times a learner can listen to an audio recording. For example, Cambridge ESOL (English for Speakers of Other Languages) listening tests require that the learner only listen to each recording twice so it’s particularly useful in practice exercises for learners who are preparing to take one of these exams.

How can I use it?

Detailed instructions are included in the download package as well as some example embed code. Unfortunately, I can’t provide any easy to use plugins or modules for LMSs (Learning Management Systems) – It’s too complicated to explain here and now. For now, this Flash application can only be deployed by manually inserting the necessary embed code and editing some of the parameters. I’ve included some code examples and explanations for how to embed it in Moodle from the course files directory (moodledata).  This should present no problems at all for an experienced web designer or web developer and an IT savvy teacher or course content designer could probably deploy it successfully by copying and editing the embed code examples provided.

Do I need to buy a licence to use it?

No, this project is open source and completely free. You can copy it, change it and redistribute it in any way you like. The only condition is that you must leave my name and copyright on it and distribute a copy of the GPL open source licence with it. The Flash CS4 FLA and ActionScript 3.0 source files and full details are included in the download package.

How secure is it?

It’s worth noting that this MP3 player for tests is not secure. An IT savvy learner could easily look at the source code for the web page and see the URL of the MP3 file being played and download it directly. The very popular Firefox web browser also has a number of plugins that makes it very easy to download media files from virtually any source no matter how well they are protected, even streams from media servers that are supposed to be very secure. The easiest way to make it more difficult to cheat is to put a time limit on the listening test itself. That way, there isn’t enough time to listen more than once.

Update:

I’ve moved the MP3 Player for Tests to Google Code to make it more accessible to developers and easier to find and download. You can find the [http://code.google.com/p/moodle-mp3-player-for-tests/ project page here].

VN:F [1.8.3_1051]
Rating: 10.0/10 (2 votes cast)
  • Share/Bookmark

Book review: ActionScript 3.0 Bible

ActionScript 3.0 Bible

By Roger Braunstein, Mims H. Wright and Josuha J. Noble

ActionScript 3.0 has to be regarded as an entirely new language when compared to ActionScript 1.0 and 2.0. It is not downwardly compatible and requires that Flash developers “migrate” to the new version. Having said that, the benefits of programming in ActionScript 3.0 are well worth the effort. For starters it’s up to ten times faster and offer much easier connectivity and networking capabilities, especially since XML is now a native data type in Flash.

The good things about this book:

It’s a project oriented book, full of tutorials that cover the majority of functions that a Flash developer is likely to come across in his or her work. It focusses squarely on how to do things and how to make stuff work rather than covering the more technical aspects of ActionScript 3.0 and object oriented programming (OOP).

The bad things about this book:

It feels like it was rushed through to publication. There are a lot of mistakes and some of the projects either don’t work or are incomplete. It takes some careful persistence to make some of the code work, which actually makes some parts of it a better learning experience, but I could see this being frustrating for a less experienced programmer.

To sum up, I have mixed opinions about it. On the one hand, it provides a much needed project oriented guide to programming some of the most frequently asked for functions of Flash using ActionScript 3.0 and is a good starting point. On the other hand, it contains too many typos and scripting errors to inspire confidence. I would say it’s got a lot of very useful information and is very practical but use it with caution and always read through and check any long projects actually work before starting them.

Recommendations

Personally, I’d recommend this book for intermediate ActionScript 2.0 programmers who want to migrate to ActionScript 3.0  and programmers who want to learn object oriented programming (OOP). If you’re more experienced with ActionScript 3.0 and would like to learn more about OOP, then I’d recommend Essential ActionScript 3.0 by Colin Moock. Colin Moock’s book goes into much more detail about the fundamental principles of OOP but it’s a little light on good examples and projects so I wouldn’t recommend it for beginners.

See preview of ActionScript 3.0 Bible on Google Books.

VN:F [1.8.3_1051]
Rating: 0.0/10 (0 votes cast)
  • Share/Bookmark

Book review: ActionScript 3.0 Game Programming University

ActionScript 3.0 Game Programming University

By Gary Rosenzweig

This is another belated book review. I can’t remember exactly when I bought this but it was quite a while ago.

This is a great book. Well written, clearly explained and full of good tips and advice. It covers a range of different types of games including word games, driving and flying games, platform games and the usual shoot ‘em ups.

My only criticism is that in some places the code is rather hacky and looks like it was converted from ActionScript 2.0 procedural code. But then again, once you understand the principles behind developing different types of games, writing them in more dynamic, robust object oriented code shouldn’t be too difficult.

VN:F [1.8.3_1051]
Rating: 10.0/10 (2 votes cast)
  • Share/Bookmark

Book review: ActionScript 3.0 Animation

Foundation ActionScript 3.0 Animation: Making things move!

By Keith Peters

OK, this is a belated review. I bought this as an ebook when it was published in April 2007.

This is by far the best book, or even tutorials, I’ve ever read for animation in ActionScript 3.0. It’s clear, concise and very well paced, taking you from the basic principles of static frame animation (like cartoons) and taking you through to the more dynamic and interactive world of scripted animation.

It covers everything from moving basic 2D objects around, through the principles behind scripting velocity and acceleration, friction, easing and springing, collision detection and on to complex interactive 3D shapes and environments. There’s even a couple of chapters on forward and inverse kinematics if you interested in scripting jointed, moving creatures. The mathematical formulae are well described and you really get a feel for what the author is talking about.

Overall, it’s a great book and I’d recommend it to anyone who would like to get involved in dynamic, interactive animation.

Preview Foundation ActionScript 3.0 Animation, Making things move! on Google Books.

VN:F [1.8.3_1051]
Rating: 0.0/10 (0 votes cast)
  • Share/Bookmark

Video & Audio Comments are proudly powered by Riffly