swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] swfc bug in first example


From: Chris Pugh
Subject: Re: [Swftools-common] swfc bug in first example
Date: Tue, 13 Jul 2010 21:54:59 +0100

On 13 July 2010 20:19, Russell Lyons <address@hidden> wrote:
>
>
> On Tue, 13 Jul 2010, Chris Pugh wrote:
>
>> On 13 July 2010 19:35, Russell Lyons <address@hidden> wrote:
>>>
>>> Hi, Chris.
>>>
>>> On Tue, 13 Jul 2010, Chris Pugh wrote:
>>>
>>>> On 13 July 2010 16:58, Russell Lyons <address@hidden> wrote:
>>>>>
>>>>> Dear All,
>>>>>
>>>>> There seems to be a bug that is exhibited in the very first example of
>>>>> swfc code: (http://www.swftools.org/swfc/swfc.html)
>>>>>
>>>>>         Code listing 1.1
>>>>>
>>>>>        .flash filename="box.swf"
>>>>>            .box b1 100 100 color=yellow fill=red
>>>>>            .put b1 pin=center scale=0%
>>>>>            .frame 100
>>>>>            .change b1 pin=center scale=100%
>>>>>            .frame 200
>>>>>            .change b1 pin=center scale=0%
>>>>>        .end
>>>>>
>>>>> Namely, the very first frame shows the box in the wrong position and
>>>>> size. It flashes very briefly (on every loop), so could be missed by a
>>>>> casual viewer. I thought it would have shown only if a .put statement
>>>>> were there, but the first .put gives it a different size. What's wrong?
>>>>
>>>> There's nothing *wrong* Russ.  it's not a bug.  The script is
>>>> simply doing as it's told, e.g.
>>>>
>>>>          .box b1 100 100 color=yellow fill=red
>>>>
>>>> puts a bounding box on the screen, *then*,
>>>>
>>>>           .put b1 pin=center scale=0%
>>>>
>>>> changes it.  So,  you see the full size box, *before* it gets
>>>> changed.
>>>>
>>>> It's up to you to neaten up the performance.   Do as you
>>>> would on a proper stage production, put out the lights,
>>>> put the cast in their places then bring up the lights.
>>>>
>>>> .flash filename="box.swf"
>>>>          .box b1 100 100 color=yellow fill=red
>>>>          .frame 1
>>>>          .put b1 pin=center scale=0% alpha=0%
>>>>          .frame 2
>>>>          .change b1 alpha=200%
>>>>          .frame 100
>>>>          .change b1 pin=center scale=100%
>>>>          .frame 200
>>>>          .change b1 pin=center scale=0%
>>>>      .end
>>>>
>>>> HTH.
>>>>
>>>> Regards,
>>>>
>>>>
>>>> Chris.
>>>
>>> What you give certainly works. However, I am still confused, since the
>>> page I gave above says: "The .box command creates the box. Every object
>>> that is created must also be explicitly put into the scene using .put to
>>> become visible." My interpretation is that the .box command does *not*
>>> put it visibly on the screen, yet you seem to be right in that it
>>> *does*. Is the tutorial wrong?
>>>
>>> Thanks,
>>> Russ
>>
>> Let's use the theatre analogy again..
>> .
>> '.box' creates a bit of scenery.   You can make that bit of scenery any
>> size, shape, colour you want to.  It exists, but is still in the wings.
>>  Only
>> you know  it's there.
>>
>> '.put' takes the bit of scenery you made from the wings and places it on
>> the stage for all to view ( that if the lights are up. )
>>
>> '.del' is the opposite of put.  It removes the object from the stage
>> and puts it back in the wings. ( It doesn't destroy it completely )
>>
>> 'alpha='  up and down is a simply like altering the brightness of the
>> follow-spot on your piece of scenery.   Now you see it, now you don't.
>>
>> Better?
>>
>>
>> Chris.
>
> Hi, Chris.
>
> What you write now is precisely my original interpretation when I posted
> the question. However, the original file does not have a .put until it
> at the same time changes the scale and location. Yet the specifications
> given in the .box command are the ones that are visible before the .put
> command takes effect. That's what seems wrong. Sorry if I'm missing
> something simple, but the behavior and the descriptions still seem at
> odds to me.
>
> Thanks,
> Russ

That is simply a ( flexible ) quirk of the way swfc works.  You can apply
change parameters to an object at the same time as you put it on the
stage.   But that's also the problem..

..the PUT still happens before the changes are applied.  That's why the
effect is visible.  That's also why you see that big square in the initial
frame. That's also  why I chose to hide it using alpha.

There are other ways to mask these effects so as they are not seen.
Some can be done directly with the .box command.  For example, you
could make the object\s initial color match that of the stage background.
It's programming.  Be inventive! ;o)

HTH.


Chris.



reply via email to

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