Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: FLASH: awesome praystation text effect - any clues?
From: Matt Perkins
Date: Fri, 28 Apr 2000 22:32:23 +0100

since i was going by praystation's i copied his way mostly ...
have a mc mse that gave me the mouse coords. the text and this code is in a
mc that i put on the stage. on the stage i have a box that defines the area
around it. this and the columnumber let it support multicolumns. it's
basically cheching each item, but it uses a loop so it's more compact.

Comment: Variables [Some Unnessesary res for furute impovement]
Set Variable: "startnum" = 1
Set Variable: "endnum" = 19
Set Variable: "numberofitems" = 19
Set Variable: "spacebetween" = 5
Set Variable: "columnnumber" = 1
Set Variable: "minscale" = 50
Set Variable: "maxscale" = 150
Set Variable: "scalestep" = 2
Set Variable: "minalpha" = 40
Set Variable: "qscaletext" = 1
Comment: Init stuff: do on first run only!
If (myinit = 0)
Comment: Make array of text y's
Set Variable: "i" = startnum
Loop While (i <= endnum)
Set Variable: "texty" & i = GetProperty ("text" & i, _y)
Set Variable: "i" = i+1
End Loop
Comment: Scale all of the text down
Set Variable: "i" = startnum
If (qscaletext)
Loop While (i <= endnum)
Set Property ("text" & i, X Scale) = minscale
Set Property ("text" & i, Y Scale) = minscale
Set Property ("text" & i, Alpha) = minalpha
Set Variable: "i" = i + 1
End Loop
End If
End If
Set Variable: "myinit" = 1
Comment: Get bounding box nfo
Set Variable: "boundleft" = GetProperty ("../boundbox" & columnnumber, _x)
Set Variable: "boundright" = (GetProperty ("../boundbox" & columnnumber
,_width)) + boundleft
Set Variable: "boundtop" = GetProperty ("../boundbox" & columnnumber , _y)
Set Variable: "boundbottom" = (GetProperty ("../boundbox" & columnnumber ,
_height)) + boundtop
Set Variable: "boundheight" = GetProperty ("../boundbox" & columnnumber ,
_height)
Comment: Here we go!
Set Variable: "mouseposx" = GetProperty ("../dragger", _x)
Set Variable: "mouseposy" = GetProperty ("../dragger", _y)
If (mouseposx >= boundleft AND mouseposx <= boundright AND mouseposy >=
boundtop AND mouseposy <= boundbottom)
Set Variable: "i" = startnum
Loop While (i <= endnum)
Set Variable: "mouseat" = mouseposy - boundtop
Set Variable: "c_texty" = EVAL("texty"&i)
Set Variable: "percentloc" = 1/ ((c_texty - mouseat) /
(boundheight*7))
If (percentloc < 0)
Set Variable: "percentloc" = percentloc * -1
End If
If (percentloc < minscale)
Set Variable: "percentloc" = minscale
End If
If (percentloc > maxscale)
Set Variable: "percentloc" = maxscale
End If
Set Variable: "scaleamount" = percentloc
Set Variable: "alphaamount" = percentloc - 25
If (alphaamount < minalpha)
Set Variable: "alphaamount" = minalpha
End If
Set Property ("text" & i, X Scale) = scaleamount
Set Property ("text" & i, Y Scale) = scaleamount
Set Property ("text" & i, Alpha) = alphaamount
Set Variable: "i" = i + 1
End Loop
Else
Set Variable: "i" = startnum
Loop While (i <= endnum)
Set Variable: "currentscale" = GetProperty ( "text"&i, _xscale )
Set Variable: "currentalpha" = GetProperty ( "text"&i, _alpha )
Set Variable: "scaleamount" = currentscale - scalestep
Set Variable: "alphaamount" = currentalpha - scalestep
If (scaleamount < minscale)
Set Variable: "scaleamount" = minscale
End If
If (alphaamount < minalpha)
Set Variable: "alphaamount" = minalpha
End If
Set Property ("text" & i, X Scale) = scaleamount
Set Property ("text" & i, Y Scale) = scaleamount
Set Property ("text" & i, Alpha) = alphaamount
Set Variable: "i" = i + 1
End Loop
End If

> ::: Matt Perkins
> sol_6 ::: http://hfaze.ice.org
hfazeatvnet [dot] net
icq: 2690753

-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Michael
Dunn
Sent: Friday, April 28, 2000 4:06 PM
To: flasheratchinwag [dot] com
Subject: Re: FLASH: awesome praystation text effect - any clues?


Apparently very badly. I set it up where the mc "drag" gets the x,y coords.
This is set as "b" the item's location is set as "a1" by comparing these two
with a lot of variables, I got all the values I needed to tell how big to
make it and how to set the transparency. This is a very hack way of doing
things, and wouldn't work with an array (it ran TOO slow). The way it is now
I have to hard code for each instance (changing a1 to a2 to a3 etc so the
code is eleven times long as what you see below.

I have to admit though, I was a little sad to see this picked up by others
so quickly. I was disillusioned into thinking it was unique to my site (I
set it up at the beginning of March). Oh, well. Only goes to show that
there's nothing new under the sun. (Yes, I know this effect has been done
before, but at least I thought it was unique to the Flash world). How long
before this becomes as overused as the sliding menu?

Anyway, I'm interested in fixing my lame code below to be much tighter and
effective than it currently is. The one at Praystation looks to be pretty
clean.


Set Variable: "x" = GetProperty ( "_level3/drag", _x )
If (x > 270 and x < 385)
Set Variable: "a1" = GetProperty ("/item1", _y )
Set Variable: "b" = GetProperty ( "_level3/drag", _y )
Set Variable: "c1" = int(a1-b)
If (c1<1)
Set Variable: "c1" = c1*-1
End If
If (c1>150)
Set Variable: "c1" = 150
End If
Set Variable: "d1" = 150-c1
If (d1<1)
Set Variable: "d1" = 1
End If
Set Variable: "e1" = d1*(d1/80)
If (e1<100)
Set Variable: "e1" = 100
End If
Set Property ("/item1", Y Scale) = e1
Set Property ("/item1", X Scale) = e1
If (c1<8)
Set Variable: "f1" = 100
Else
Set Variable: "f1" = 80-int(c1*.5)
End If
If (f1<50)
Set Variable: "f1" = 50
End If
Set Property ("/item1", Alpha) = f1
Else

Set Property ("/item1", Y Scale) = 100
Set Property ("/item1", X Scale) = 100
Set Property ("/item1", Alpha) = 50
End If


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml

Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml

Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: awesome praystation text effe, Michael Dunn

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]