X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=doc%2Fswfc.xml;h=e2ee61f20485d29f9f763e485e2ab51868e6dd28;hb=cf2adf8a0c23642d8858a49e07e1716c7ace8d3d;hp=106efac95e0342750d06add1a8859b6a2328f755;hpb=dd43e3a688ce83c0427410732aac0314ff814d11;p=swftools.git
diff --git a/doc/swfc.xml b/doc/swfc.xml
index 106efac..e2ee61f 100644
--- a/doc/swfc.xml
+++ b/doc/swfc.xml
@@ -35,8 +35,8 @@ Line breaking:
Links:
-
The
+ Change, on the other hand, modifies an already existing object.
+ It works gradually: In the example above, the change happens over 100 frames.
+ If you want to change an object suddently from one frame to the next, you
+ would use the
+You can define a number of parameters in the
+Each one of these consists of two parts: The multiplicator and the shift.
+The syntax is
+
+You can also specify negative values for both
+The following example demonstrates a few of the possible transforms: +
+ +
.flash name="cxform.swf" version=5
@@ -142,7 +175,11 @@ Boxes:
.change s1 x=105 y=105 scalex=0 scaley=0 luminance=0 #fadeout
.end
-
+
+A very useful fact is also that you can color transform the alpha component.
+So to fade any object into the background, you would simply transform it's
+alpha color: E.g. So much for the basics. Now let's go to the more advanced -functionality. +functionality around fonts.
@@ -217,7 +260,7 @@ objects which you can use in other commands.
.flash name="fontoutline.swf"
.font Arial "Arial.swf"
- .textshape helloworld font=Arial text="Hello World"
+ .textshape helloworld font=Arial size=200% text="Hello World"
.filled filled_helloworld outline=helloworld fill=blue line=5 color=green
.put filled_helloworld
.end
@@ -241,7 +284,20 @@ of a plain color:
.end
.filled filled_helloworld outline=helloworld fill=whitefade line=1 color=#2c2c2c
- .put filled_helloworld
+ .put filled_helloworld scale=200%
+.end
+
+
+While at it, you can also fill with an image:
+
+
+.flash name="fontimage.swf"
+ .font courier "Courier.swf"
+ .jpeg beach "beach.jpg"
+ .textshape text font=courier text="HOLIDAY"
+
+ .filled filled_text outline=text fill=beach line=1 color=#2c2c2c
+ .put filled_text scale=200%
.end
@@ -253,13 +309,12 @@ them for clipping:
.flash name="text5.swf"
.font courier "Courier.swf"
-.font helvetica "Helvetica.swf"
-.text hithere text="HELLO" font=courier size=50%
-.swf scene Scenery50.swf
+.text hithere text="HELLO" font=courier size=200%
+.jpeg scenery "scenery.jpg"
.frame 0
.startclip hithere pin=center x=100 y=75 scale=50% #text clips...
- .put scene # ...the image "scene"
+ .put scenery scale=50%
.end
.frame 100
.change hithere rotate+=360 pin=center scale=100%
@@ -267,17 +322,25 @@ them for clipping:
.end
+
+The last two examples look similar, but their underlying structure +is different: The first is a shape object filled with +image data (that is, a texture), while the second uses a normal +text object to clip an rectangular image. +
+ +
Also,
.flash name="text6.swf"
-.font courier "Courier.swf"
-.font helvetica "Helvetica.swf"
-.text hello text="HELLO" font=helvetica size=50% color=blue
-.text world text="WORLD" font=helvetica size=50% color=red
+.font times "Times.swf"
+.text hello text="HELLO" font=times size=100% color=blue
+.text world text="WORLD" font=times size=100% color=red
.frame 0
.put hello pin=center x=50 y=50
@@ -290,7 +353,159 @@ which is used here together with the alpha parameter of .change :
+.flash name="edittext.swf" bbox=210x110
+ .font Arial "Arial.swf"
+ .edittext myedittext font=Arial size=20%
+ width=200 height=100
+ color=blue border multiline wordwrap
+ text="Edit me!\nClick with your mouse on this text to edit it."
+ .put myedittext x=3 y=3
+.end
+
+
+
+.flash name="action.swf" bbox=300x300 fps=50
+
+.box mybox color=blue fill=green width=100 height=100
+.put mybox
+
+.frame 0
+ .action:
+ _root.angle += 0.1;
+ mybox._x = 100*Math.cos(_root.angle)+100;
+ mybox._y = 100*Math.sin(_root.angle)+100;
+ .end
+.frame 1
+ .action:
+ gotoFrame(0);
+ Play();
+ .end
+.frame 2
+.end
+
+
+Or, for much more interesting ActionScript examples, see
+Laurent Lalanne's
+Flash Eyes
+or the
+source
+of Jean-Michel Sarlat's
+Mandelbrot explorer.
+
++Actionscript comes in handy when dealing with SWF Buttons. +
++A button defines, in SWF context, an object sensitive to mouse movement, +mouse buttons, and key presses. +
+
+The following is a trivial example: Four objects which change their shape
+once the cursor is over it.
+
+.flash name="button1.swf" fps=50
+
+.box box1 color=white fill=#336633 width=50 height=50
+.box box2 color=white fill=#99cc99 width=100 height=100
+.button mybutton1
+ .show box1 as=shape x=25 y=25
+ .show box2 as=hover x=12.5 y=12.5
+.end
+
+.frame 0
+ .put b1=mybutton1
+ .put b2=mybutton1 x=100 red=+255
+ .put b3=mybutton1 y=100 green=+255
+ .put b4=mybutton1 x=100 y=100 blue=+255
+.end
+
+
+The
+The only real difference between those two commands is the