
269
The function works with relative URLs.
To see an example of
getNetText()
used in a completed movie, see the Forms and Post movie in
the Learning/Lingo Examples folder inside the Director application folder.
Examples
This script retrieves text from the URL http://BigServer.com/sample.txt and updates the field cast
member the mouse pointer is on when the mouse button is clicked:
property spriteNum
property theNetID
on mouseUp me
theNetID = getNetText ("http://BigServer.com/sample.txt")
end
on exitFrame me
if netDone(theNetID) then
sprite(spriteNum).member.text = netTextResult(theNetID)
end if
end
This example retrieves the results of a CGI query:
getNetText("http://www.yourserver.com/cgi-bin/query.cgi?name=Bill")
This is the same as the previous example, but it uses a property list to submit a CGI query, and
does the URL encoding for you:
getNetText("http://www.yourserver.com/cgi-bin/query.cgi", [#name:"Bill"])
See also
netDone()
,
netError()
,
netTextResult()
getNormalized
Syntax
getNormalized(
vector
)
vector
.getNormalized()
Description
3D vector method; copies the vector and divides the x, y, and z components of the copy by the
length of the original vector. The resulting vector has a length of 1 world unit.
This method returns the copy and leaves the original vector unchanged. To normalize the original
vector, use the
normalize
command.
Example
The following statement stores the normalized value of the vector MyVec in the variable Norm.
The value of Norm is vector( -0.1199, 0.9928, 0.0000 ) and the magnitude of Norm is 1.
MyVec = vector(-209.9019, 1737.5126, 0.0000)
Norm = MyVec.getNormalized()
put Norm
-- vector( -0.1199, 0.9928, 0.0000 )
put Norm.magnitude
-- 1.0000
See also
normalize
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...