Getting information into a Flash movie is a little more obvious than getting it back out again. Flash ActionScript in version 5 will allow you to bring information into the form via one of two methods (without Generator, that is): a text file or XML. The trick on the Notes side is to generate a "file" in the format that your Flash form expects to see.
Both versions are best served by using a "Treat view contents as HTML" view on a $$ViewTemplate also set to "Treat as HTML". The view is usually used in the single-category mode to give a subset of the data in the database. In both cases, all of the formatting you need will have to be part of the view's column formulas, and, with the XML option, the XML and Doctype declarations would also be present on the $$ViewTemplate. (The reason for choosing "Treat as HTML" on the $$ViewTemplate is to suppress Domino's HTML generation, which will allow you to format the resulting "file" exactly the way you need it to appear.) Individual documents can be gotten from a "Treat as HTML" form through a view form formula -- the "Treat as HTML" forms are useless for anything but read-only use on the web, but again you can format the information exactly the same way as you need it to appear -- and design your movie as if you were using an external text file or XML resource.
"Form formula?" This is probably the only really good use I've ever found for form formulas in views. On the web, you don't have to worry about having a view in the ui for a form formula to take effect. All you need to do is use a particular view's name in the URL, and the form formula for that view kicks in. A document that would normally be displayed/edited with a full-function form (including actions, links, etc.) can be displayed with a "printer friendly" form for printing, a data-only form for use as a plain-text resource, or a values-plus-(custom)tags form to create an XML document just by using a different view name in the document's URL.
Getting the information back ino the database means using the GET or POST methods of the Flash form. The POST method is a lot cleaner, since the GET method involves putting all of the data into the URL. Putting new information into the database is simply a matter of submitting the Flash form (with the correct fieldnames)using the "?CreateDocument" Domino URL. The Domino URL Cheat Sheet in the Sandbox (http://www-10.lotus.com/ldd/sandbox.nsf) is worth several times its printed weight in gold for this. Getting edited information back into a document is a little trickier -- you have to remember to bring the document's UNID into your movie -- and if you are working on multiple documents at a time, finding a way to keep the data separate in your ActionScript.
If you are lucky enough to be using the new MX version of Flash, you might want to take a lot closer look at the XML options. Being able to bring in a document or view-based data set by named node (as opposed to counting through the list and hoping everything is in the order you expect it to be in) will make getting the data and using it a lot easier. Putting the data back into Domino, though, will not really get much easier until the XML support is beefed up a bit.
From Notes.net
Posted by Stan Rogers on 29.Apr.02 at 09:14 AM using a Web browser
previous page
|