morphis logo morphis | wax   
wax manual
wax manual
 

Overview

Architecture

Structure
   Documents
   Navigation
   Forms
   Animation

Devices
   device.xml

DIS
   wax syntax
   text selection
   image selection
   text and image xml

Application
   Configuration
   Servlet
   Filters

Animated Documents

Creating animation sequences is a very simple task with WAX. There are two tags specifically designed for animation wax:animation and wax:animationblock .

For WML, the animation tags take care of the timer events or redirection of pages from one to another. Each image or text in the animation sequence is stored in its own block (animationblock) that gets translated to one card. The generated code includes one deck with many cards: the ones that form the animation linked by timer events, the static ones by hard links.

For HDML, the code generated includes one deck with many cards where each is connected to the next one by hard links.

For HTML, an animated GIF image can be used and this one must be specified in the srcid attribute of the wax:animation tag. It ignores all the wax:animationblock tags.

The following example illustrates the use of the animation WAX tags. It generates an animation sequence of both images and text. Ends with a static block.

<wax:wax version="1.0" xmlns:wax="http://www.morphis.org/wax">
  <wax:doc>
    <wax:animation time="1" srcid="wassup">
      <wax:button type="go" keytype="accept" label="Text" href="#frame5"/>
      <wax:button type="prev" keytype="options" label="Exit"/>
      <wax:animationblock id="frame0" srcid="ws0" 
                             alt="ws0" href="#frame1"/>
      <wax:animationblock id="frame1" srcid="ws1" 
                             alt="ws1" href="#frame2"/>
      <wax:animationblock id="frame2" srcid="ws2" 
                             alt="ws2" href="#frame3"/>
      <wax:animationblock id="frame3" srcid="ws3" 
                             alt="ws3" href="#frame4"/>
      <wax:animationblock id="frame4" srcid="ws4" 
                             alt="ws4" href="#frame0" time="15"/>
    </wax:animation>
    <wax:block id="frame5">
      <wax:button type="prev" keytype="accept" label="Back"/>
      <wax:p>
      <wax:text textid="smile">Smile! Be Happy.</wax:text>
      </wax:p>
    </wax:block>
  </wax:doc>
</wax:wax>

For WML, this code generates an animation deck of 7 cards. The first 6 cards are the animated ones. The animation will go on until the user selects either link for "Text" or "Exit". Note that the first 4 cards jump to each other after 1/10 second (time = 1 in wax:animation). The 5th card gets displayed 1/15 second before jumping back to the first card. The last 7th card, the static one is accesed through the "Text" link. The whole animation deck is exited through the "Exit" link.

Note carefully that the WAX code above defines only 6 cards or blocks. But 7 cards are generated. The first, hidden card is used for loading ALL the images in the deck into cache. This way, when the animation starts, images are completely displayed.
HTML instead uses the gif animated image "wassup" and displays it and the static card on the same page.

Since this tag creates all the animation sequence within one deck, caution has to be taken into account when developing for WML and HDML. The current specifications allow deck sizes of up to 1200 kb otherwise the deck will be too large and will not get displayed in the wireless devices.

morphis SourceForge Logo