Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Jamie Pratt -
Number of replies: 10
Hi all,

So I thought I'd spend some time demonstrating how easy it is to use the Flash Activity Module and Flash to make highly interactive learning activities.

This tutorial assumes some knowledge of Flash.

So here we go :

  1. fire up Flash
  2. make a new doc
  3. save it to your web folder in mod/flash/movies/tutorial1/ as tutorial1.fla (You'll need to make a new dir).
  4. go to file->pubplish options and you can uncheck every format except .swf, we don't need to publish the html file.
  5. you must select to Publish for Flash version 6. I found during testing that the movie preloader doesn't seem to be working when publishing for Flash version 7.
  6. make a text field on the stage with name textfield1. Put in text 'uninitialised'
  7. put the code below on the first frame of the movie.
  8. click publish
Code for first frame of movie :
// first request username
//this function responds to the return call from Moodle after init is called.
moodleService.onInit=function(){
 _root.textfield1.text = moodleService.userFirstName;
}
//here we now call init
moodleService.init();

Code for service.php :

<?php
class service  {

    function service()   {
        //this will allow you to access the first name of the user
        global $USER;
        $this->userFirstName=$USER->firstname;
    }

}

?>

After the movie is loaded you will see your username displayed in the Flash movie.


What you are seeing here is Flash communicating with php. This is not so interesting to just fetch the username of a user- but imagine you can do anything you want to on the server with php and return the result to Flash. We can access all the functions in lib/datalib.php and other moodle functions since before the service function above is called we are running config.php which in turn runs up setup.php and sets up the normal moodle code environment.


We'll do some more complicated stuff later.

I've attached the zip file of all the files you should have in mod/flash/movies/tutorial1/ after you followed the steps in this tutorial.

Jamie

Average of ratings: -
In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Jamie Pratt -
in the code above the Moodle forums have added the X to XonInit (in the code for first frame of movie). Delete the X to make the code work.


In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Jamie Pratt -
After doing the steps above of course you need to add this activity to your course by :
  • clicking on 'Turn Editing On' (you must be a teacher or admin to do this)
  • and adding a Flash Activty to your course
  • Then set up the activity with a title and use movie 'tutorial1'
  • and turn of the html splash page
  • leave all other settings as their default.

Jamie
In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jamie,

Thanks for your Flash module tutorial approve (just wishing I had time to go through it!) It would be great if you could add it to the documentation wiki, perhaps on the Flash module documentation page.
In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by N Hansen -
But all this assumes one knows how to use Flash to begin with, which is a whole other can of worms....
In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by mike namowicz -
Thanks for the tutorial and the opportunity to get my feet wet with Flash. I followed the tutorial and uploaded the files to flash file. It took me two attempts and about 30 minutes. It was great to see my login I.D. the second time around. I am still not sure what this all means in the grand scheme of things, but I'm sure it's a baby step forward for me.

In reply to mike namowicz

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Jamie Pratt -

You may also want to see this tutorial : http://docs.moodle.org/en/Development:AMFPHP

The Flash module as it stands now is no longer supported by me. I think AMFPHP and possibly some module or module template based on it is the most promising avenue for integrating Flash with Moodle.

In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Albert Dudley -
Hi Jaime,

I am trying your Flash tutorial. (I am new at this)
I do not understand line 3:
3 -save it to your web folder in mod/flash/movies/tutorial1/
Web Folder?
I am using Flash 8, It is the first time I start it, however, I am pretty good at these things.
Where is this Web folder?
Thanks- Albert
In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Babu Zainulabdeen -

I have downloaded this flash module plugin for my moodle website, as a zip file. Could you please advise me how I can integrate in my current installation?

Thanks

Babu

In reply to Jamie Pratt

Re: Flash module add-on: Making interactive learning activities with Adobe Flash and the Flash Activity Module - a step by step tutorial part 1

by Ian Clayton -
Hi

I am trying everything and probably too much to get Flash to work in my new 1.8 Moodle domain.... I have just installed your Flash Activity module and can see the test and sample Flash items as a choice during editing a Flash Activity.

However - I get this error message in my status bar when trying to preview (and a blank screen):

"There was an error opening the page....."

The Activity Window shows this error:

http://knolservicemanagement.com/university/mod/flash/loader.php/loader/410/380/12?ver=150 Not Found

What is going wrong - please help...

Ian