Hi,

To create true dynamic Flash animations, you have to use Macromedia
Generator, which actually is a Servlet but is quite expensive.

You can create pseudo-dynamic animations in several ways :

- loading different movies according to dynamic data you obtain from a
servlet.
- having an animation go to different images, or different scenes according
to dynamic data
- modifying clips according to dynamic data

The first and second solutions are obviously the easiest but the less
dynamic, because all images have to be pre-calculated.

The third solution is more powerfull, because you can move, resize, rotate
and change the colour of clip objects. However, you cannot dynamically
create clip objects. (On can argue that as far as you can create a pixel
large clip, you can combine instances of it to create any graphics.)

All these are Flash related subjects and have nothing to do with servlets.
The only point where servlets are involved is data communication. You can
send and load data to and form a servlet using three ways :

- http with url encoded data,
- http with XML data
- socket with XML data

First solution is the easiest if data structure is flat.
Second is better for structured data
Third allow communicating directly with a server on an open connection. (So
ther is no real need for a servlet here).

You must be aware of to "problems" :

1) When you ask for POST or GET method, the Flash client will not always do
what you ask for. Keaping this in mind, always put doGET and doPOST method
in your servlet and make a test to see which one is called. You will be
surprised. (This problem have been submitted to the Macromedia support team,
but they just don't know about servlets !)

2) In XML, ActionScript will treat leading and trailing white space as
separate text nodes. So, if <parent><child>Some text</child></parent> will
be processed correctly,

        <parent>
                <child>
                        Some text
                </child>
        </parent>

will not because the <parent> and the <hild> elements are cosidered to
contains three sub-elements. You then have to test the nature and the
contents of each element when you process the data. (In both cases, nodeType
will be 3 (text) for the first and third sub-element and content will be
blank.) (This problem have been submitted to the Macromedia support team,
but they say they do not claim full XML compatibility, so it's okay for
them.)

You can see an example of dynamic Flash Animation at the following address :

http://volga.wantjava.com/BargraphServeur.html

(this is kindly hosted for demo purpose by WantJava (www.wantjava.com)

Just clic on the graphs to update the data.

This example is from my last book (Flash et ActionScript, OEM Publisher,
unfortunately written in french).
I am currently working on other examples for my next book, with more
servlets examples.

Pierre-Yves


-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de Pol
Millan
Envoyé : vendredi 6 avril 2001 09:25
À : [EMAIL PROTECTED]
Objet : Servlets with flash


Hi guys,

Does anyone know how to generate flash dynamically from a servlet, for
instance that some database parameters determine the type of animation or
the elements involved in it.

Thanks in advance,

Pol Millan.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to