Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -
Number of replies: 20

Hi,

I just put a new version of the Flash activity module into the cvs. It should be available from the download page on March 17th (CVS version is now 1.2).

  • Using a new preloader movie the module now can load font files into Flash dynamically. I have an extension for the Flash authoring environment that can package fonts, including sub-sets of unicode fonts in a format that Flash can recognise. These files are automatically detected by the module configuration page after you upload them to mod/flash/resources/ Unfortunately I can't put the extension in cvs as it is under the creative commons license.
  • Also the preloader includes the code that makes it possible for Flash to talk to Moodle. All the set up is done by the preloader. So now no special libraries must be compiled into your Flash movie to talk to Moodle. You just do commands like this : moodleService.init(); moodleService.answer(); etc.
  • The preloader also includes code to handle communication errors.
  • And the preloader acts as a debug view. From your movie you do moodleDebugger.addText(blahblah+"\n"); moodleDebugger.showDebug(); This acts as an alternative to the trace function since trace only works in the Flash debugger and the debugger won't work for Flash movies that are integrated into Moodle.

I've made a start on a wiki describing how to use the module to integrate your own Flash movies into Moodle as activities and hope to add more details soon. It should be fairly easy to follow my text ordering test code which is in flash/mod/order/ which uses the new preloader.

Jamie

Average of ratings: -
In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

See the new version of the module in action here :

This movie uses some Japanese kana characters. You should (I hope!!) be able to see these characters no matter whether you have any Japanese fonts installed on your system or not.

This movie embeds some logical symbols.

This devanagiri (Hindi characters) movie doesn't embed any fonts. I found that Flash doesn't handle devanagiri properly sad The devanagiri unicode fonts are quite complex and involve letters combining with each other. On my system devanagiri using non embedded fonts works OK though! But this means you still have to have the fonts installed to view the movie.

The code for this new version of the module will be downloadable here tommorrow March 17th.

In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

I just added this to my Wiki :

Here is the font library creator Flash Extension. It runs from the command menu of Macromedia Flash.

This extension was created by Carlos Rovira. See http://www.carlosrovira.com I have made some minor adjustments to it.

Font Library Creator

You can download a version of this extension at http://jamiep.org/file.php?file=/3/FontLibraryCreator.mxp

Use this extension to package your fonts for use in your movies. The extension will create two important files. If you choose a file name 'logic' Then logic.swf and logic_lib.swf will be created. You upload these files to your Moodle site to directory mod/flash/resources/

Then when you configure your Flash Activity you will have the choice of preloading these fonts into Flash, so they can be used any of your Flash Activities.

See the configuration screen below :

Configuring a Flash Activity

In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

oops.

Here are the images that should appear in the post above (the images above are in my course files folder at jamiep.org and so won't appear it seems unless you're logged in to jamiep.org).

The font libray creator :

font library creator

 The selecting fonts in the activity config screen :

Activity Update Screen

In reply to Jamie Pratt

No font files have been installed!

by Rafael Nieves -
I installed the module fine but...

 in the Pre-load these fonts files for this activity check boxes options to select fonts, there is any and instead is this message:

No font files have been installed

Any clues?

Fallo
In reply to Rafael Nieves

Re: No font files have been installed!

by Jamie Pratt -

It means what it says. You have not installed any font files. See my wiki for details of how to install fonts.

No fonts are included in the zip you download from Moodle because the fonts I've used are copyrighted and cannot be distributed at all.

But you don't need to use embedded fonts in your activity unless you expect the user of your site not to have the fonts you want to use installed.

In reply to Jamie Pratt

How to make 'order' activites work with the new version of the module

by Jamie Pratt -

Someone wrote to me and said that their 'order' activites no longer worked with the new version of the module. Here is my reply to him which I thought might be useful for others also :


Hi,

I think the problem is that you need to use the 'preloader' for the order quiz to work now. I've changed the code now so that the code to connect to Moodle is in the preloader for those modules that want to use it.

So just make sure to select use preloader to load fonts and movie when you configure your activity. For previously created activities click on update activity and then on the first config screen change use preloader to 'yes'.

Jamie

Please if you have a question about the Flash activity module it would be great if you could post it to this forum, this will hopefully mean that all can benefit from a discussion of any problems and I won't have to answer lots of similar questions about problems privately by email.

Also I'd love to see some examples of how people have used my module on their sites. If you can allow guest access to your course why not post a link to your activities here.

Jamie

In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Diane Yeager -

Hi Jamie,

I love the order activity, but i think that I am missing something on how to use this module.  Maybe I am not understanding the module at all! My understanding is that your movie created right on the moodle site by choosing "order" in the movie form. Then I thought that I could put the words to be ordered in the text. When I do this I get a blank screen. What am I doing wrong?  I know that I have probably missed something in the discussions, but I honestly have searched. Can you give me a little more information related to the module?

Thanks a lot.....I really want to use this

In reply to Diane Yeager

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

The order activity now relies on functionality in the preloader. So when you configure the activity you have to select 'yes' where it says "Use Preloader to Load Fonts and Movie". So just do an update Flash activity and change that setting and it should work.

Please let us know if this fixes your problem or not by posting to this forum.

Jamie

In reply to Diane Yeager

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

Aother comment. When you configure the 'order' activity when you enter anything in the Use font box then the activity will try to use an embedded font. Don't enter anything in there if you don't want to use an embedded font. If the activity is trying to use an embedded font but you haven't selected it on the first screen then no text will appear.

Jamie

In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Diane Yeager -

I'm back again, I have not been successful in getting the module to work. I have 1.4.4 and The module installed. But when I create an activity, I get a blank screen. I have checked "yes" for the preinstaller (every time I go back to the update It has changed back to "no"....hmmmmm is this a problem?) But I change it back to "yes"..I do not write the name of any font in the font space. I have typed several words in the text field and have chose to separate by words......now...what do you think?  Does it sound like I have done all the necessary steps......I'm sorry to bother you with this but I am really excited to get this up and running.

Thanks again

Diane

In reply to Diane Yeager

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

I'm sorry to bother you with this

Not at all thanks for your interest in the module and helping me to iron out any bugs and problems people might have with setting up an activity by reporting your problems.

 I have checked "yes" for the preinstaller (every time I go back to the update It has changed back to "no"....hmmmmm is this a problem?)

Sounds like there is a problem there. I've not noticed this problem occuring on my test system. I'll look into what might be causing this.

Does it sound like I have done all the necessary steps......

Yes. It does. But could you possibly give me teacher access to your course? I could then check out what's happening for myself.

I'll publish a new version of my Flash activity in the next couple of days. It has a new movie included where a user has to select words from a body of text. For example all verbs or whatever you want. I guess I need to add some nice help buttons to the activity update forms.

My new module will also report any communication errors to the user instead of just freezing (and showing a blank screen).

When you say your screen is blank, there is nothing on it at all? Are there any buttons appearing?

Jamie

In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Diane Yeager -

Hi Jamie,

Thanks for the response. No there are not buttons......nothing on the page...

I will send you access so you can peek around.

In reply to Diane Yeager

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Rafael Nieves -
I am having just the same behavior.  i am running Moodle 1.4.4+ also.  Just a blank screen with no buttons, nada , nothing... 
In reply to Jamie Pratt

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Chris Freeborn -
I think I'm experiencing the same behaviour with V1.4.4 -- blank area where the swf file should be showing something or playing. I've created the simplest possible examples with just a swf file and the matching html file in a directory with the identical name under the movies directory.

//Chris Freeborn


In reply to Chris Freeborn

Re: Flash module add-on: New version of the Flash Module : dynamic fonts, preloader, debugger

by Jamie Pratt -

Hi all,

Thanks to Diane for letting me have teacher access to her site to check this out.

I made a small change in the db structure since the first module release. I realised while I was checking out Diane's site that I forgot to update the script that sets up the db automatically when you install the module, although I did write a script to change the db structure if you were upgrading from the first version of the module.

I'll post a fix for this later today.

Jamie

In reply to Jamie Pratt

Fix for blank screen problem

by Jamie Pratt -
Hi all,

This should fix the problem with the order activity just showing a blank screen that people have reported.

Attached is a file mysql.sql you should upload it to your directory yoursiteroot/mod/flash/db/ where it will replace another file with the same name.

Backup any Flash activities (we are about to delete them) if necessary and go to the admin page for your site (not the course) 'yoursiteroot/admin/' and click on 'Modules', then delete 'Flash Activity'.

Then go back to the main admin page and the Flash Activities db will be set up again. Restore your Flash Activities. Then go to the update page of your Flash activities and set Use Preloader to 'Yes'. Now it should stay set to yes ( the problem before was there was no record for 'usepreloader' to be saved in), and your order activities should work fine.

Jamie
In reply to Jamie Pratt

Re: Fix for blank screen problem

by Rafael Nieves -
Try it and Bingo!!!

It works fine now.  Thanks Jamie!!approve

Fallo.
In reply to Rafael Nieves

Re: Fix for blank screen problem

by Jamie Pratt -

Try it and Bingo!!!

It works fine now.  Thanks Jamie!!approve

phewbig grin

Jamie

In reply to Jamie Pratt

Re: Fix for blank screen problem

by Chris Freeborn -
Hmmm ... I went through your fix process and I think I'm still seeing the blank screen problem -- at least with my own test flash html/swf file pairs. I can change the dimensions and colour of the blank screen but that's all I seem to see on my uploaded examples. Any suggestions to troubleshoot?

One other behaviour: If I select your sample "Order" example, it doesn't allow me to change the movie selection for that activity -- there's no dropdown selector. It seems I can swap the movie selection for other test activities. Is this the way the "Order" sample should work?

Thanks// Chris Freeborn

In reply to Chris Freeborn

Re: Fix for blank screen problem

by Jamie Pratt -

One other behaviour: If I select your sample "Order" example, it doesn't allow me to change the movie selection for that activity -- there's no dropdown selector. It seems I can swap the movie selection for other test activities. Is this the way the "Order" sample should work?

Yes. For movies that require configuring once you have configured them you cannot change the movie type. This is because your configuration settings would probably not make sense to another movie.

Hmmm ... I went through your fix process and I think I'm still seeing the blank screen problem -- at least with my own test flash html/swf file pairs. I can change the dimensions and colour of the blank screen but that's all I seem to see on my uploaded examples. Any suggestions to troubleshoot?

This sounds like a different problem. Is the order activity working for you?

To see what the problem might be then try changing html publish settings. No scale will probably work best and set the movie size to a pixel size.

Also refer to the main movie as _root don't use _level0 or whatever. If you are using the preloader your movie is loaded into _level1. Only old school flash coders would use _level0 though I think.

Jamie