Because of the constant attack by the wiki spam bots, accounts that are created and not used will be deleted. If you are a legitimate user, and your IP was blocked, please contact any active administrator - look at Special:RecentChanges and see who is busy fighting spam.

Box

From SWFTools
Revision as of 19:49, 23 October 2011 by Cthulhu.fhtagn (Talk | contribs) (How to use box.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Box is the simplest widget in swfc. It's just a rectangle, possibly filled with color, with borders of the same (or a different) color and thickness.

The creation of a box is very simple: just declare it in the .box instruction, and pass the parameters.

For example:

.box nameofbox width=100 height=100 color=black

Parameters width and height are optional. This box has black borders but transparent interior. Optional parameters are:

  • fill - fills the box with border color, or with another color
  • line - gives a different thickness to the border

It's also possible to fill the box, not with a color, but with an image - just pass it as fill nameofimage.

The example, below, creates four boxes. They are placed side by side, in a 2x2 array. The boxes appear in sequence, taking 2 seconds between them. The image is stolen from Wikipedia, http://commons.wikimedia.org/wiki/File:Amy_lee_in_rock_and_rio_2011.jpg

.flash bbox=600x600 name="box_example.swf" fps=50 background=white
  .jpeg amylee amy_lee_in_rock_and_rio_2011.jpg
  .box bluebox 200 200 color=black
  .box redbox 200 200 color=red fill
  .box greenbox 200 200 color=green fill=yellow line=10
  .box amybox 200 200 color=pink fill=amylee

  .frame 1
  .put bluebox
  .frame 201
  .put redbox x=400 y=0
  .frame 401
  .put greenbox x=0 y=400
  .frame 601
  .put amybox x=400 y=400
  .stop
.end

Notice that this flash has a few minor bugs. For example, the yellow box with green borders was cropped - the line width makes it a larger box than the space allowed to it. Also, Amy Lee's image was distorted to fit inside the box.