swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] svg sequence to swf


From: Jon Hartford
Subject: Re: [Swftools-common] svg sequence to swf
Date: Tue, 15 Jul 2008 09:42:19 -0700 (PDT)

Paulo,

I'm not an expert on svg or flash (or even swfc), but I'll try to help as best I can...:

>
Thanks a lot!  There are lots of very useful information i couldn't find anywhere else! (i were years looking for it! :-) )
> The part about converting d="" information into swfc is excellent and i'm start trying them now! :-)
> But how to create animations frame by frame instead of using tweening i'm still looking for - how must i separate frames inside the swfc? (rarelly or never i use tweening)
> (...)

If you want to move an object from one place to another onstage (or scale it, or rotate it, or etc...) with tweening, you can use the .change command:

.flash filename="test.swf" fps=25
     .outline ht_outline:
          M 36.99 29.93 L 15.52 51.39 L 20.44 51.39 L 20.44 81.91
          M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
     .end
     .filled ht outline=ht_outline fill=grey color=grey
     .frame 1
     .put ht x=0 y=0
     .frame 50
     .change ht x=20 y=20
.end

To move it without tweening, you can use the .jump command:

.flash filename="test.swf"
     .outline ht_outline:
          M 36.99 29.93 L 15.52 51.39 L 20.44 51.39 L 20.44 81.91
          M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
     .end
     .filled ht outline=ht_outline fill=grey color=grey
     .frame 1
     .put ht x=0 y=0
     .frame 50
     .jump ht x=20 y=20
     .frame 100
.end

(The .frame 100 is there so that it pauses a little bit so you can see more what it's doing.)

> (...)
> And starting to think better, if i were working on large .svg frames (with some complexity) in separated files in a sequence - but if the swfc is just one file, it can became concerningful huge... can i work with swfc sequences as well?
>
> thanks again, a lot, indeed! :-)
> Paulo

You can separate swfc scripts into chunks if you need to by using the .include statement (command, statement... I'm not sure what they're officially called...) See http://technoargia.free.fr/swftools/examples/scrollbar1_include/scrollbar1.html and http://technoargia.free.fr/swftools/examples/scrollbar1_include/scrollbar_include.sci for an example. Note that include doesn't seem to work properly on Windows. (The development releases might fix that..?)

> like if we can do something like this way:
>
> .flash filename="test.swf"
>    .outline ht_outline:
>     .frame 1
>         M 36.99 29.93 L 15.52 51.39 L 20.44 51.39 L 20.44 81.91
>         M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
>      .frame 2
>         M 39.73 81.91 L 39.73 62.33 L 48.36 62.33 L 48.36 81.91
>         M 53.84 81.91 L 53.84 51.39 L 28.79 53.70 L 58.45 51.39
>      .frame 3
>         M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
>         M 39.73 81.91 L 39.73 62.33 L 48.36 62.33 L 36.99 29.93
>   .end
>    .filled ht outline=ht_outline fill=grey color=grey
>    .put ht
> .end
>
> of course this may provide error, but my idea is something like this -
> frame by frame animation, without tween....
>
> thanks in advance! :-)

Is this what you wanted?:

.flash filename="test.swf"
    .outline ht_outline:
         M 36.99 29.93 L 15.52 51.39 L 20.44 51.39 L 20.44 81.91
         M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
    .end
    .outline ht_outline2:
         M 39.73 81.91 L 39.73 62.33 L 48.36 62.33 L 48.36 81.91
         M 53.84 81.91 L 53.84 51.39 L 28.79 53.70 L 58.45 51.39
    .end
    .outline ht_outline3:
         M 28.79 53.70 L 34.55 53.70 L 34.55 60.60 L 28.79 60.60
         M 39.73 81.91 L 39.73 62.33 L 48.36 62.33 L 36.99 29.93
    .end
    .filled ht outline=ht_outline fill=grey color=grey
    .filled ht2 outline=ht_outline2 fill=grey color=grey
    .filled ht3 outline=ht_outline3 fill=grey color=grey
    .frame 1
       .put ht
    .frame 10
       .jump ht alpha=0
       .put ht2
    .frame 20
       .jump ht2 alpha=0
       .put ht3
    .frame 30
.end

If the frames were intended to be added onto the last, take out the .jumps. It's too bad this can't be done a little more efficiently. (Maybe it can, and someone more knowledgeable will come along and correct me.)

If you have a lot of things going on at once, you might want to put each animation into a .sprite (AKA MovieClip), e.g:

.sprite htmc
        .put ht
        .frame 2
        .put ht2
        .frame 3
        .put ht3
.end

And then you can move/scale/... the htmc sprite itself while it's going through the animation.

> some small stuff i done years ago - how far can i do stuff like this with swfc?
> http://www.fileshack.us/get_file.php?id=800424&file=swf.zip

As far as I know, just about anything you can do with Adobe Flash, you can do with SWFC. Looking at what you have there: A lot of that stuff is pretty cool. Did you animate it all by hand? If you did, you might want to learn Actionscript. Some of it you could write algorithms to generate that instead. See http://penguinpetes.com/b2evo/index.php?title=flash_demo_9_keyboard_control_and_ball_p for a good short example of using Actionscript with swfc.

For further reading I suggest: http://www.swftools.uni.cc/code.php which has (or links to) just about all of the tutorials and examples I know of, as well as the official swfc manual at http://www.swftools.org/swfc/swfc.html

Have fun :),
Jon.


reply via email to

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