Pt4 - ... continued ...
- Select the ActionScript line 'End On' and click the plus (+) button from the Actions tab and select 'Drag Movie Clip.'
- This time you will select the 'Stop drag operation' radio button. This stops the drag operation when you release the mouse.
- We now want to check to see where the block was dropped. To do this we will compare the 'drop target' property of our dragged block to the correct value. This is done through an 'If' ActionScript. Click the plus (+) button from the Actions tab and select 'If.' Set the condition of the 'If' statement as follows:
GetProperty ( "/circle_out", _droptarget ) eq "/circle_in"
If the statement above is true, then the actions inside the 'If' statement (which is between the opening 'If()' command and the closing 'End If') will be executed. We checked to see if the dragged block was over the right slot on the box by comparing the drop target of the dragged block to the name of the correct placed block. So if the statement is true, we want to make the block 'snap' into place.
- First set the Alpha transparency of the correct placed block to 100% by using the 'Set Property' action:
Set Property ("/circle_in", Alpha) = 100
- Then make the dragged block invisible by using the 'Set Property' action:
Set Property ("/circle_out", Visibility) = False
|» Level Intermediate|
Rating: 7 Votes: 48
|Information Architect - Multimedia Designer - Creative Guy|
|Download the files used in this tutorial.|
|Download (693 kb)|
|More help? Search our boards for quick answers!|