Adobe Photoshop Tutorials | Flash Tutorials | 3D Studio Max Tutorials
 
Home Photoshop | Flash | 3D | Tools | Articles | Directory | Links Link to Us | Contact Us
 
- Flash Tutorials - Flash Light Tutorial - By: Chad Freiling
Page 02
Now that you have your Photos, graphics and text where you want them we can create the mask part. Don't worry if you want to change or add Photos, graphics and text in the future to this you can, by just deleting, moving or adding your text and images to the correct layer. The screen shot below is (simular to) what you should have.
Let's lock all the layer so that we don't create something we dont want to in the layer.
Select the 'Light Mask' layer and right click on it, then select 'MASK'. This will make the layer that you have selected mask the layer below it. Next thing is to make the 'images' layer also masked by the 'Light Mask' layer. Select the 'images' layer and drag and drop it so it is above the 'text' layer, This sets the 'images' layer so that it is masked by the 'Light Mask' layer. Again, Drag and drop the 'images' layer so that it is below the 'text' layer. We do this so that any text can still be seen, and is not shown as if it would be under (or blocked by) any images.
Ok. So now we have created the mask layer. But, it still won't work. We need to add the Action Script. Lock all the Layers and Unlock the 'Actions' layer.

Select Frame 1 in the 'Actions' layer. To do this simply select the frame. Now we need to show the Action properties of this frame. Located at the bottom of the stage area, above the Properties is a bar Titled 'Actions'. click on the arrow to expand this window.

Now Under Actions. Click on the Actions tab thingy (seen above right). Then Click on Movie Clip Control then Double click on 'startDrag'. (Actions > Movie Clip Control > startdrag)

It will then place the following code in the Code Window: startDrag();

- Advertisement
When you do this you should notice a small little dialog box (seen above) appear next to the code just place into it. This is a neat thing that macromedia added for Flash users (if you do other codeing i.e. C++, J++ (Java)) you understand what this is. This is called a "Code Hint". It helps the coder do the code correctly. so. Heres what its asking or hinting for you.

What you will see is: startDrag( target, lockcenter, l, t, r, b);

What these mean:

>> target - this is what will be moved, or affected. (In our case, this will be our light. (this is were the instance name comes into play)
>> lockcenter - lockcenter centers the MC or graphic to the mouse with its (the MC or graphic) center. This is done by entering either: true or false.
>> l = left: this is set to the left most of the stage the target can go.
>> t = top: this is set to the top most of the stage the target can go.
>> r = right: this is set to the right most of the stage the target can go.
>> b = bottom: this is set to the bottom most of the stage the target can go
Note: left and top are usually set to 0.

For our movie we will set it to the Size and height of the stage and lockcenter: true. So our code will look like:

startDrag(light, true, 0, 0, 400, 250);

The left and top are set at: 0.
Right is set at 400 (which is the width of our movie's stage).
Bottom is set at 250 (which is the height of our movie's stage).

So we now have the action script set. Are we done?
No, Not yet. two more things to do. But don't worry their easy to do.
Continue on the to the next page...
Pages: 01 | 02 | 03
Advertisement
 
Home Copyright © 2003 - 2005, Tutorials Network. All Rights Reserved. | Advertise | Privacy Policy