📄 advanced6.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 { color: #003366;
font-weight: bold;
}
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.underline { text-decoration: underline;
}
.style3 {
font-size: 24px;
font-weight: bold;
}
.mainlink { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #000080;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style16 {
color: #009933;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.style10 {font-size: 12px}
.style12 {font-size: 24px}
-->
</style>
</head>
<body>
<table width="95%" border="0">
<tr>
<td><h2 class="style2 style3"><span style=''>Controlling the 3D rotation </span></h2>
<p class="style2"><span style="">This example demonstrates how to use ActionScript and the 3DPlane parameters to create additional interaction (like motion effects, physic effects and so on).</span></p>
<p class="style2"><span style="">1. Continue to work with the <span class="style1">'butterfly.fla'</span> movie. Add the following code to the 3DPlane instance:</span></p>
<p class="style16"> onClipEvent (enterFrame) {<br>
this.rx += -(x0-this.v1.px)/30;<br>
this.ry += (y0-this.v1.py)/30;<br>
this.rz += (z0-this.v2.py)/80;<br>
if (this.rx*this.rx+this.ry*this.ry+this.rz*this.rz<.001) {<br>
this.rx=this.ry=this.rz=0; //disable small oscillations<br>
}<br>
}</p>
<p class="style2"><span style="">2. Add the following code to the existing 'onLoad' event, after the ' swap' function:</span></p>
<p class="style16"> //store the initial position<br>
x0 = this.v1.px;<br>
y0 = this.v1.py;<br>
z0 = this.v2.py;<br>
//push it gently in the beginning<br>
this.rx = this.ry = 5;</p>
<p class="style2"><span style="">This example uses linear approximation in order to avoid complex 3D calculations. This should work well for most situations. You can tune it somewhat by changing the coefficients to '30' or '80' as well as the <span class="style1">3DPlane</span> friction parameter.</span></p>
<p class="style2">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="450" height="450">
<param name="movie" value="images/image61.swf">
<param name="quality" value="high">
<embed src="images/image61.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="450"></embed>
</object>
</p>
<p class="style2 style10"> </p>
<p class="style2"> </p></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -