to provide interactive graphs (and other interactive content) in web pages.
Including Flash Movies
This provides the advantages that
- When I update the software in one place (on the server)
all the users are automatically updated the next time they use the application
- The software will "run" on any computer that supports Flash - Delphi won't
|I use the terms Flash movie,
Flash form, and Flash application interchangeably.
Adobe prefers the term movie -
However, in my mind, a movie runs from the beginning to the end
with minimal human interaction.
By design, applications and forms are designed specifically for
As a result, I tend to use the term movie to refer to the file and
the other terms when discussing what the program does.
| HTML code
| Pretend Directories
| Passing Parameters
One of the advantages of writing applications in Flash is that
each time the user accesses it, the current .. updated .. copy is
executed ... well, that was the theory anyway.
In practice, the web server caches the Delphi executables ...
making debug a real pain. It is possible that the same is happening
with Flash movie files. I have not seen this yet, but it is possible.
In my graphing applications
As you can see, there are a lot of places for a server cache to cause problems.
This scenario has 2 Delphi programs, a Flash movie, and a configuration file on the server.
- A Delphi application is called from the web server
- The returned web page has code to include a Flash application
- The Flash application is read from the web server
- The Flash application reads an ini-file from the web server
- The Flash application calls another Delphi application on the web server
to get the data to plot
as the web server, I have had problems with caching.
One way to get around this is to manually add some random text
to the query string.
While this code works fine in normal html files,
the Delphi Pretend Directories (next section)
will require you to modify it.
To add a Flash movie to a web page,
some html code needs to be added to the page and
needs to be placed on the server.
The Flash IDE will generate the code for you (so I won't repeat it here)
When cgi applications are written in Delphi,
it is possible to pass an action parameter by using a slash.
Unfortunately, this confuses the browsers who now think that the
exe-name is actually a directory name.
As a result, all relative URI's used by the Flash application
will have the fake directory automatically prepended.
when what I really wanted was
In addition, this problem causes the html generated by the Flash IDE to fail.
For instance, the following code is not able to locate
AC_RunActiveContent.js (required to use Flash movies).
There is also a problem with the html code that references the Flash movie itself.
Text similar to the following
needs to be changed to
<param name="movie" value="MyGraph.swf" />
This is a super pain - I suggest NOT using action's
in any code that uses Flash movies.
(Unfortunately, I was adding graphs to an existing application.)
<param name="movie" value="../MyGraph.swf" />
I have a separate page on
from the web page to the Flash movie.
In every way (except being able to make a web page interactive),
Delphi is greatly superior to Adobe Flash.
I could go on ...
I have written some pages
on developing Flash applications using ActionScript 3.0
- the Flash development language.
- Slow ... very slow
- This is very noticeable
- If the program takes more than 15 seconds to execute ... it just quits
- This is a real problem when plotting a lot of data
(like more than 1,000 points ... not much really).
There is a place to change the timeout value.
- File reads are non-blocking
- When you tell the program to read a file (or get external data by calling a program),
the ActionScript code just keeps going.
Apparently, it won't even start the read until the current subroutine terminates.
Eventually, an event will be triggered
when the data is received. This means that lots of events, and the subroutines
they call, need to be used.
- Mouse cursors
- You have to roll your own for this ... and it is a real problem keeping
the motion smooth because .. Flash is soooo slow.
At any rate, I have used Flash to develop web based applications that could not
have been done with Delphi alone.
Author: Robert Clemenzi -