[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] a question on Mouse.addListener
From: |
Pablo Rodríguez |
Subject: |
Re: [Swftools-common] a question on Mouse.addListener |
Date: |
Sun, 22 Nov 2009 12:40:47 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Thanks for your reply.
Chris Pugh wrote:
> Pablo,
>
> Does this example help?
>
> [...]
It helped me to understand that the button area could be set negative.
I'm afraid that it didn't work, since setting the button area messed the
drawing. I don't know how the drawing model should work, but it doesn't
work fine for me
Without negative setting bounding box values are "720.00 x 540.00 :0.00
:0.00" (what it should be) and with negative settings bounding box
values become "869.90 x 689.90 :-149.90 :-149.90" (I set fs_area to
x=-150 y=-150). (I would love to provide code and swf from both, but I'm
afraid that the FTP service from my hosting provider isn't behaving
properly :-( [so bellow you have the code from the wrong code.)
A better way to avoid that was to use fs_area itself and not the
outlines as the button, so I don't have issues with the other buttons.
(I have updated it before, so it can be found at
http://www.ousia.tk/freeculture.php.)
Using fs_area itself as button has one main advantage, that I don't have
to recalculate the x y negative values in the area if the presentation
size is different.
Many thanks for your help,
Pablo
.flash filename="loader1.swf" version=7 fps=12
.font roman "/usr/share/fonts/truetype/FreeSansBold.ttf" glyphs="
%()KB0123456789/:,.PDuk[]resntiocanbld!"
.edittext newloader font=roman color=#ffff00 size=30% width=300
height=30 border=none align="center" noselect variable=load_text
.box fs_area fill=#ffffff width=720 height=540
.outline fscreen_outline: M 62.78125 18.703125 L 43.367188 23.734375 L
38.390625 43.09375 L 42.109375 39.375 L 48.671875 45.9375 L 65.625
29.039062 L 59.0625 22.421875 L 62.78125 18.703125 z M 199.71875
18.703125 L 203.4375 22.421875 L 196.875 29.039062 L 213.773438 45.9375
L 220.390625 39.375 L 224.109375 43.09375 L 219.132812 23.734375 L
199.71875 18.703125 z M 83.125 45.9375 C 73.429688 45.9375 65.625
53.742188 65.625 63.4375 L 65.625 133.4375 C 65.625 143.132812 73.429688
150.9375 83.125 150.9375 L 179.375 150.9375 C 189.070312 150.9375
196.875 143.132812 196.875 133.4375 L 196.875 63.4375 C 196.875
53.742188 189.070312 45.9375 179.375 45.9375 L 83.125 45.9375 z M
48.726562 150.9375 L 42.109375 157.5 L 38.390625 153.78125 L 43.367188
173.140625 L 62.78125 178.171875 L 59.0625 174.453125 L 65.625
167.835938 L 48.726562 150.9375 z M 213.773438 150.9375 L 196.875
167.835938 L 203.4375 174.453125 L 199.71875 178.171875 L 219.132812
173.140625 L 224.109375 153.78125 L 220.390625 157.5 L 213.773438
150.9375 z .end
.outline fulls_outline: M 17.5 0 L 245 0 C 254.695312 0 262.5 7.804688
262.5 17.5 L 262.5 179.375 C 262.5 189.070312 254.695312 196.875 245
196.875 L 17.5 196.875 C 7.804688 196.875 0 189.070312 0 179.375 L 0
17.5 C 0 7.804688 7.804688 0 17.5 0 z .end
.filled fscreen outline=fscreen_outline fill=#969696ff color=#969696ff
.filled fulls outline=fulls_outline fill=#64646496 color=#64646496
.button fscr_button
.show fscreen as=idle
.show fscreen as=area
.show fscreen as=hover
.show fscreen as=pressed
.end
.button fs_button
.show fulls as=idle
.show fs_area as=area x=-150 y=-150
.show fulls as=hover
.show fulls as=pressed
.on_release:
fscr_button._visible = 0;
fs_button._visible = 0;
Stage["displayState"] = "fullScreen";
_root.load_text = "[Double click to start]";
.end
.end
.sprite fullscreen_button
.put fscr_button
.put fs_button
.end
.swf first_slide "orphanworks-first.swf"
.frame 1
.put first_slide
.stop first_slide
.put newloader
.stop newloader
.put fullscreen_button
.stop fullscreen_button
.action:
slide_height=Stage.height;
slide_width=Stage.width;
counter_percent=(slide_width/800)*100;
newloader._xscale=counter_percent;
newloader._yscale=counter_percent;
newloader._x = (slide_width-(newloader._width))/2;
newloader._y = (slide_height-newloader._height)/2;
fullscreen_button._x = (slide_width-(fullscreen_button._width))/2;
fullscreen_button._y = (slide_height-fullscreen_button._height)/2;
.end
.end
> In the example you gave, the area is being measured from the top left
> of the button.
> Remember that you have pushed both your buttons to mid-screen.
>
> HTH.
>
> Regards,
>
>
> Chris