Hi,
I’m supposed to create something like this:
- Create 4 coat of arms (Shields)
- Pour colour onto different segments of the shields
- Click and drag objects onto the shield
My problems lies in step 3.
How do I actually [COLOR=darkred]create multiple copies of the same object that I clicked and dragged[/COLOR]? At the same time, I also want the original copy to stay in position so I will only need to click and drag on the original copy to create the duplicates.
I got the code from the net (I’m no pro in this). What I did was, convert the object into a button, then into a movie clip. Double-clicked the movie clip, I inserted the following code on the movie clip:
[COLOR=navy]on(press) {[/COLOR]
[COLOR=navy]duplicate(this)[/COLOR]
[COLOR=navy]}[/COLOR]
Then on the movie clip’s frame, I inserted this:
[COLOR=navy]function duplicate(item) {[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]_global.newone = item.duplicateMovieClip(“myClip” + numberOfClips + “_mc”, numberOfClips);[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]newone.startDrag();[/COLOR]
[COLOR=navy]newone._alpha = 60;[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]newone.onMouseUp = function() {[/COLOR]
[COLOR=navy]newone._alpha = 100;[/COLOR]
[COLOR=navy]this.stopDrag();[/COLOR]
[COLOR=navy]this.onMouseUp = null;[/COLOR]
[COLOR=navy]}[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]newone.onPress = function() {[/COLOR]
[COLOR=navy]_root.current_item = this;[/COLOR]
[COLOR=navy]this.startDrag();[/COLOR]
[COLOR=navy]}[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]newone.onRelease = function() {[/COLOR]
[COLOR=navy]this.stopDrag();[/COLOR]
[COLOR=navy]}[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]numberOfClips++;[/COLOR]
[COLOR=navy][/COLOR]
[COLOR=navy]}[/COLOR]
This works BUT when I tried to click and drag other objects, the previous object dragged onto the shield goes missing. Some objects though, stayed. The end product is a bit messy.
btw, I don’t really understand the above code. Is there any way to modify the code or create any other new code for this to work?
Help me…please…