📄 advanced7.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;
}
.style13 {
color: #009933;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.style14 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.style15 {font-size: 12px}
.style17 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
}
-->
</style>
</head>
<body>
<table width="95%" border="0">
<tr>
<td><h2 class="style2 style3"><span style=''>Creating multiple planes using the '3DPlane guided' component</span></h2>
<p class="style2 style15"><span style="">The <span class="style1">'3DPlane guided'</span> component is very similar to the <span class="style1">'3D Plane'</span> component except that it does not have its own mouse engine and has the additional <span class="style1">'Guide'</span> parameter. All you need to do is to enter the instance name of any <span class="style1">3DPlane</span> instance into the <span class="style1">'Guide'</span> parameter and the two 3DPlanes will move together as a unit. If you drag and drop the <span class="style1">'3D Plane guided'</span> component on top of the main <span class="style1">3DPlane</span>, it will automatically get the <span class="style1">'Guide'</span> parameter from the instance name of the <span class="style1">3DPlane</span> component. </span></p>
<p class="style14"><span style="">1. Drag the <span class="style1">'3D Plane guided'</span> component from Components Panel and drop it onto the <span class="style1">3DPlane</span> component instance. Repeat this once more so that there are three <span class="style1">3DPlanes</span> on the stage.</span></p>
<p class="style14"><span style="">2. Distribute these three components on the stage so that you have easy access to all of them. Depending on how you position them in relation to one another, they can combine together to form one unit at runtime.</span></p>
<p class="style14"><span style="">3. Give to new <span style=""><span class="style1">'3D Plane guided'</span></span> component instances heights of <span class="style1">100</span> and set the content parameter to <span class="style1">'mc1'</span> (or whatever name you used for the linkage parameter of your target MovieClip). Check that <span style=""><span class="style1">3DPlane</span> instance</span> name is entered in the <span class="style1">'Guide'</span> parameter.</span></p>
<p class="style14"><span style=""><img src="images/image72.jpg" width="718" height="178"></span></p>
<p class="style14"><span style=""><br>
4. Adjust the 3D position for each of the 3 planes by dragging the small preview window that is in the component properties panel:</span></p>
<table width="84%" border="0" align="center">
<tr>
<td width="34%" class="style14"><div align="center"><img src="images/but_left.gif" width="189" height="79"></div></td>
<td width="32%" class="style14"><div align="center"><img src="images/but_center.gif" width="189" height="79"></div></td>
<td width="34%" class="style14"><div align="center"><img src="images/but_right.gif" width="195" height="80"></div></td>
</tr>
<tr>
<td class="style14"><div align="center">Left 'Guide' </div></td>
<td class="style14"><div align="center">Center - 3DPlane </div></td>
<td class="style14"><div align="center">Right 'Guide' </div></td>
</tr>
</table>
<p class="style14"> </p>
<p class="style14"><span style="">5. Now we'll create 'z-sorting'. We will use the following principle: we'll place the <span style="">left guided 3DPlane</span> at a depth of 15 when we are viewing the front of it and a depth of 5 when we are viewing the back of it. Add this ActionScript to the left guided 3DPlane:</span></p>
<p class="style13">onClipEvent (load) {<br>
this.swap = function(front) {<br>
this.swapDepths(10*front+5);<br>
};<br>
}</p>
<p class="style14"><span style="">6. Do the same for right guided 3DPlane, but use depths 16 and 6 respectively:</span></p>
<p class="style13">onClipEvent (load) {<br>
this.swap = function(front) {<br>
this.swapDepths(10*front+6);<br>
};<br>
}</p>
<p class="style14"><span style="">7. Remove the <span class="style1">'swap'</span> function for main 3DPlane and replace it with the following code:</span></p>
<p class="style13"> this.swap = function(front) {<br>
this.swapDepths(10*front+7);<br>
};<br>
this.swapDepths(17);<br>
_parent.sphere.swapDepths(10);</p>
<p class="style14"><br>
The above code uses tells the component to use dept<span style="">hs of 7 and 17 for the main 3DPlane, and to initialize the main 3DPlane component with a depth of 17 and a central sphere to depth 10.</span></p>
<p class="style14"><span style="">You may now test and publish your movie. This example may be a bit slow on older computers, as the Flash Player may struggle to redraw 3 large bitmaps with 2 gradients at 30 fps. Note that there is no performance loss when the objects are not moving.</span></p>
<p class="style14">
<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/image71.swf">
<param name="quality" value="high">
<embed src="images/image71.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="450"></embed>
</object>
</p>
<p class="style14"> </p></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -