# Help!

**URL:** <https://forum.kirupa.com/t/help/2929>\
**Category:** Uncategorized\
**Created:** [March 2, 2002, 8:33am UTC](https://forum.kirupa.com/t/help/2929 "2002-03-02T08:33:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 8:33am UTC](https://forum.kirupa.com/t/help/2929/1 "2002-03-02T08:33:37Z")

</div>

ok…can someone help me with this?\r\rI have a e.g. hammer as a mouse right? And when I click with a mouse…hammer slams into monitor with a sound as an effect 🙂 \rSo…how do i do this…when I click on a window, the hole is visible and when I click somewhere else like on a background…nothing happens. Get it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 10:31am UTC](https://forum.kirupa.com/t/help/2929/2 "2002-03-02T10:31:49Z")

</div>

Not so easy to do, my dear Luksy. Let’s solve problems one by one.\rThe hammering thing is not so difficult to achieve : I’d put in the “hammer” clip an invisible button that would tell when pressed, and a clip of the hammer under it, that would check whether the button has been pressed or not, and play accordingly.\rConcerning the sound, I’m sure you can find whatever you want at htt://www.flashkit.com\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 12:07pm UTC](https://forum.kirupa.com/t/help/2929/3 "2002-03-02T12:07:07Z")

</div>

I’ve done something basic about that on my site. You can check it here : [www.multimania.com/ilyasl…ammer.html](http://www.multimania.com/ilyaslamasse/hammer.html)\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 7:31pm UTC](https://forum.kirupa.com/t/help/2929/4 "2002-03-02T19:31:38Z")

</div>

yeah! that’s easy but when i click on a WINDOW a hole appears! how do i do that?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 7:49pm UTC](https://forum.kirupa.com/t/help/2929/5 "2002-03-02T19:49:47Z")

</div>

OK, I somehow screwed up in my example. The browser is supposed to shake on press… Dammit !\r\rpom 0] \rConcerning your hole thing, just attach a movie on press. I’m making an example, wait a sec, he he he.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 2, 2002, 8:03pm UTC](https://forum.kirupa.com/t/help/2929/6 "2002-03-02T20:03:39Z")

</div>

Arghhh!! I can’t upload !!\rAnyway that’s what you have to do : make your hole movie clip. In your library, right click the hole, choose “Linkage”, and export it under the name “hole”. Then put an empty movie clip on your scene, and add this code :

```auto
 onClipEvent (load) {\r\r&nbsp &nbsp &nbsp &nbsp i = 0 ;\r\r&nbsp &nbsp &nbsp &nbsp function trinity () {\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp i++;\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp attachMovie("agent", "t"+i, i);\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp var mc = this["t"+i];\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp mc._x = _xmouse;\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp mc._y = _ymouse;\r\r&nbsp &nbsp &nbsp &nbsp }\r\r}\r\ronClipEvent (mouseDown) {\r\r&nbsp &nbsp &nbsp &nbsp pressing = 1;\r\r}\r\ronClipEvent (mouseUp) {\r\r&nbsp &nbsp &nbsp &nbsp pressing = 0;\r\r}\r\ronClipEvent (enterFrame) {\r\r&nbsp &nbsp &nbsp &nbsp if (pressing) {\r\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp trinity();\r\r&nbsp &nbsp &nbsp &nbsp }\r\r}

```

About that window, just put a if test here and there in the mouseDown handler.\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 7:07pm UTC](https://forum.kirupa.com/t/help/2929/7 "2002-03-03T19:07:23Z")

</div>

yeah thanx Pom! you’re the best! just one thing!!\rthe movie attaches on the screen, yes. The thing is that it attaches everywhere…now i want it to attach ONLY on window. (only on a particular MC)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 8:24pm UTC](https://forum.kirupa.com/t/help/2929/8 "2002-03-03T20:24:54Z")

</div>

He’s the one who showed me how attachMovie worked… But I did that code myself (feel the pride in the voice ? 😃 )\rJust change the code a little bit :

```auto
 onClipEvent (mouseDown) {\r\r if (_root._xmouse < 350 and _root._xmouse > 50) {\r\r if (_root._ymouse < 300 and _root._ymouse > 100) {\r\r pressing = 1;\r\r }\r\r }\r\r}

```

Or if your window is a clip, you can use hitTest (). Tell me how this works.\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 9:19pm UTC](https://forum.kirupa.com/t/help/2929/9 "2002-03-03T21:19:42Z")

</div>

sorry…but i think that this has no sense…what does this code have to do with this what i want?\r\rI mean…if i paste this code into the window clip actions then nothing happens and if i change the code in hole clip (in the place where onClipEvent (mouseDown) is) error shows up!\r\rBut in this code isn’t any information that hole SHOULD appear on window and that the hole SHOULDN’T appear on white background…get it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 9:21pm UTC](https://forum.kirupa.com/t/help/2929/10 "2002-03-03T21:21:14Z")

</div>

sorry…but i think that this has no sense…what does this code have to do with this what i want?\r\rI mean…if i paste this code into the window clip actions then nothing happens and if i change the code in hole clip (in the place where onClipEvent (mouseDown) is) error shows up!\r\rBut in this code isn’t any information that hole SHOULD appear on window and that the hole SHOULDN’T appear on white background…get it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 9:34pm UTC](https://forum.kirupa.com/t/help/2929/11 "2002-03-03T21:34:29Z")

</div>

OK… 😃 That was an example. I guess errors occur because of the “and”. Make that “&&” and the errors should go.\rNext thing, it has nothing to do with a window whatsoever because that code tells Flash to attach movies only if the mouse is located within a certain area (that 350, 150… figures). I’ll try and make an example with collision detection, wait a minute.\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 9:52pm UTC](https://forum.kirupa.com/t/help/2929/12 "2002-03-03T21:52:14Z")

</div>

Working. Put that code to the window movie clip

```auto
  onClipEvent (enterFrame) {\r\r if (this.hitTest (_root._xmouse,_root._ymouse,true)) {\r\r _root.overlord = 1 ;\r\r } else {\r\r _root.overlord = 0 ;\r\r }\r\r}

```

All you need to do then is to change a little bit of the code in the empty movie clip

```auto
  onClipEvent (enterFrame) {\r\r if (pressing && _root.overlord) {\r\r trinity();\r\r }\r\r}

```

Happy now ??\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2002, 9:53pm UTC](https://forum.kirupa.com/t/help/2929/13 "2002-03-03T21:53:34Z")

</div>

Example here :

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 11:34am UTC](https://forum.kirupa.com/t/help/2929/14 "2002-03-04T11:34:48Z")

</div>

thanks to you…my work will be on top 50 in NG!\r(don’t worry, i have put a credit for ya too!)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 11:59am UTC](https://forum.kirupa.com/t/help/2929/15 "2002-03-04T11:59:13Z")

</div>

i know this is not hard! but i just can’t do it!\r\rok…i have a movie clip (hammer). Now. When i drag (hammer) and drop it on other movie clip, i want that movie clip to start playing. \r\rget it? this is the one last thing i need (i think)!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 12:18pm UTC](https://forum.kirupa.com/t/help/2929/16 "2002-03-04T12:18:19Z")

</div>

Change the code a tiny bit :

```auto
 onClipEvent (enterFrame) {\r\r if (pressing && _root.overlord) {\r\r trinity();\r\r _root.window.play () ;\r\r }\r\r}

```

Can you show us the final effect when it’s online ?\r\rGood luck.\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 1:51pm UTC](https://forum.kirupa.com/t/help/2929/17 "2002-03-04T13:51:51Z")

</div>

sure why not! and you mean the final game?\r\rheck i’ll even give you the darn source code if you want!\rand i forgot to ask…can i acctually put your credit on the game with the name “Pom”?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 2:28pm UTC](https://forum.kirupa.com/t/help/2929/18 "2002-03-04T14:28:30Z")

</div>

one more THING not QUESTION 🙂 \r\rcan you give me the source code of a rubber? you know…when you pull a rubber and then…oh you know!\r

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 3:36pm UTC](https://forum.kirupa.com/t/help/2929/19 "2002-03-04T15:36:22Z")

</div>

the thing with drag ‘n drop MC on other MC and then the other MC starts to play. It doesn’t work!\r\rlet’s start from beginning!\r\rI have a MC on the stage called “girl” which you can drag around the stage. The other MC is called “boy” and the poor little fella’ can’t be dragged! But when i drag and drop the MC called “girl” on “boy”, the MC “boy” starts to play and the girl dissapears.\r\rthat’s REALLY REALLY one last thing!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2002, 8:04pm UTC](https://forum.kirupa.com/t/help/2929/20 "2002-03-04T20:04:16Z")

</div>

In the girl movie clip :

```auto
 onClipEvent (enterFrame) {\r\r if (this.hitTest (_root.boy) {\r\r this.visible = 0 ;\r\r _root.boy.play () ;\r\r }\r\r}

```

should work. I didn’t try it, post back if it doesn’t work.\r\rpom 0]

[Next page](https://forum.kirupa.com/t/help/2929.md?page=2)
