Links:
- <uri>http://www.quiss.org</uri> OR
- <uri link=http://www.quiss.org>Quiss</uri>
+ <a>http://www.quiss.org</a> OR
+ <a href=http://www.quiss.org>Quiss</a>
Shell scripts, commands to execute:
.end
.filled filled_helloworld outline=helloworld fill=whitefade line=1 color=#2c2c2c
- .put filled_helloworld
+ .put filled_helloworld scale=200%
.end
</code>
<code lang="swfc">
.flash name="text5.swf"
.font courier "Courier.swf"
-.font helvetica "Helvetica.swf"
-.text hithere text="HELLO" font=courier size=50%
+.text hithere text="HELLO" font=courier size=200%
.swf scene Scenery50.swf
.frame 0
<code lang="swfc">
.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
</chapter>
+<chapter><title>ActionScript</title>
+
+<section>
+ <c>swfc</c> has Actionscript support.
+ For normal actionscript, which is executed once a given frame
+ is reached, just open an <c>.action</c> block, and write
+ the ActionScript into the block:
+
+<code lang="swfc">
+.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.3;
+ 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
+</code>
+
+Or, for much more interesting ActionScript examples, see
+Laurent Lalanne's
+<a href="http://technoargia.free.fr/swftools/examples/flash_eyes/flash_eyes.html">Flash Eyes</a>
+or the
+<a href="http://melusine.eu.org/syracuse/flash/20040429/fabrique/">source</a>
+of Jean-Michel Sarlat's
+<a href="http://melusine.eu.org/syracuse/flash/20040429/">Mandelbrot explorer</a>.
+
+</section>
+
+
+</chapter>
+
+<chapter><title>Buttons</title>
+<p>
+Actionscript comes in handy when dealing with SWF Buttons.
+</p>
+<p>
+A button defines, in SWF context, an object sensitive to mouse movement,
+mouse buttons, and key presses.
+</p>
+<p>
+The following is a trivial example: Four objects which change their shape
+once the cursor is over it.
+<code lang="swfc">
+.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
+</code>
+</p>
+
+<p>
+The <c>.show</c> command (which can only be used inside <c>.button</c>) has a syntax
+very similar to <c>.put</c>.
+For every shape a button uses, you can specify the position, color transform, scaling,
+rotation etc. just like with <c>.put</c>.
+</p>
+<p>
+The only <i>real</i> difference between those two commands is the <c>as</c> parameter:
+with that you tell the button when to display that specific shape.
+There are four allowed parameters to <c>as</c>:
+<ul>
+ <li><b>idle</b> The shape to display when the button is idle, that is, the
+ mouse is somewhere else, and not over the button.
+ </li><li><b>hover</b> The shape to display if the mouse cursor is <i>inside</i> the button.
+ What exactly is <i>"inside"</i> is defined by <b>area</b>:
+ </li><li><b>area</b> This shape is not displayed. It serves as bounding box (actually,
+ bounding polygon) for the button. A button considers itself
+ active (that is, the <c>hover</c> shape is active, not the <c>idle</c>
+ shape) if the mouse is inside this area. Also, mouse button clicks
+ have to be in this area for this button.
+ </li><li><b>pressed</b> The shape to display if the user clicks on the button. This shape
+ is displayed as long as the mouse button is down.
+ </li>
+</ul>
+</p>
+
+<!--
+<section><title>Another button example: tooltips</title>
+
+Due to the fact that button shapes can be put <i>anywhere</i> especially
+outside the active area, it's easy to generate tooltips or subtitles.
+
+<code lang="swfc">
+.flash name="tooltips.swf" fps=50
+
+.jpeg pic fence.jpg
+.put pic
+
+.font arial Arial.ttf
+.edittext tooltip_fence text="fence" readonly color=green font=arial width=200 height=50 size=20%
+.edittext tooltip_wheel text="wheel" readonly color=green font=arial width=200 height=50 size=20%
+.edittext tooltip_tree text="tree" readonly color=green font=arial width=200 height=50 size=20%
+.edittext tooltip_mountain text="mountain" readonly color=green font=arial width=200 height=50 size=20%
+
+.box box1 fill=red width=1 height=1
+.button mybutton1
+ .show box1 as=area x=0 y=0
+ .show tooltip_fence as=hover x=25 y=25 scalex=100 scaley=100 alpha=50%
+ .show tooltip_fence as=idle x=25 y=25 scalex=100 scaley=100 alpha=50%
+.end
+
+.frame 0
+ .put mybutton1
+.end
+</code>
+
+</section>
+-->
+
+</chapter>
</guide>