Publicaciones hechas por por Matt Bury

Imagen de Plugin developers
Oh ,yeah...

Why should we upgrade to Flash 9?

There's a whole host of benefits to using Flash 9 and ActionScript 3.0, notably:

1. It's never been easier to do captioning on FLV files, even in multiple languages. Imagine being able to add lecture notes to your video or audio presentations. Plus the FLV container supports AAC (Advanced Audio Compression) which gives higher quality at low bit rates than MP3 making it just as simple to add captions to audio-only files. You can find a short, sweet simple tutorial on how to do it here: http://www.adobe.com/devnet/flash/articles/filtering_data_e4x.html

2. XML is a native datatype in ActionScript 3.0. Since XML is the perfect data format for eLearning, this makes it much easier to use and opens up more possibilities for developing applications using it.

3. ActionScript 3.0 is a fully OOP (Object Oriented Programming) language. This dramatically reduces the amount of time it takes to create new Flash eLearning modules, and makes the code easier to read and develop for collaborators on projects.

4. The new events architecture (how Flash interacts with people and data files) is radically different and allows much higher degrees of interactivity. Also the 'hit areas' of display objects are more specific - circles behave like circles, triangles behave like triangles - there's no more 'invisible overlaps' (unless you want them of course!).

5. The new 'display list' does away with the need to constantly create and destroy objects (which creates a high processing overhead). Objects can be added and removed from the display list and they retain all their properties, plus they can be easily moved from one container to another with a single command, opening up new possibilities for 'drag and drop' and 'click to move' activities.

