Help!

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.

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 :

 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]

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)

Heā€™s the one who showed me how attachMovie workedā€¦ But I did that code myself (feel the pride in the voice ? :smiley: )\rJust change the code a little bit :

 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]

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?

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?

OKā€¦ :smiley: 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]

Working. Put that code to the window movie clip

  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

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

Happy now ??\r\rpom 0]

Example here :

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

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

Change the code a tiny bit :

 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]

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ā€?

one more THING not QUESTION :slight_smile: \r\rcan you give me the source code of a rubber? you knowā€¦when you pull a rubber and thenā€¦oh you know!\r

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!

In the girl movie clip :

 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]

i thought that this was over but it isnā€™tā€¦sorry!\r\rRemember my first question? when you press the mouse and the MC attaches? wellā€¦i have many more objects on the stage. The thing is that when i click on a hammer and press on a screen there are holes (because of breaking) and when i press on some other object that i want to use e.g. knife, i want that object to have itā€™s own MCā€™s that are attached to the stageā€¦that means if i choose the hammer as a tool, there will be holes on the screen when i click. And when i use knife as a tool, there is a cutting on the screen when i click. Get it?\r\rEvery MC that is draggable has itā€™s own MC that will be attached when clicked with it. (this is a simple explanation)\r\rThank you!

anyone? please? I PROMISE that this is the last thing i need to complete the game.

this script doesnā€™t work:

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

it sez:
Clipboard Actions: Line 2: ā€˜)ā€™ expected
if (this.hitTest (_root.boy) {

if i do this
if (this.hitTest) (_root.boy) {
then it says ; expected

Itā€™s

  if (this.hitTest (_root.boy))

pom 0]