swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] An eCard created using swfc


From: Kevin Veroneau
Subject: [Swftools-common] An eCard created using swfc
Date: Wed, 11 Jul 2007 07:05:41 -0500
User-agent: KMail/1.9.5

Hello to the mailinglist again,

  I noticed that someone just submitted a question about .sc files and swfc 
code examples.  Well, here is the first one I'll share.  May I just warn you, 
it's a tad messy.  I sort of got this eCard to my mother a tad late on her 
birthday and didn't have time to fully comment the source code.  If anyone 
has any questions about it, feel free to ask.

  Feel free to use any bits of this code you want, since it's posted here, 
it's offically GPL'd.

  You can view the running version on this website:
http://www.unixboy666.com/cards/mother.php?card=mom-bday-2007

  This is also a great example on how to implement a custom cursor, use sound, 
add SVG graphics, use gradients, use the blur filter, create buttons, and 
control movieclips.  It says it was created using Linux, as I compiled and 
used swftools under my Debian distribution.

  The cursor was drawn using the Inkscape SVG program.

Here is the code:

.flash filename="mom-bday-2007.swf" bbox=640x480 version=8 compress
.sound startup "../KDE_Startup.wav"
.sound poem "../mom-bday-peom.wav"
.font arial "fonts/Arial.swf"
.font f1 "fonts/Wargames.swf"
.font f2 "fonts/Swift.swf"
.blur blurit blur=100 passes=2
.blur unblurit blur=0 passes=2
# My Flash heartbeat
.outline heart_outline:
M 364.54169,476.21098 C 377.84356,508.96724 358.57824,525.50533 
302.06965,537.66374 C 224.95044,554.25674 213.21273,545.28411 
242.47004,461.20106 C 252.86318,431.33205 256.21747,426.70653 
290.10119,411.85308 C 312.14288,402.19075 314.41385,406.34061 
323.16096,417.70118 C 336.56146,447.00033 301.05366,445.29279 
297.76101,476.21099 C 328.21755,481.85571 355.95576,458.79289 
364.54169,476.21098 z
.end
.filled heart outline=heart_outline fill=red color=white
.sprite heartbeat
  .frame 1
    .put heart pin=center scale=5 rotate=-40
  .frame 5
    .change heart scale=10
  .frame 15
    .change heart scale=5
  .frame 25
    .change heart scale=10
    .action:
      gotoAndPlay(5);
    .end
.end
# Custom fills and gradients
.gradient cl1:
    0% red
    50% green
    75% aquamarine
    100% #ffffff
.end
.gradient cl2:
    0% #000000
    50% #aa0000
    75% #aa0000
    100% #000000
.end
.gradient metal:
  0% #aaaaaa
  100% #dddddd
.end
.gradient metal_invert:
  0% #dddddd
  100% #aaaaaa
.end
.box btn fill=metal line=3 width=200 height=40 color=black
.box btn_hover fill=metal_invert line=3 width=200 height=40 color=blue
.text playtxt font=arial text="Play" color=black
# Text for kvintro
.text kv1 font=f1 text="A Kevin Veroneau creation" color=green
.text kv2 font=f1 text="Created with the Power of Linux" color=green
# Text for intro
.textshape t1_shape font=f2 size=50% text="To my mother Kathy Veroneau"
.filled t1 outline=t1_shape fill=cl2 line=1 color=black
.textshape t2_shape font=f2 size=50% text="It is your Birthday, yet another 
year"
.filled t2 outline=t2_shape fill=cl2 line=1 color=black
.textshape t3_shape font=f2 size=50% text="This is your Son, I will always be 
near"
.filled t3 outline=t3_shape fill=cl2 line=1 color=black
.textshape t4_shape font=f2 size=48% text="I wish you the best, in your golden 
years"
.filled t4 outline=t4_shape fill=cl2 line=1 color=black
.textshape t5_shape font=f2 size=50% text="Let this day be blessed with joy"
.filled t5 outline=t5_shape fill=cl2 line=1 color=black
.textshape t6_shape font=f2 size=50% text="For the lord is watching"
.filled t6 outline=t6_shape fill=cl2 line=1 color=black
.textshape t7_shape font=f2 size=50% text="over you and your boy"
.filled t7 outline=t7_shape fill=cl2 line=1 color=black
.button playbtn
  .show btn as=area
  .show btn as=idle
  .show btn as=shape
  .show btn_hover as=hover
  .show btn as=pressed
  .on_press:
    Play();
  .end
.end
.textshape mom1a font=arial size=200% text="To a loving mother"
.text soundon font=arial text="Turn on your sound..."
.filled mom1 outline=mom1a fill=cl1 line=1 color=black
.sprite mom2
  .frame 1
    .put mom1 pin=center x=320 y=240 filter=blurit
  .frame 50
    .change mom1 filter=unblurit alpha=100%
    .action:
      Stop();
    .end
  .frame 100
    .change mom1 filter=blurit
  .frame 150
    .change mom1 alpha=0%
    .action:
      _parent.Play();
      Stop();
    .end
.end
.sprite kvintro
  .frame 1
    .put kv1 pin=center x=320 y=240 alpha=0% scale=50%
  .frame 25
    .change kv1 alpha=100%
  .frame 75
    .change kv1 alpha=100%
  .frame 100
    .change kv1 alpha=0%
    .put kv2 pin=center x=320 y=240 alpha=0% scale=50%
  .frame 125
    .change kv2 alpha=100%
  .frame 175
    .change kv2 alpha=100%
  .frame 200
    .change kv2 alpha=0%
    .action:
      Stop();
      _parent.Play();
    .end
.end
.sprite cardtext
  .put t1 pin=center x=320 y=20
  .put t2 pin=center x=320 y=50
  .put t3 pin=center x=320 y=80
  .put t4 pin=center x=320 y=110
  .put t5 pin=center x=320 y=140
  .put t6 pin=center x=320 y=170
  .put t7 pin=center x=320 y=200
.end
.sprite intro
  .frame 1
    .put cardtext pin=center x=320 y=-100 alpha=0%
    .play poem loop=0
  .frame 200
    .change cardtext y=370 alpha=100%
    .put mom2 y=-100
    .action:
      mom2.Play();
      Stop();
    .end
.end
.sprite cursor
  .frame 1
    .put move=heartbeat scale=200% alpha=50%
  .frame 2
    .action:
      move.useHandCursor=1;
      move._x=_xmouse;
      move._y=_ymouse;
      Mouse.hide();
      gotoAndPlay(1);
    .end
.end
.box stage fill=pink line=0 width=640 height=480
.sprite ecard
.put stage
.frame 1
  .put mom2
  .put soundon pin=center x=320 y=300
  .put playbtn pin=center x=320 y=350
  .put playtxt pin=center x=320 y=350
  .action:
    Stop();
  .end
.frame 2
  .play startup loop=0
  .del playtxt
  .del playbtn
  .del soundon
  .action:
    mom2.Play();
    Stop();
  .end
.frame 3
  .del mom2
  .change stage alpha=100%
.frame 50
  .change stage alpha=0%
  .put kvintro
  .action:
    Stop();
  .end
.frame 75
  .change stage alpha=100%
  .put intro
  .action:
    Stop();
  .end
.end
.put ecard
.put cursor
.end

Enjoy,
  Kevin.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]