6. And finally, ActionScript 3.0 is up to 10 times faster than ActionScript 2.0, making true 3 dimensional modeling and other processor intensive applications more of a reality. You can see a great demo of Papervision3D here (please excuse the geekiness - they're programmers!): http://onair.adobe.com/blogs/videos/2007/11/27/interview-with-ralph-hauwert-on-papervision3d/

Anyway, there's a lot of reasons to upgrade, these are just a few. I think Moodle combined with Flash 9 could really make a big impact on eLearning in general.

Please help this project!

Matt smile

Imagen de Plugin developers
Hi guys,

I've been in touch with Jamie Pratt and we've discussed creating a new version of the Moodle Flash module for Flash 9 (CS3).

I can handle the ActionScript 3.0 and Flash side of things but any help and collaboration would be most appreciated. If you'd like to help, please post a message here.
Promedio de valuaciones (ratings): -
Imagen de Plugin developers

The latest version of Flash (CS3 or Flash 9) is fundamentally different to all the previous versions (6,7 and 8). It uses a new scripting language which is incompatible with the previous versions too. It basically works like this:

If the user has the latest version of the Flash Player plugin installed, any version of Flash will work on it (downward compatibility).

Previous versions of Flash (6,7 and 8) use a scripting language called AS 2.0 and Flash 9 uses a different language called AS 3.0. While they are similar, they are not compatible.

A SWF (Flash file - e.g. 'myFile.swf') written in AS 2.0 should work if it's inside an AS 3.0 container (i.e. loaded into it), but not vice versa (i.e. you can't load AS 3.0 SWFs into AS 2.0 containers. This is what I've been told, I haven't experimented with it personally.

So, in order for a Flash-Moodle module to work, you'd have to keep it updated to the latest version of AS (i.e. upward compatibility!?), but don't panic, this isn't as bad as it sounds. Once someone has upgraded it to AS 3.0 any further changes would be very minor and probably unnecessary for quite some time to come (most newer, minor versions of AS 3.0 will have updates for advanced and specialised functions that are not applicable to use with Moodle).

The advantages of coding Flash in AS 3.0 are enormous. It's been long overdue for a complete overhaul and now we have it. Flash 9 can run up to 10 times faster than previous versions and it's a truly OOP language now (Object Oriented Programming), which any programmer will tell you is an absolute essential for writing complex, interactive programs.

I've looked at the code for the current Moodle Flash module and it looks like it was written for Flash Player 6 (also called Flash MX). A new version would be much faster, more compatible and more reliable. Also, the latest version of Flash Player includes a CODEC for a video format called H.264, used in iPods and the like in the MP4 container. It's the most advanced video CODEC on the web and gives incredibly high quality video at very low bitrates and much smaller file sizes too.

I've been in touch with Jamie Pratt who's worked on the Moodle Flash module. There's a possibility that we could work together on a new module but don't hold your breath, I'm very busy! I can do the Flash side of things but I need someone who can do the back end stuff in PHP. My knowledge of PHP is pretty basic!

Anyone who's interested in collaborating on such a project should post an answer on this forum thread.

Imagen de Plugin developers

I've realised I didn't do this:

Site Administration > Security > Site Policies > Check the 'Allow EMBED and OBJECT tags' box.

Moodle was filtering out my Flash HTML code. The other thing to note is that the example code on the Moodle docs doesn't work for IE browsers. You should use this:

<object height="40" id="yourSWFname" &#010;width="50" &#010;codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param value="http://yourSite.com/assets/yourSWFname.swf" name="movie" /> <param value="high" name="quality" /> <param value="#FFFFFF" name="bgcolor" /> <embed width="50" height="40" &#010;pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" &#010;name="yourSWFname" bgcolor="#FFFFFF" quality="high" src="http://yourSite.com/assets/yourSWFname.swf" />
</object>

Also, you should seriously consider using Geoff Searn's SWFObject to embed your SWFs (Flash files). You can find his site here:

http://blog.deconcept.com/swfobject/ 

It contains everything you need to make Flash work with the majority of browsers. The current version is 1.5, there's a version that comes with the Moodle Flash extension but that's version 1.4. I'd recommend changing to 1.5 because it includes some very necessary updates and also includes something called 'express install' which updates the user's Flash player if necessary with the minimum of fuss - i.e. taking the user to Adobe.com Flash player download page which can confuse a lot of people.

Imagen de Plugin developers

I've found the code in the Moodle download package. It looks ok to me. There's a lot in the way of variables getting passed into the player module, probably from a PHP script.

I'd guess that this isn't the problem. I'd try recoding the MP3 files. What software are you using for creating your MP3s?

Here's the MP3 player ActionScript:

// Thanks to Jamie Pratt for bug fixes! http://moodle.org/mod/forum/discuss.php?d=23400

// set up user defined colours
if (bgColour != undefined) new Color(bg).setRGB(parseInt(bgColour, 16));
if (btnColour != undefined) {
 new Color(playBtn).setRGB(parseInt(btnColour, 16));
 new Color(pauseBtn).setRGB(parseInt(btnColour, 16));
}
if (btnBorderColour != undefined) new Color(btnBorder).setRGB(parseInt(btnBorderColour, 16));
if (iconColour != undefined) {
 new Color(playArrowOut).setRGB(parseInt(iconColour, 16));
 new Color(pauseIconOut).setRGB(parseInt(iconColour, 16));
}
if (iconOverColour != undefined) {
 new Color(playArrowOver).setRGB(parseInt(iconOverColour, 16));
 new Color(pauseIconOver).setRGB(parseInt(iconOverColour, 16));
} else {
 new Color(playArrowOver).setRGB(0x00cc00);
 new Color(pauseIconOver).setRGB(0x00cc00);
}
if (handleColour != undefined) new Color(slider.handle).setRGB(parseInt(handleColour, 16));
if (trackColour != undefined) new Color(slider.track).setRGB(parseInt(trackColour, 16));
if (loaderColour != undefined) new Color(loader).setRGB(parseInt(loaderColour, 16));

if (src == undefined) {
 var src = "test.mp3";
}

if (buffer != undefined) {
 buffer = parseInt(buffer);
 buffer = (!isNaN(buffer)) ? buffer : 20;
} else {
 buffer = 20;
}
_soundbuftime = buffer;


slider.handle._x = 0;
loadbar._xscale = 1;

// returns the offset needed to start the sound in the right place
// based on the position of the drag handle, the length of the slider track
// and the length of the sound file
function getPosition() {
 return Math.round((s.duration * slider.handle._x / slider.track._width) / 1000);
}

// this enterFrame event controls just about everything -
// depening on the value of playMode which is changed by pressing the buttons
this.onEnterFrame = function() {
 var loaded = s.getBytesLoaded();
 var total = s.getBytesTotal();
 if (loaded > 4 && total > 4) {
  percent = Math.round(loaded / total * 100);
  loadbar._xscale += (percent - loadbar._xscale) / 5;
  if (Math.round(loadbar._xscale) == 100) {
   loadbar._alpha -= loadbar._alpha / 5;
  }
 }
 
 if (playMode == "play") {
  slider.handle._x = s.position / s.duration * slider.track._width;
  // if we've reached the end of the file
  if (Math.round(slider.handle._x) == Math.round(slider.track._width)) {
   // reset the slider to the beginning and pause
   slider.handle._x = 0;
   pauseBtn.onPress();
  }
 } else if (playMode == "drag") {
  var xPos = slider._xmouse;
  if (xPos < 0) {
   xPos = 0;
  } else if (xPos > slider.track._width) {
   xPos = slider.track._width;
  }
  slider.handle._x = xPos;
 }
};

// when the slider handle is pressed
slider.handle.onPress = function() {
 s.stop();
 // remember what was happening (play/pause) before the handle was dragged
 oldPlayMode = playMode;
 // start dragging the handle
 playMode = "drag";
};

slider.handle.onRelease = slider.handle.onReleaseOutside = function() {
 playMode = oldPlayMode; // resume doing whatever was happening before the user dragged the slider
 if (oldPlayMode == "play") {
  s.start(getPosition());
 }
};

// start playing from the current position
playBtn.onPress = function() {
 if (waitForPlay != undefined && waitForPlay != "no" && started == undefined) {
  s.loadSound(src, true);
  started = true;
 } 
 playMode = "play";
 this._visible = false;
 playArrowOut._visible = false;
 playArrowOver._visible = false;
 pauseBtn._visible = true;
 s.start(getPosition());
};

playBtn.onRollOver = function() {
 playArrowOut._visible = false;
 playArrowOver._visible = true;
};

playBtn.onRollOut = function() {
 playArrowOut._visible = true;
 playArrowOver._visible = false;
};

// stop playing
pauseBtn.onPress = function() {
 playMode = "pause";
 this._visible = false;
 playArrowOut._visible = true;
 playArrowOver._visible = true;
 playBtn._visible = true;
 s.stop();
};

pauseBtn.onRollOver = function() {
 pauseIconOut._visible = false;
 pauseIconOver._visible = true;
};

pauseBtn.onRollOut = function() {
 pauseIconOut._visible = true;
 pauseIconOver._visible = false;
};

// create a sound object and load the sound file (streaming)
var s = new Sound(this);
if (waitForPlay == undefined || waitForPlay == "no") {
 s.loadSound(src, true);
 if (autoPlay != "yes") {
  s.stop();
 } else {
  playBtn.onPress();
 }
}