Customizing the mouse behaviour and active areaThe 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. 1. Select the 3DPlane component in the 'scroller3d.fla' movie and uncheck the 'Allow mouse control' checkbox. This will allow you to control this yourself. 2. Edit the 'mc2' MovieClip (double click on its icon in the library to edit it). 3. Create a make a button in the 'mc2' 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.
4. Select the button that you just created and add either of the following ActionScript codes to it: a. This code reacts on mouse rollOver: on (rollOver) { b. This code reacts on mouse press and is more suited to most cases: on (press) { 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: on (press) { 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 'mc2': button1.useHandCursor = false;
|