swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] navigate a slideshow generated with swfc


From: Matthias Kramm
Subject: Re: [Swftools-common] navigate a slideshow generated with swfc
Date: Sat, 8 May 2004 17:03:44 +0200
User-agent: Mutt/1.5.4i

On Wed, Apr 28, 2004 at 03:17:12PM +0200, Matthias Kramm wrote:
> On Tue, Apr 27, 2004 at 11:48:08AM +0200, Markus Schorer wrote:
> > i need to do a slideshow that:
> > ...
> > - let the user navigate to a slide by pressing it's button
> > ...
> > as swfc cannot create buttons yet, _i_ see no way.
> 
> You're right- as long as swfc doesn't support buttons, there's
> no easy way to do this.
> Buttons are on the top of my TODO list, but I haven't got around to
> implement them yet.

Ok, they are implemented now.

So to create navigational buttons for a file called "slides.swf", you would
do something like this:

# buttons.sc
.flash name=buttons.swf

    .box left width=20 height=20 color=blue fill=magenta
    .box left2 width=20 height=20 color=blue fill=red
    .box left3 width=20 height=20 color=blue fill=white
    .box right width=20 height=20 color=blue fill=magenta
    .box right2 width=20 height=20 color=blue fill=red
    .box right3 width=20 height=20 color=blue fill=white

    .swf slides "slides.swf"
    .put slides

    .action:
        setTarget("slides");
        stop();
    .end

    .button leftbutton
        .show left as=idle
        .show left2 as=hover
        .show left3 as=pressed
        .on_press:
            setTarget("slides");
            prevFrame();
        .end
    .end

    .button rightbutton
        .show right as=idle
        .show right2 as=hover
        .show right3 as=pressed
        .on_press:
            setTarget("slides");
            nextFrame();
        .end
    .end

    .put leftbutton x=100 y=100
    .put rightbutton x=200 y=100

.end

The "buttons" are simple boxes in this example, you will probably want
to replace them with something more appropriate like 
    .jpeg left filename="myleftbutton.jpg"
.
Beware, though, that if you use .swf for the definition, as in
    .swf left filename="myleftbutton.jpg"
the button will lose it's "hit" area, because the tag generated
by .swf is a DEFINESPRITE, which hasn't a bounding box, so in this
case you will need to specify the hit area explicitly:
    .show mybox as=area
.

Greetings

Matthias






reply via email to

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