Flasher Archive

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


Subject: FLASH: greetings!
From: Damien Morton
Date: Wed, 10 Nov 1999 12:13:14 GMT

Hi,

Just heard about this list after months of poring over MM newsgroups trying
to glean information from amongst the endless unanswered questions.

Heres a little gift, my maths library, and a little toy (attached):

just call Init to set everything up
x is the parameter for sqrt() and sin()
result is the result

Note to any MM Flash developers lurking on this list:
Is there any reason why you didnt expose basic maths functions for use by
ActionScripts?
Are numbers really represented as strings internally by Flash? If so, then
please fix this
How about some decent string manipulation functions
How about compound variables for Flash 5, e.g. Lists
How about introspection facilities of some kind

Frame:Init
Set Variable: "a1" = 0.387298334620742
Set Variable: "a2" = 0.5
Set Variable: "a3" = 0.591607978309962
Set Variable: "a4" = 0.670820393249937
Set Variable: "a5" = 0.741619848709566
Set Variable: "a6" = 0.806225774829855
Set Variable: "a7" = 0.866025403784438
Set Variable: "a8" = 0.921954445729288
Set Variable: "a9" = 0.974679434480896
Set Variable: "ex0" = 1
Set Variable: "ex1" = 3.16227766016838
Set Variable: "i" = 2
Loop While (i < 30)
Set Variable: "ex"&i = eval("ex"&(i-2)) * 10
Set Variable: "ex"&(i+1) = eval("ex"&(i-1))*10
Set Variable: "i" = i + 2
End Loop
Stop

Frame:Sqrt
If (x = 1)
Set Variable: "result" = 1
Else If (x = 0)
Set Variable: "result" = 0
Else If (x < 1)
Set Variable: "e" = length(int(1/x))-1
Set Variable: "n" = x * eval("ex"&(e*2))
Set Variable: "a" = eval("a"&substring(n, 3, 1))
Set Variable: "x0" = 0.5 * (a + n/a)
Set Variable: "x2n" = (x0 * x0) + n
Set Variable: "result" = (x2n *x2n + 4 * x0 * x0 * n) / (4 * x0 *
x2n * eval("ex"&e) )
Else
Set Variable: "e" = length(int(x))
Set Variable: "n" = x / eval("ex"&(e*2))
Set Variable: "a" = eval("a"&substring(n, 3, 1))
Set Variable: "x0" = 0.5 * (a + n/a)
Set Variable: "x2n" = (x0 * x0) + n
Set Variable: "result" = eval("ex"&e) * (x2n *x2n + 4 * x0 * x0 * n)
/ (4 * x0 * x2n)
End If

Frame:Sin
If ((x < -6.28318530718) or (x > 6.28318530718))
Set Variable: "x" = x - int(x / 6.28318530718)*6.28318530718
End If
Set Variable: "x2" = x * x
Set Variable: "x4" = x2 * x2
Set Variable: "x6" = x2 * x4
Set Variable: "result" = x * (1 - (0.1425234545069255813 * x2) +
(0.0045855159115865352 * x4) + (0.00004163277313164616 * x6)) / (1 +
(0.024143212159741085361 * x2) + (0.000276051271543382738 * x4) +
(.000001595035873773665 * x6))



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: Loading a Label in a Load Movie A, Jerry Sullivan

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