Detailed HitTest
Hello
I was wondering if theres a way to do a detailed hittest..
Say i have a movie clip which is not Square, or has a bunch of dots in it , and i really wanna check if its overlapping , and not just the movie clip box thingy overlapping.. (having each segment of the big movieclip separate and testing for each one is out of the question)
How would i do that?
Thanks //VoS
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 01-27-2005, 12:27 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Detailed HitTest
Hello
I was wondering if theres a way to do a detailed hittest..
Say i have a movie clip which is not Square, or has a bunch of dots in it , and i really wanna check if its overlapping , and not just the movie clip box thingy overlapping..
(having each segment of the big movieclip separate and testing for each one is out of the question)
How would i do that?
Thanks
//VoS
Walking A Character.. Detailed Walking.. Very Detailed.. Lol.. Help?
ok, a great question.. i can get a character to move.. i.e. onKeyDown Left move Moviename _x-5 or whatevar aite.. ok, now how can i make that to where it changes the movie too?
Say on keypress right the character turns right, and then walks.. but if the person releases the key then the character stops walking but stays facing right? or up, and down, ect.. Thanxz for any help guys!
P.S. Just like on http://www.goldyard.net
Those exact commands.. Thanxz again guy's!!!!!
-c.k.
Need Detailed Help
I am very new to Flash and have downloaded the Flash MX 2004 Pro version to play with before I decide to buy. I am building a site for my friend's softball team. On the intro page I want a Flash movie of animated flames and a softball coming at the user out of the flames. Once the softball has stopped, then the user can click on it and be taken to the index page. Going through the book ("Sams Teach Yourself Macromedia Flash MX 2004 in 24 Hours"), I cannot seem to figure out how to accomplish this. I have an animated fire.gif and a softball image. Can someone walk me through getting this accomplished? You will have to be very explicit with what needs to be done and in what sequence. Any help would be greatly appreciated. Thanks.
Navigation For Detailed Map
HI all
Ive been looking for something like this
http://www.suzuki.dk/module_pages/mo...C-95A1A7D607A7
A way to see a detailed map
Can somebody help where to find a Tutorial / fla
Have a nice day
:-)
More Detailed Hit Test?
I am trying to modify a simple sketchpad application, to make drawn objects draggable. Each object is drawn using the drawing API on a separate movie clip.
For reasons that are not clear to me, each empty movie clip seems to be the entire size of the stage. So if I use hitTest(_xmouse, _ymouse, true), I get an hit no matter where the mouse is. On the other hand, using hitTest with "true" flag tests the bounding box, which is also not what I want.
For instance, the diagonal line:
Code:
_root.createEmptyMovieClip("newitem", 100);
...
newitem.moveTo(0,0);
newitem.lineTo(50,50);
is selected for dragging if I click anywhere in the square with opposite corners (0,0) and (50,50). I would like a hitTest that checks whether I'm actually hitting a pixel with something drawn there.
Since each movie clip has only one color, I thought to test the color at the point (_xmouse, _ymouse), and compare it to the clip's color. However, I can't seem to find a function that returns the color at a given point, either on the stage or within a given movie clip.
Does such a function exist?
Or, any suggestions on another way to do a hit-test only for regions with something actually drawn there?
Detailed Drawing
Had a question. I know their are 1,000 tutorials out there about how to make a drawing effect with Flash. My case is a bit different. I have an Illustrator file that has a stoke that look like a tree (used a brush in Illustrator). The stokes overlap in the top of the tree maybe 150 times, so it look like a scribbling effect. When I import the Illustrator file, it seems to create a fill, instead of the stroke. If it was a stroke I could do the old delete each anchor point frame by frame and reverse them. But this doesn't seem to be the case.
We are trying to replicate a sort of flip book animation of a drawing done in Illustrator. Any ideas?
More Detailed Breakdown
so when i publish and request a size report i see a pretty detailed breakdown of geometries and code within movieclips... but i find the summary of AS2 classes way too general and not useful at all:
ActionScript Code:
ActionScript Bytes Location
------------------ --------
54873 ActionScript 2.0 Classes
i have probably 30+ classes being used so i'm getting no valuable info with this lump number. short of compiling separate swfs with smaller numbers of classes, is there any way to get a more detailed report?
thanks in advance
pax
jonah
IF Statement Ignored - More Detailed Question...
I can't seem to find my other post, but here's a more detailed explanation of exactly the problem I'm having:
I have a very simple flash program right now. Let me explain exactly what's going on and then I'll explain my problem.
I have two scenes: preloader and Scene 1.
In Preloader (it's not really a preloader, just loading some information for future use), frame 1, I have the following actionscript:
car = new Array();
car[0] = 0;
car[1] = 0;
trace(car[1]);
That's it for that scene. Scene 1 (the second scene) has Frame 1 as completely empty, and Frame 2 with a button on it, and the actionscript:
stop ();
The button on Frame 2 has the following ActionScript code:
on (release) {
temp = 1;
temprandom = Math.random() * 100;
if (car[temp] == 2) {
if (temprandom < 35) {
car[temp] = 3;
trace (temprandom);
}
}
if (car[temp] == 1) {
if (temprandom < 25) {
car[temp] = 2;
trace (temprandom);
} }
if (car[temp] == 0) {
if (temprandom < 10) {
car[temp] = 1;
trace (temprandom);
} }
trace (car[1]);
trace (car[temp]);
gotoAndPlay(1);
}
Essentially, I'm working with car[1]. I'm totally ignoring car[0]. When car[1] == 0, there's a 10% chance it might become equal to 1. When car[1] == 1, there's a 25% chance it might become equal to 2. When car[1] == 2, there's a 35% chance it might become equal to 3.
Yet everytime I run this program, the value instantly jumps from 0 to 1 to 2 to 3, regardless of whether or not temprandom is less than 10 or not.
I put the trace (temprandom); in just to make sure there's not a mistake... temprandom will be equal to 95, yet car[1] will still increment.
I'm at a complete loss as to what's wrong here. I'm assuming it has to be something to do with arrays and If statements, but can't seem to find a way to make this work.
Eventually I'll be working with multiple copies of car[X], so that's why I'm doing an array and going through with car[temp]... as to run it through a for statement later. But I can't move to that stage if I can't get it to work with just one variable now.
Please, gurus out there, help me before I lose my sanity!
Detailed Vector Importing
I have a problem when trying to import some pretty detailed graphics from Illustrator. It comes in all broken and messed up. I am saving the illustrator file as a 5.0 version because that usually works. Does anyone have any advice?
Much appreciated
Looking For Detailed Book On Animation
I'm looking for a book on animation techniques. I'm not interested cartoon or character animation, nor in video. I'm interested in a dedicated look at the type of animation you typically see, say, on high-tech sites. Typically there are a series of scenes with text animation, animation of elements such as a computer network showing network packets or somesuch flowing one place to another. Or just some illustrations that build one o another. One common example is the splash on the home page of www.pingidentity.com.
The trouble with most books is that they try to be comprehensive. So they might devote only one chapter to tweaning, transitions, etc. I'd like to see something advanced that gives you plenty of techniques -- the benefit of someone's experience in creating product demos and the like.
If there are no books, online tutorials would be OK. Thanks.
[MX] Frame-detailed Control Of A FLV Movie?
First off, let me say that I can't design in flash. Period. The reason that I am posting here is to find out if what I want is even possible. If so, then I'm probably going to contract the work out to a developer.
I have a lot of small video clips (2 to 5 seconds each) that will be linked together. The movies are rendered scenes from a 3d modeling program. I want to be able to have the application play certain 'scenes' from the long movie, and then display a jpg image capture of the last frame of that scene (that I have) and make sure that what is written over it is interactive-capable.
For example, let's say the scene in the movie was "Walking to Grandma's House". When you click a 'Go' button, it plays the first 300 frames (001-300) of the loaded FLV file, then switches to the JPG screencap, as if you stopped walking. Using controls to look down, you see a nickel on the ground, so you pick it up by clicking and dropping it into your items area. You then look up, and press 'Go' again, and it plays another 300 frames (Frame 301-600) of the FLV.
Hope that I made this simple enough. If this is possible, could you recommend any technical details that I will need to advertise that I need for this job, like special scripting skills, etc.? Thanks in advance.
Having An Image Download From An Exe Within A Detailed Action Script
Hi,
I am working on a project that has most of the action script in place with one minor snag. When the user selects an image from a thumbnail from the bottom of the page, the image and text appear, but when you click to download the file, the action doesn't work.
The script in question:
on (press) {
fscommand ("Exec", "b-CIX-100-with-phone_Mar-07.EXE");
}
on (release) {
this._parent.pictureLoader.loadMovie ("BigImages/b-CIX-100-with-phone_Mar-07.png");
this._parent.chsen_movie.chosen.text = "CIX100 with phone — please click here to download image";
_root.loadimage = "JPGs-CIX-100-with-phone_Mar-07.jpg";
trace (_root.loadimage);
}
Any guidance would be helpful.
k.
Scrolling Text From A File... I Need A Clear, Detailed Answer.
Hi. I think my last post got lost in the shuffle, and I had some good help but when I added a new question the help disappeared. Anyway, here's the thing:
I can make a crolling, Dynamic text box. Not a problem. But, since this is for a band website and they want to be able to post news items without ripping the SWF open all the time, I need to load it dynamically. Someone pointed me to the tip on this at macromedia's site, but I couldn't make sense of it and there' no sample file to rip open. Can anyone send me a sample file or just post a really detailed explanation?
Any help is greatly, GREATLY appreciate.
J
3D Object Rotate + Drag Detailed Image (Tutorial?)
Hi,
I want to learn how to create a 360 view of a shoe that you can drag the mouse left and right and the shoe rotates left and right. I would want to use a sequence of photos of the shoe rotating to do this. It's supposed to be easy to do, but I haven't found much of anything online about how to do this.
here is an example: http://www.yofla.com/flash/3d-rotate/examples.php?exampleId=8
The other thing would be dragging a detailed image around in the window.
this is similar, but i want to drag the actual image: http://flashwanted.com/cl/samples/37915/index.html
if you go to this site and click down on a gym shoe image (it'll take a little to navigate there) they have the detail shoe image the way i would like to be able to do it. http://www.adidas.com/campaigns/women/content/stella/
in general does anyone know a good book or video tutorial to learn cool animation effects like this stuff?? even like nike or adidas stuff. most the books out there are really too basic. and i feel like i'm hitting a wall on where to learn this stuff from.
thanks.
best.
andy
The All Time Favourite Error#1010 (detailed Information)
Hi so here is what I'm trying to archive:
It's very simple I'm trying to create a nice imageviewer for my website so that people can take a look at the different details in the images.
For that purpose I have a Movieclip with the Image in it on my stage, a number of buttons and my actionslayer.
Now I want to use Tweener to modify the position of my Movieclip.
Here is the code that resides on the first frame of my actionslayer:
Instancenames:
Arrowup = one of my buttons
Swosh = my movieclip with the image in it
Code:
import caurina.transitions.*;
arrowup.addEventListener (MouseEvent.MOUSE_DOWN , arrowupfun);
function arrowupfun(e: MouseEvent):void
{
Tweener.addTween(swosh, {y:swosh.DisplayObject.y+10,
time:5});
}
Now it is the following part that causes the Problem:
Code:
y:swosh.DisplayObject.y+10,
Whenever I test the Movie with this in there instead of something simple like "x:500," I get the following error when I click the button:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at Imageviewer_fla::MainTimeline/arrowupfun()
So I know that it's that part of the code that causes the system to call for something that is undefined, but since 1010 doesn't really give me a clue on where the heck that stuff is missing I have no Idea where to troubleshoot...
This really annoys me since I wanna finish the site I hope someone here can help me.
If you want further information please say so.
Oh and if anyone is up for some quickhelp via messenger here are my MSN and Skypenames:
MSN: Leonardkoch@hotmail.de
Skype: Goulgag
Thanks in advance looking forward to your answers.
Leonard Koch
Server Crashing 2-3 Times A Week Detailed Backtrace Included
This error keeps crashing the fms server (running under linux fedora core 5):
*** glibc detected *** /usr/local/macromedia/fms/fmscore: double free or corruption (!
prev): 0x09ccbfe8 ***
======= Backtrace: =========
/lib/libc.so.6[0x47a6ba68]
/lib/libc.so.6(__libc_free+0x78)[0x47a6ef6f]
/usr/lib/libstdc++.so.5(_ZdlPv+0x23)[0x742fb3]
/usr/lib/libstdc++.so.5(_ZdaPv+0x1f)[0x74300f]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegmentsD0Ev+0x89)[0x82e6035]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegments8_releaseEv+0x3e5)[0x82e57ed]
/usr/local/macromedia/fms/fmscore(_ZN6TCPoolI10TCSegmentsE4Pool7releaseEPS0_mmm+0x690)[0x82e5e8c]
/usr/local/macromedia/fms/fmscore(_ZN10TCSegments8_releaseEv+0xb3)[0x82e54bb]
/usr/local/macromedia/fms/fmscore(_ZN5TCPtrI10TCSegmentsE7releaseEv+0x1c)[0x813f048]
/usr/local/macromedia/fms/fmscore(_ZN9TCAsyncIO21handleWriteCompletionEP7TCIOReqm+0x12b)[0x8224773]
/usr/local/macromedia/fms/fmscore(_ZN19AsyncRequestHandler3runEv+0x1c4)[0x8227464]
/usr/local/macromedia/fms/fmscore(_ZN12TCThreadPool23__ThreadStaticPoolEntryEPv+0xed)[0x830f945]
/usr/local/macromedia/fms/fmscore(_Z15__TCThreadEntryPv+0x98)[0x8310c20]
/lib/libpthread.so.0[0x47d20433]
/lib/libc.so.6(__clone+0x5e)[0x47ad0a1e]
======= Memory map: ========
If any adobe/fms developer is reading this forum, please consider this as a critical bug.
Thanks,
Dario Andrade
How To Take Time From HitTest True To HitTest False?
hi
i have 2 MCs one is going through the other
and i want to take the time from the beginning
to the end.my code is this:
onClipEvent(load) {
this._visible = 0;
}
onClipEvent(enterFrame) {
first = new Date;
second = new Date;
indicator = 0;
if(!indicator && this.hitTest(_root.rocket)) {
indicator = 1;
sec = erst.getSeconds;
mil = erst.getMilliseconds;
begining = sec add ":" add mil;
}
if(indicator && !this.hitTest(_root.rocket)) {
indicator = 0;
seco = zweit.getSeconds;
mill = zweit.getMilliseconds;
end = seco add ":" add mill;
xposi = getProperty(_root.rocket, _x);
yposi = getProperty(_root.rocket, _y);
position = xposi add yposi;
}
}
further i want to show begining, end and position in 3 different textfields, but nothing works at all !!!
can it be, that it doesn`t work, because "this" is a symbol
in a symbol?!?
thx
bo
Hittest=false, Trying To Do The Opposite Of Hittest.
This question may have such an easy solution it might be worth for the newbies section...
I need an mc to do an action (go to a certain x point) whenever the mouse ISN'T over a particular box. So basically I would need to revert the typical
if (hitTest( _root._xmouse, _root._ymouse));
Anyone knows how to do this?
Thank you soooo much!
HitTest...creating The Opposite Of A HitTest
When I roll over a mc an enter frame triggers a function that is designed to evaluate when the mouse moves off the mc...how do you test for the opposite of a hitTest? I though in an "!", but didn't work.
PHP Code:
var buttonTarget:String = "targetMarkets_mc";
root[buttonTarget].addEventListener(MouseEvent.MOUSE_OVER, overHandler);
function overHandler (event:MouseEvent){
root[buttonTarget].gotoAndStop ("active");
root[buttonTarget].addEventListener(MouseEvent.MOUSE_MOVE, mouseEval);
};
function mouseEval (event:MouseEvent) {
if (!root[buttonTarget].hitTestPoint (mouseX, mouseY, true)) {
root[buttonTarget].gotoAndStop ("inactive");
root[targetMC].removeEventListener (MouseEvent.MOUSE_MOVE, mouseEval);
}
};
Also, how do you remove the event listener? Is there a need?
[hitTest/Mask] Can A Mask Hide A HitTest Area?
Hi, the subject pretty much says it all. I have the following code:
ActionScript Code:
volume.onEnterFrame = function() {
if (volume.hitTest(_xmouse, _ymouse, true)) {
_root.nextFrame();
} else {
_root.prevFrame();
}
};
...and here is the link. Move your mouse under the bar and move it up slowly under the the speaker next to the number. See what happens? Keep in mind that the look is still being perfected, I was just wanting to know if there were a way I could fix the problem or do I just have to start thinking of a new look for it? Thanks in advance.
(PS: let me know what you think of the look and layout please)
HitTest Again
hi, I'm trying to create a game that is similar to moon lander. How do I write the hitTest? I know i will have to use hitTest with the x and y coordinates but there are so many coordinates for the irregular mountain, how should I write it?? I mean it is riddiculous to write down all the coordinates manually right. So anyone knows how to write that part?
HitTest?
Ok, I have a quick question.. I've created my first game in Flash 5 and up till now when I did collision detection in Flash 4 I didn't have the option of "hitTest" so I have a question...
Does hit test check the reqtangular box that holds the movie clip, or does it test the content in the clip?
What I mean is if I have a triangle inside a one movie clip, and a circle in another does it only test to see if the Triangle touches the Circle or does it test to see if the 'outline/box' that holds the movie clips touch?
I've looked around for this answer and can't seem to find it anywhere?
If you'd like to see the game I'm working on you can see it in the games section of my half done site: http://members.aol.com/_ht_a/craigfriebolin/freqfestv2/
Thanks
- Frequent-C
HitTest() SUX
Pardon my french, but hitTest() really sux! Apart from using it for basic collision detection for a shoot out game, its useless when u really require a more precise point of impact.
hitTest() in flash sees every movie clip as a square. Now supposing your movie clip is a triangle. You movie clip only LOOKS like a triangle. It instance is actually a SQUARE!
Imagine! If your space ship is a triangle and a missile is not touching your triangle, but the SQUARE that it belongs to, you're history!
-------------------------
my $0.02 worth
Hittest
I want to use the hittest to detect collision.
When I press the left arrow I want to move my movie clip called "clip1" to left and when it hits "clip2" the movie should go to frame 100.
I know how to move the clip1, but how can I detect when it hits clip2?
Thx for any help
Hittest
anyone no how to impliment Hittest onto a MC?
i have a mc called "block12"
and mc called "playarea"
this is what iv got
onClipEvent(enterFrame){
if (playarea.hitTest("block12)){
trace ("this works");
}
}
dont work, what am i doin wrong?
HitTest
I have a nice hedgehog crossing the road and trying not to be hit by duplicate (" car" + n) random generated cars. I want the hedgehog to be squeshed if hit by a car.
This is the code I have so far but the '_root["car" + n]' bit isn't right
onClipEvent (load) {
if (this.hitTest(_root["car" + n])) {
setProperty ("/you", _yscale, "300");
}
}
anyone help?
Cheers.
HitTest
Hi,
I have two MCs in my movie. I have written code each of the MC in onClipEvent(mouseDown).I am using the hitTest function to test the click event on the MC.The problem is only the event in the second MC gets fired. If I take out the code of the second MC, then the first one gets fired.
The code is something like this
onClipEvent (mouseDown) {
_root.showdetails._visible = false;
if (hitTest(_root._xmouse, _root._ymouse,true)) {
_root.showdetails._visible = true;
_root.showdetails.countryname = "Greenland";
}
}
Please help me.
Thanks
-r-
HitTest ?
Code:
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
_root.fire.gotoAndPlay(2);
if (_root.fire.hitTest(box1)) {
_root.box1.gotoAndStop(2);
}
}
}
I am trying to get box1 to gotoAndStop (2) but it will not go there. Help please.
"fire" and "box1" are instance names. All elements are on the _root.
Hittest? I Don't Think So...
I have 2 MCs name MC1 and MC2 and I want to test if MC1 hits MC2. I did it with the following code:
Code:
if (MC1.hitTest("MC2")) {
do this
}
But the thing is, if the bounding box is hit, hittest returns TRUE. Can't I check if the first MC actually hits the second MC? Like if I have 2 circles, can I have the 2 circles touching and not just their bounding box?
Any help would be greatly appreciated!=)
HitTest
hitTestI have several mc on the stage with varying names.
I want an action to happen, onClipEvent (mouseDown), that checks to see if it is over none of the mc on the stage.
onClipEvent (mouseDown) {
if (?) {
actions
}
}
I know you can insert every name in the if statement, is it possible to apply script that test all without specifying their name.
HitTest.....
Hi,
Im trying to make a simple slideover and slideback effect.
I want to have a movie clip slide over to the right when the mouse is moved over button, and then move back when the mouse is moved off the button. Here is what I have and it not working:
function slideover(clip){
if (_root[this].hitTest(_root._xmouse,_root._ymouse, true)){
_root[clip]._x+=5;
}
}
code on the movieclip button:
onClipEvent(enterFrame){
_root.slideover(ball)
}
ball is the instance name of the movieclip I want to slideover.
the problem is that both the button movieclip and the ball movie clip move to the right.
HitTest Help
Okay, I need a MC to perform a hitTest action with another movie clip inside, a movie clip. the original MC instance is named money. the other MC instance name is try. the MC instance name inside the MC instance try is called "mouth". so this is what I did to perform a hitTest, i used this code in the "money"'s action script.
if (this.hitTest(try.mouth.)) gotoAndPlay ("chew"),well that's basically what i put, it keeps telling me i need a field name or something. i'm pretty sure its the parameters that I'm screwing up on, try.mouth., but if anyone could help me, i'd be very appreciative! Thanks!-Kevin
P.S. if you need anymore details, feel free to email me at kevin@bsanimation.com
HitTest()
is there any way of setting up a hit test to be more specific than just testing the whole movie clip? for example a hit test on a darts board only detecting a hit between a dart Movie clip and its bullseye, all other areas of the dartBoard movie clip do not register hits, Ive tried putting a Movie clip inside a movie clip i.e. a bullsEye Movie clip inside the dartBoard Movie clip and coding something like :
if(hitTest(dartBoard.bullsEye))
{
some code here
}
but this still seems to register a hit for the whole dartBoard
any help on this would be really appreciated as its something that is really bugging me at the moment
Cheers ~Beedge~
Help With HitTest
Is there a way to detect a collision between movie clips without having to target them?
This is what I currently have:
if (this.hitTest( _level0.target)){
do this;
}
but I don't want to target anything specific.. basically just having the clip do something when it collides with anything.
so.. something like this (if it is possible):
if (this.hitTest()){
do this;
}
HitTest Help....=(
Hi guys,
Below is a script which I attached to each individual piece of puzzle for my simply drag n drop puzzle game. Utimately, I would like to snap the puzzle piece to its corresponding location if a player drags it close enough to the proper place and a "click" sound will play to signal the player that "he got it". However, I can't seem to get the hitTest running correctly. Is there something wrong with my x, y coordinates or my logic is totally incorrect? Any hints or help is greatly appreciate.
onClipEvent (mouseDown) {
this.startDrag(true);
if (this.hitTest(180, 140, true) || this.hitTest(165, 125, true)) {
snap.start();
this._x = 175.2;
this._y = 136.8;
}
}
onClipEvent (mouseUp) {
this.stopDrag();
}
HitTest
I've got a movie clip of a ball that is bouncing around the screen using the code below within the clip. I want to make a second instance of the ball and detect collision between the two instances, if a collision is detected then the instances should reverse direction of travel in other words if they collide they bounce of each other. I've racked my brain with this and still get confused/syntax errors! Anyone able to help me?
Code:
onClipEvent (load)
{
dx = 4;// set the initial momemtum of the ball
dy = 4;
}
onClipEvent (enterFrame)
{
_x += dx; //move the ball along dx and dy
_y += dy;
if (_x < 0)
{
_x = 0; //move it back on screen
dx *= -1; //reverse the horizontal momentum
}
else if (_x > 550)
{
_x = 550; //move it back on screen
dx *= -1 //reverse the horizontal momentum
}
if (_y < 0)
{
_y = 0;
dy *= -1;
}
else if (_y > 400)
{
_y = 400;
dy *= -1;
}
}
I tried adding an extra if statement to the end of the code
Code:
if (this.hitTest(ball2))
{
dy *= -1;
dx *= -1;
}
but it didn't work.. I know there should be some other stuf f in there too.. any help greatly appreciated.
HitTest Help
I've made a simple maze game that works fine.
Problem is, when I try to import the .swf into another .swf, my hitTest doesn't seem to work.
Take a look:
http://www.punchpuppet.com/maze/maze.html
works fine, but
http://www.punchpuppet.com/maze/load_maze.html
It's the same game. In load_maze.html, I've simply created an MC, and used loadMovie to import the .swf. I've also resized the game to 75%.
Here's my hitTest code:
if (Key.isDown(Key.LEFT)) {
kids._rotation = 0;
kids._xscale = -100;
kids._x -= 3;
if (this.maze.hitTest(this.kids._x, this.kids._y, true)) {
kids._x += 3;
}
} else if (Key.isDown(Key.RIGHT)) {
kids._rotation = 0;
kids._xscale = 100;
kids._x += 3;
if (this.maze.hitTest(this.kids._x, this.kids._y, true)) {
kids._x -= 3;
}
} else if (Key.isDown(Key.UP)) {
kids._rotation = -90;
kids._y -= 3;
if (this.maze.hitTest(this.kids._x, this.kids._y, true)) {
kids._y += 3;
}
} else if (Key.isDown(Key.DOWN)) {
kids._rotation = 90;
kids._y += 3;
if (this.maze.hitTest(this.kids._x, this.kids._y, true)) {
kids._y -= 3;
}
Any help would be appreciated.
Thanks.
HitTest Help Please
Hi Everyone,
I want to write an hitTest code for the following.
I have 2 Movie clips.
1.myBall1
2.myBall2
What i want it to do is when i drag myBall1 over myBall2 it will stay on top of myBall2 and stop dragging and vica verca.
Thanks In Advance!
Blue Dragon
VERY EZ HITTEST PLEASE HELP
i am trying to build very simple hittest but i am getting stuck. The main thing i am trying to do is give the hitTest every ez actions. what i did was built two Clips, and when the one clip that is attached to the mouse, then hits the other clip= i just gave it _root.clip.gotoAndPlay(1);. but it is not working right i have more then one clip i want to use this for i did in two but it only works in on clip. i am trying to get the same felling as http://www.directiondesign.nl/index.html.
if you want to look at what i have done please feel free http://www.lyfted.com/site/Lyfted_vo.1.swf
i hope this make sense
Thank you.
Ryan
HitTest
I was wondering how I could use HitTest to detect collisions, among the moving movieclip. And any other clips by giving the static clips a certain propertie or sumtin.
I hope I made myself clear... Thanx
Some More Hittest...
If you have a hittest thing like:
movie x.hittest(movie y)
when you have this, how do you get it to check if movie x is touching movie y and then do something, like go to frame 10???
eg. If true, gotoandplay frame 10
or wotever it would look like
Hittest.
okay there is HitTest when ever i want to check if my mouse is over an object.
but is there a test when (or a way) when i can check if my mouse is not on the object??? i mean when it where ever...
out of the flashplayer window... doesn't metter, as long as it not over the object.
i mean i got this if and i want to check if mouse is not over the object then move other object right.
as when ever it is move other object left.
how can i do that???
Help With Hittest
Just wondering if it is possible to stop a hitTest action after one hit, so that the code doesn't repeat and can be used for multiple instances.
say there is four balls and one square. The squre adds 1 to a variable called numbers everytime it hits one of the circles, but the circles can only add one to the variable and must not repeat. Also once a hit has been made it cannot be made again until a reset button has been pressed.
Can anyone help me with this, thanks
Hittest Help...
can somebody tel me what im doing wrong with the follow .fla?
the hittest don't work and the car stops every 1 second...
Hittest Help...
can somebody tel me what im doing wrong with the follow .fla?
the hittest don't work and the car stops every 1 second...
HitTest In MX
Hello Flashers,
I am having a problem with using hitTest in MX.
This is placed on a mc which is in another mc -
if (this.hitTest(_root.xmouse,_root.ymouse, true)){
trace("hit");
}
Not only does it not work but I get the following error:
Symbol=hong kong, Layer=Layer 1, Frame=1: Line 1: You must export your movie as Flash 5 to use this expression.
if (this.hitTest(_root.xmouse,_root.ymouse, true)){
Does that I can only use hitTest with Flash5? This error is very confusing.
Please help!
jayne
Help With .hitTest
Ok, i have a game that im making, it consists of 3 m.c's named ship,bullet,gun. on the main timeling i have:
if (_root.["bullet"].hitTest(_root.["ship"])){
gotoAndStop(2)
}
Now You can control the bullet's x,y with the keys, why wont the hitTest work
Luke
|