Years ago, I was wondering if it was possible to play Flash content in the Notes Client. But the interest for it disappeared, because it didn’t serve any real purpose then. Until I saw IntelliPRINT’s Dashboard Reporting: they use FusionCharts, the tool I spoke about earlier, to display its amazing charts in the client.
Now thÃ t is something great! Just imagine you sending an email to your boss with an impressive chart in it. But then it seems the boss is not so happy with the figures. You just act surprised, change the figures in the background, tell him he must have been mistaken, he reopens the mail to check back et voilÃ , an updated chart is shown!
I updated the Charts demo database to include this Notes Client example. Do a preview of the form NotesClient in the client to see the result (but do a preview of the Charts page in the browser first to start a websession)
While this sounds like a good idea, there are some issues out there: some of them I found answers for, others are unresolved.
I also googled around and saw that others walked the same path in the past. Some of the honey I got from these articles:
- How to load swf Files in a Notes Form and view inside the Notes Client?
- A comment from a person calling himself “Li” on another FusionCharts-in-Domino article (at the same time I discovered my previous article wasn’t that original after all)
I mixed the honey, and added some of my own experiences and footnotes.
Dropping a Flash movie in the Notes Client
I wished it was as easy as drag-and-drop. But nevertheless here’s an attempt to make it as painless as possible.
- On a form or page, choose Create – Object – Control – Macromedia Flash Paper (that’s right, Flash Paper, don’t ask me why).
- Change height and width in the properties, and (optionally) the name.
- Add your swf movie in the file resources.
- Now you need a handle to the object to assign the source movie to it. Other webposts mention the Initialize event of the object itself to set the object, but I experienced timing problems, which gave me an “Object variable not set” with the GetObject. Even a Sleep didn’t help. To avoid these messages, I prefer to use the PostOpen event of the form and this seems to do the job:
Sub Postopen(Source As Notesuidocument) Dim FlashMovie As Variant Set FlashMovie = Source.GetObject("FlashObject") 'The object's name FlashMovie.LoadMovie 0,"http://host/dbname.nsf/movie.swf" End Sub
- Make sure the movie is in a database running on a server with http enabled. If you run it locally nhttp.exe needs to run (the easiest way to invoke this, is by previewing a design element from a local database in the browser).
- Test the form or page.
One step further – dropping a FusionChart in the Notes Client
Apart from the steps above, some additional steps are needed to suck the xml data in the chart:
- In the page properties (or form) from the data file, set as content type Other – text/xml.
- In the LoadMovie parameter you need to add the path-to-the-data with the suffix dataURL, f.e.
A big issue
As from Flash Player 9 this doesn’t work any longer! Previous versions showed ShockwaveFlash.ShockwaveFlash.1 as the object’s class property, now it’s ShockwaveFlash.ShockwaveFlash.9 and in this version some properties and methods have changed and disappeared.
A possible workaround (but not a good one) is to uninstall version 9 of the player, then install version 8 from Adobe’s site.
Anybody out there who has some experience with this version issue? Anyway, I’ll add it to my list of things to investigate…