FlashICT.net

Ideas and thoughts about the use of Flash and related tools within education

FlashICT.net header image 2

Printing in Flash 8 – the hard way

April 11th, 2007 · No Comments

Practice Paper screenshot

I’ve been developing a Flash-based application for my websites called ‘Practice Paper’ for over two years now. The first one was on my ReviseICT.co.uk site, which I then developed further to appear on my SchoolHistory.co.uk site. Basic printing was on offer, but it didn’t work very well.

Last year I posted extensively about the issues I was facing – see this post, also titled ‘Printing in Flash 8′ – the basic conclusion was that if you printed text from Flash everything would work out fine unless you wanted to print more than one page. Then the trouble starts – I tried an exhastive number of solutions and not one worked….

Or did it? Well, in some respects – no it didn’t at all. As my programs are used directly by students I work incredibly hard to make sure that they work as simply and as clearly as possible. The immense benefit of using Flash for educational tools is that you can wrap everything up in a single .swf and upload, share or save this file anywhere.

The Princess Diaries hd

Runaway Bride psp What I ended up doing with Practice Paper was to develop an extremely complex solution which breaks out of just using a single .swf. I was really annoyed by this but I’m utterly convinced for the requirements of the application I have taken the most appropriate action.

Basically, the Practice Paper application was working well unless someone tried to print more than one standard page of text. I simply couldn’t leave this bug in the finished program as it would be a frequent occurance that a student would print more than one page. American Graffiti rip

The solution was to get Flash to generate a pop-up .html window with the text that needed to be printed. Yet what seemed quite a simple solution turned into an utter coding nightmare with the following issues:

daybreakers the movie

  • Creating a pop-up window from Flash – by default pop-up windows are blocked
  • Flash needs a JavaScript wrapper (or equivalent) to trigger a pop-up window
  • Yet this wasn’t just a matter of triggering a pop-up window – here a unique window with the text from Flash has to be generated
  • Flash has to send the data (i.e. what the student has written) to the newly generated JavaScript window
  • There has to be an easy way for a student to print their work – the main aim
  • Yet to print the work without requring further use intervention would require even more coding.

I did manage to get it working – but it took ages and hours of fruitless work. Breaking out from using a single .swf file was the only solution that I found but this caused headaches at even the earliest stage – I had to make sure that the .swf file was correctly embedded without needing additional clicks ‘to activate’. To pass data from Flash to JavaScript to the new window meant each working part has to be correctly and carefully labelled.

Another Gay Sequel: Gays Gone Wild! download

buy Butterfly Effect: Revelation

Added to all this I found that the best way to store ‘model answers’ – which are presented to the user when then submit their own work – was to store these within the .html page that my application generates. Thus to make the application work I send data via JavaScript to Flash but then when someone wants to print their work the data is sent back from Flash to JavaScript. This rapidly became incredibly complex.

русское порно без смс

как дрочат хуй светские бабы
Monster dvd

The X Files hd

Practice Paper!

Dracula’s Guest full Ghostbusters II download

The Village video To cut a very long story short you can firstly see why I haven’t been posting to this blog that frequently, but I have now got the application working.

Gingerdead Man 2: Passion of the Crust psp

As with all my ContentGenerator.net programs, the teacher (or other user) adds their own content using Flash-based interface that runs as a quasi-projector file on the desktop. When they had added all their content they press ‘generate’ to create the finished application. Normally this generates a .swf file that can be used on its own, together with an .html file to embed the application correctly. Not so with Practice Paper…. it uses the following files:

  • .swf file – this is a custom .swf that contains the title, details and information about the exercise
  • .html file – again, a custom file this .html file is packed fully with question data – all urlencoded and potentially extremely long (view the source of the example above)
  • .js file – this is a fixed .js file (i.e. it isn’t changed at all when the application is generated). This JavaScript file contains a large amount of code. It is made up of the code that allows Flash to send data to JavaScript, which in the end with IE7’s communication issues came down to using FSCommand. It also contains code to create a unique JavaScript pop-up window, together with a small amount of CSS to create a fake information bar option to print the text. It also contains the fantastic SWFObject code to get the .swf file working and communicating correctly without any additional hassles.

Flood Another 48 Hrs. movies

The Net 2.0 ipod

The final solution, whilst appearing contrived and uncomfortable does work. The JavaScript is hidden away in one file, and the .html file contains an extensive amount of data. They key test was with students – with this latest version they were just able to use it – no hassles with printing and it just works!

Tags: e-Learning

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment