Home Page

example - basic1

<swfml>
<loadJPG delay="0" time="NA" url="http://flashbots.com/anna.jpg" name="Anna" depth="400" xcoord="0" ycoord="0"/> <zoom delay="10" time="NA" target="Anna" type="absolute" mode="immediate" value="200" />
<javascript delay="12" time="NA" js="history.go(-1)"/>
<javascript delay="12" time="NA" js="history.go(-1)"/>
</swfml>

Behavior:

This short example imports a JPG file into the Flash environment, waits for 10 seconds and then resizes the picture to 200 percent.

Demonstration:

Explanation:

The first swfml statement loads the jpg file into the "swfml engine", names it and gives it depth, x and y coordinate values. In this case the depth is set to 400. For the purposes of this demonstration it would have been reasonable to set it to 1 as there are no other objects to be considered. The x and y coords are 0 and 0, which places the picture at the top left hand corner of the movie. Note that there are no delay or time attributes. The jpg object is referenced by "Anna", as indicated by the value of the name attribute.

The second swfml statement changes the scale of the now loaded jpg from the default 100 percent size, to 200 percent. The target attribute value is "Anna", as the previous swfml statement has referenced it. The type attribute's value is "absolute", the other possible value is "add". If the type attribute had been set to "add", the value attribute of 200 would have been added to the 100 percent existing scale value to cause the jpg to resize to 300 percent. Negative values can be specified, causing objects to shrink, if the type attribute is "add". The mode attribute is set to "immediate", the other possible option for that attribute is "gradual", which causes the scaling procedure to take place over time. Since the delay attribute is set to "10" the scaling will not start for 10 seconds.