📄 advanced3.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;
}
.style5 {
color: #009933;
font-size: 12px;
}
.style7 {font-size: 12px}
.style8 {color: #009933}
-->
</style>
</head>
<body>
<table width="95%" border="0">
<tr>
<td><h2 class="style2 style3"><span style='font-family:Verdana'>Customizing the mouse behaviour and active area </span></h2>
<p class="style7"><span style="font-family: Verdana">The 3DPlane creates a rectangular area around the 3D object for mouse control. You may wish to create your own mouse sensitive area (for example, in shape of a butterfly), so that mouse clicks do not register in transparent areas. You may also want to change the mouse behaviour, for example, you can rotate the object on mouse move instead of on mouse drag.</span></p>
<p class="style7"><span style="font-family: Verdana">1. Select the <span class="style1">3DPlane</span> component in the <span class="style1">'scroller3d.fla'</span> movie and uncheck the <span class="style1">'Allow mouse control'</span> checkbox. This will allow you to control this yourself. </span></p>
<p class="style7"><span style="font-family: Verdana">2. Edit the <span class="style1"> 'mc2'</span> MovieClip (double click on its icon in the library to edit it).</span></p>
<p class="style7"><span style="font-family: Verdana">3. Create a make a button in the <span class="style1">'mc2</span>' MovieClip. In this example, we'll make the button the exact size of the loaded object (342x220) and center it on the stage. You may also choose to make the button transparent.</span></p>
<p class="style7"><span style="font-family: Verdana"><img src="images/image31.gif" width="376" height="285"></span></p>
<p class="style7"><span style="font-family: Verdana">4. Select the button that you just created and add either of the following ActionScript codes to it:</span></p>
<p class="style2"><strong>a. This code reacts on mouse rollOver:</strong></p>
<p class="style7"><font face="Lucida Console"><span class="style8">on (rollOver) {<br>
rootObject.activeMouse = true;<br>
}<br>
on (rollOut) {<br>
rootObject.activeMouse = false;<br>
}<br>
//rootObject - link to the root 3DPlane instance.<br>
//activeMouse - public parameter of the 3DPlane, indicates when the 3DPlane rotates with the mouse.</span><br>
</font></p>
<p class="style2"><strong>b. This code reacts on mouse press and is more suited to most cases: </strong></p>
<p class="style5"><font face="Lucida Console">on (press) {<br>
rootObject.activeMouse = true;<br>
}<br>
on (release, releaseOutside) {<br>
rootObject.activeMouse = false;<br>
}</font></p>
<p class="style7"><span style="font-family: Verdana"> <br>
5. Test the movie again. You should notice that the scroll buttons now work correctly and that there is no conflict with the 3D rotation.</span></p>
<p class="style7"><span style='font-family:Verdana'>6. You may want to add additional 3D rotation actions. For example, you can highlight the object on mouse press by adding the following code:</span></p>
<p class="style5"><font face="Lucida Console">on (press) {<br>
rootObject.activeMouse = true;<br>
new Color(this).setTransform({ra:150,ga:150,ba:150});<br>
}<br>
on (release, releaseOutside) {<br>
rootObject.activeMouse = false;<br>
new Color(this).setTransform({ra:100,ga:100,ba:100});<br>
}</font></p>
<p class="style7"><span style="font-family: Verdana"> 7. Finally, if you prefer to remove the hand cursor which appears over the button, give the button an instance name, for example 'button1' and add the following ActionScript to the first frame of <span class="style1">'mc2'</span>:</span></p>
<p class="style5"><font face="Lucida Console">button1.useHandCursor = false;</font></p>
<p class="style7"><font face="Lucida Console">
<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="410" height="410">
<param name="movie" value="images/image32.swf">
<param name="quality" value="high">
<embed src="images/image32.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="410" height="410"></embed>
</object>
</font></p>
<p class="style2"> </p></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -