swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] A couple of questions


From: Matthias Kramm
Subject: Re: [Swftools-common] A couple of questions
Date: Sun, 7 Nov 2004 18:37:23 +0100
User-agent: Mutt/1.5.6i

On Wed, Nov 03, 2004 at 09:25:31PM -0500, Chris Flowers wrote:
> Example #1, the script below creates an swf that appears to be 1 frame but
> the header says zero.
> 
> .flash bbox=320x240 fps=30 version=6 compress background=#CCCCCC
>  .box b1 100 100 color=black fill=blue
>  .put b1 x=10 y=10
> .end

Hm. Yes, I believe you found a bug.
Even though the generated file has now SHOWFRAME tags at all,
it still has one "implicit" frame, so the header should say "1".
I think the END tag has to increase the frame count, too, if there
is no SHOWFRAME tag preceding.
I'll fix that.

While at it, maybe swfc should always write a SHOWFRAME directly before
the END. I dimly remember it's also o.k. to omit the final SHOWFRAME,
though. (Not that it has any advantage apart from saving two bytes)

> Example #2: Creates a 1 frame movie but puts the show frame tag in the wrong
> place, coming before the place data.
> The Flash MX player will display this one fine as well, but the ActiveX
> player only shows an empty stage.
> 
> .flash bbox=320x240 fps=30 version=6 compress background=#CCCCCC
>  .frame 1
>  .box b1 100 100 color=black fill=blue
>  .put b1 x=10 y=10
> .end

Does the ActiveX player maybe only display the first frame?
Because strictly speaking, the file above contains two frames: 
One empty (just before the .frame 1) and one with the box.

It *is* funny though, that the when played in the Flash Player
the box does not "flicker", even though it should be invisible
in one of the two frames.
It does behave correctly though when there's the extra
SHOWFRAME tag before the END tag, so I think swfc should really
write that out. I'll fix it and upload a new version.

> Example #3: Creates a 1 frame movie with the show frame tag where it should
> be, after the data.
> Both flash players tested display it fine as expected.
> 
> .flash bbox=320x240 fps=30 version=6 compress background=#CCCCCC
>  .box b1 100 100 color=black fill=blue
>  .put b1 x=10 y=10
>  .frame 1
> .end

Ok. With the fixed swfc, the above will now be a 2 frame movie,
with the second frame being "empty" (i.e., containing no changes. Of
course, b1 will still be visible in frame 2 (as it hasn't be deleted))

> This forces you to count frames starting at 1 and not zero-based if you want
> to generate the
> tags properly, since ".frame 0 name = "mylabel" does not add a show frame
> tag, only a label.

That behaviour is correct!
The label tag always referes to the *preceding* showframe tag, or the
first frame if there is no preceding tag!

Consider the following movie:

    # frames.sc
    .flash name="frames.swf" version=6
        .font arial "Arial.ttf"
    
        .text go1 size=100% color=white font=arial text="Go to Frame 'one'"
        .text go2 size=100% color=white font=arial text="Go to Frame 'two'"
        .text go3 size=100% color=white font=arial text="Go to Frame 'three'"
    
        .button b1 
        .show go1 x=200 y=0 as=idle,area
        .show go1 x=200 y=0 red=0 as=hover,pressed
        .on_press:
            GotoFrame("one");
        .end
        .end
        .put b1

        .button b2 
        .show go2 x=200 y=50 as=idle,area
        .show go2 x=200 y=50 red=0 as=hover,pressed
        .on_press:
            GotoFrame("two");
        .end
        .end
        .put b2

        .button b3 
        .show go3 x=200 y=100 as=idle,area
        .show go3 x=200 y=100 red=0 as=hover,pressed
        .on_press:
            GotoFrame("three");
        .end
        .end
        .put b3
    
        .frame 0 name=one
        .text text1 size=100% color=white font=arial text="one" .put text1
        .stop
    
        .frame 1 name=two
        .del text1
        .text text2 size=100% color=white font=arial text="two" .put text2 y=50
        .stop
    
        .frame 2 name=three
        .del text2
        .text text3 size=100% color=white font=arial text="three" .put text3 
y=100
        .stop
    .end

Notice that the first FRAMELABEL ("one") in the dump (generated by the
.frame 0 command) refers to the first frame, not the first SHOWFRAME- so
the corresponding button (b1) correctly jumps to the first frame 
(frame 0 in swfc notation, or frame 1 in Flash notation).

Greetings

Matthias






reply via email to

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