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?
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]
I’ve done something basic about that on my site. You can check it here : www.multimania.com/ilyasl…ammer.html\r\rpom 0]
yeah! that’s easy but when i click on a WINDOW a hole appears! how do i do that?
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        i = 0 ;\r\r        function trinity () {\r\r                i++;\r\r                attachMovie("agent", "t"+i, i);\r\r                var mc = this["t"+i];\r\r                mc._x = _xmouse;\r\r                mc._y = _ymouse;\r\r        }\r\r}\r\ronClipEvent (mouseDown) {\r\r        pressing = 1;\r\r}\r\ronClipEvent (mouseUp) {\r\r        pressing = 0;\r\r}\r\ronClipEvent (enterFrame) {\r\r        if (pressing) {\r\r                trinity();\r\r        }\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 ? )\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… 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 \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]