| 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). |