NEVER MIND!
I just looked through the source code of the latest development release and found that there's a .del that does exactly what is needed:
.flash bbox=90x90 filename="test.swf" .outline ht_outline1: 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 ht1 outline=ht_outline1 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 ht1 .frame 10 .del ht1 .put ht2 .frame 20 .del ht2 .put ht3 .frame 30 .end
This works on 0.8.1 as well as the latest dev release...
I'll have to write an article about this for future reference.
Jon
--- On
Tue, 7/15/08, Jon Hartford <address@hidden> wrote:
From: Jon Hartford <address@hidden> Subject: Re: [Swftools-common] svg sequence to swf To: "Paulo Silva" <address@hidden>, "swftools mailing list" <address@hidden> Date: Tuesday, July 15, 2008, 1:39 PM
Paulo,
You're right about the alpha=0, that's not a very good way to do it...
You could just save them all as pngs and use png2swf. But then the file size would be way larger...
The most "correct"
or "elegant" way would probably be to rewrite the wxbasic scripts in Actionscript...
...Hmm...
(...45 minutes later...)
Alright, here's what I've come up with:
.flash bbox=90x90 filename="test.swf" .outline ht_outline1: 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 ht1 outline=ht_outline1 fill=grey color=grey .filled ht2 outline=ht_outline2 fill=grey color=grey .filled ht3 outline=ht_outline3 fill=grey color=grey
.frame 1 .action: _root.attachMovie("ht1", "mainmovieclip", 1); .end .frame 10
.action: _root.mainmovieclip.removeMovieClip(); _root.attachMovie("ht2", "mainmovieclip", 1); .end .frame 20 .action: _root.mainmovieclip.removeMovieClip(); _root.attachMovie("ht3", "mainmovieclip", 1); .end .frame 30 .end
It's a kind of a kludge too, I guess, but it shouldn't leave all those old vector images in memory. If you find a better way to do it, I'd love to know.
Jon.
--- On Tue, 7/15/08, Paulo Silva <address@hidden> wrote:
From: Paulo Silva <address@hidden> Subject: Re: [Swftools-common] svg sequence to swf To: address@hidden Date: Tuesday, July 15, 2008, 11:35 AM
hi Jon!
thanks about the opinion about my stuff! :-) - almost none is made 'by hand' on Flash - maybe just that isometric 'cmyk' i had to use some as 'movieclip' objects (i forgot the name of them since a long time i don't use Flash)
that isometric bars were done with a text editor (like Gedit or Editpad) over an .ai sequence
mostly all else were created from .ai sequences from wxbasic scripts, and merelly imported by Flash... - i think were hugelly crazy work doing stuff like that frame by frame with that accuracy, with hundred or thousands of independant frames, with Flash by hand...
about the:
.flash filename="test.swf" .outline ht_outline: (...) .jump ht2 alpha=0 .put
ht3 .frame 30 .end
thanks, it works fine with 3 frames, but i got doubt about how fine it would work with 1000, 10000 or 100000 frames... maybe having so many objects with alpha 0 may provide some performance problems even on a 8 or 16 core computer, with over 16gb of ram, and only running it... - this would be a kind of problem i wanted to avoid
for example, some of the examples i sent you were around 1000 frames (independent, without tweens) - my idea is, if importing .ai sequences from Flash we take the risk of crashing it, using swfc since it's terminal based, seems to be a more fast and stable way to do this... and even providing us less limits about independant frame amount, like 10000 or more - just like the way we do animated gif files with that amount of frames on gifsicle, and the same as video file with ffmpeg (as i have some from http://youtube.com/nitturo ), or making a
.pdf with tons of pictures with pdftk - my idea is being able to create .swf files in similar method, that easy
my idea is really having a different drawing for each frame, for a considerable ammount of them
(btw, i don't care about ms-windows, since almost 2 years i'm not using it... awesome experience on leaving it.. :-) )
btw, thanks for all information else, i truly believe will be very useful soon
thanks again and regards, Paulo
-----------------------
On Tue, Jul 15, 2008 at 5:42 PM, Jon Hartford <address@hidden> wrote: > 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. > > |
|