Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Mass Hittest?



I finally finished my PacMan game. There is just one problem. It's slow. I think it's because I have this in the first frame of the dots that PacMan eats.if (this.hitTest(this._parent.pacman)) this.unloadMovie();I tried using an onEnterFrame first. That slowed the game down too much (we are talking over 500 pieces of PacMan corn here), so then I tried putting that it in an interval about 100 miliseconds. That sped it up a little, but it still slowed the game noticeable and also I fear that with an interval, it may skip over dots on faster computers. Is there a way I can use a mass hitTest from outside the dot movieclip, or is there a better way to do it?



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 08-05-2008, 03:59 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Mass HitTest And Area HitTests - Problems...
I'm trying to get this hitTest to work correctly... So far it seems to ignore the -25, and +25, and needs a direct hit to register.

I'm trying to figure out how to kill anything within the 25x25 explosion range...

I have two hitests, one counting down, and one counting up. In order to kill two targets if they are there. But I need to figure out a way to kill anything the missile hits...


Code:
for (e=0; e<_root.enemyNumber; e++) {
if (_root["enemy"+e].hitTest(this._x-25, this._y, true) | _root["enemy"+e].hitTest(this._x+25, this._y, true)) {
_root["enemy"+e].life -= 25;
}
}

Efficent Mass HitTests With Mass Weapons.
First question... Does shapeflag-true ONLY use the first frame of a movieclip? I can only get hitTest to work on the exact center coordinates.


Code:
//This code doesn't work, it STILL uses the center point... Trying to get it to detect the enemy ten pixels to the right or left.
if (theClip.hitTest(this._x-10, this._y, true) | theClip.hitTest(this._x+10, this._y, true){
//Do stuff
}

//And this only uses the center of the movieclip too... Shapeflag is true, what gives?
_root.enemy.hitTest(this._x, this._y, true)
I am going to figure out how to get mass explosions to work or die trying...
It isnt fun having to play a game with pinpoint accuracy!

Mass Emailer
Hello,
I know I am probably in the wrong place to ask this question, but maybe someone can help me out or point me in the right direction.

Can anyone tell me how to make a emailer that will send mail to all of the addresses in a list? Or can you tell me where to look.

I would appreciate any information.
Thanks.

Mass Hit Detection
I need to manage hit detection of multiple instances of one clip against multiple instances of other clips.

I know the method of keeping arrays of all the instances currently on screen, then looping to get a true value from hitTest, but it seems like there should be a more efficent way to do it.

Does anyone know of a way to create a sort of class of instances, say "enemie", "obstacle" or "deadlyWeapon" that could be applied to all appropriate instances, then the instances that are affected by them could just loop to see if they are coming in contact with any one of the items in the class and react?

Does that make sense?

Please Help (mass Mail)
Hi, I have attached flash to the mail that I want to send. But
when I sent it, this message came out.

The server reported an error. Account: 'Hotmail', Server: 'http://services.msn.com/svcs/hotmail/httpmail.asp', Protocol: HTTPMail, Server Response: 'Too many recipients', Port: 0, Secure(SSL): No, Error Number: 0x800CCC3C


Can someone explain and advice on how I can solve this problem?
Do know that this mail is going out to thousands of students in
my school but please help me out......

X-mass Music
Hi,

Anybody out there can kindly point me to the right site can download and used for FREE Chirstmas Music. Im designing e-cards and would like to add music to it.

Thanks

Mass Hit Test
I am trying to figure out the best way to do hit test between multiple objects..

So far I have been using a For loop to loop through all the objects and test each one. This works but does not run fast enough, so as soon as I get a 50 - 100 objects the frame rate drops exponentionally.

If anyone has any ideas for more efficient methods I would love to hear them.

Mass Conversion To .exe
Hello,

I know that to convert .swf files to .exe I can just open the SWF, then go to File > Create Projector... and that generates a stand-alone exe file.

However, I need to convert several hundred .swf files to exe. Now I could just open every file and convert it individually, but that would takes hours. So I'm hoping there is a way or software (willing to pay $$) that could speed-up the process.

Help With Mass Testing
Ok, there are two arrays: Theirguys and Yourguys. Yourguys move across the screen, then if they hit Theirguy one of them gets removed ("killed") at random. Does anyone know how I would add a system to make each one of Yourguys move at the closest one of Theirguys?

for(k in Yourguys){
this[Yourguys[k]]._x+=5
for(j in Theirguys){
if (this[Theirguys[j]].hitTest(this[Yourguys[k]])) {
_root.Random=Math.random()
this[Theirguys[j]].gotoAndPlay(2);
if(_root.Random>.5){
this[Theirguys[j]].removeMovieClip();
Theirguys.splice(j, 1);
}else{
this[Yourguys[k]].gotoAndPlay(2);
this[Yourguys[k]].removeMovieClip();
Yourguys.splice(k,1)
}
}
}
}

Best Way To Do A Mass Newsletter?
i client emailed me that they want to add a newsletter feature to there site. Now i do mostly flash so i dont really no how to do this. Should i be looking for a pre-fromated script or a Flash Tut? whats the best way to do this .php, .xml?

Mass Preloader
Hey guys. Pretty much finished with a demo site I've been working on for a photography studio. The site is a massive collection of swf files loaded into the main movie (logo, menu, contact, etc.). Each item is loaded from a separate function i.e. loadLogo or loadMenu etc. Each function creates the container for the movie i.e. logo or menu, places it on the stage and then makes a call to a MCL object with a listener applied to capture the onLoadComplete so I can tween the items in.

What I'd like to do is create a mass preloader script that will load each movie in turn one at a time and show this on the screen i.e.

Loading Assets: Logo

where the word logo would change for each item that is loading at that time and keep the movie from actually showing anything until all the files are loaded. I'm sure it's just a matter of restructuring what I've done above but rather than give myself a headache or extra grief, I thought I might ask everyone here to see what you all thought might be the best approach.

Thanks in advance.

[AS3] Mass Animation
Scenario: You have multiple display objects on screen, and they all need to be moved based on different criteria, which could be unique to the object.

I have tried alot of different methods to figure out the best and most efficient way to do this. In an attempt to try and find the best method, I made 2000 red circle display objects, part of a circle class move across the screen, but made their y movement sinusodial. I want a fresh take on this to try and figure out the best way to do this, I will list what I have tried.

1. Looping through an array using a for loop, and having if statements internal to that for loop.

2. Looping through an array using a for loop executing a method on each circle class. Specifically using Array.forEach().

3. Adding EnterFrame listeners to every circle class and making it execute an internal function.

4. Adding a timer to every circle class and making it execute an internal function.

For speeds this is what I discovered. As far as speed, from fastest to slowest it was.

2, 1, 3, 4.

Using a for loop to execute a method on each class appeared to be the fastest. Followed by just the loop with internal if statements. Using an internal enterFrame listener was next, and finally Timer was the slowest (it was set to the same FPS of the document).

I am interestest in any ideas/comments.

Mass Collision Detection
Hey folks. Need some help. Heres what i got. one object duplicated n times moving around randomly on stage.

I want each instance of the object to bounce off any other ojects it hits using collision detection (hitTest).
How do I do it?
Thanks for your help?

Mass Symbol Swap?
Ok hey.

Say ive got a character animted putting on a helmet. Ok, now I have another character I want to use the same animation for another chacracter that has same dimensions, but is just colored differently. The second character has the symbols for arm hand ect just as character one has. Only way I could think is to use swap symbol, but I would be doing it on alot of frames, very tedious. Is there another way?

PS: I was wondering what the synchronise symbols action does?

Thx

Mass Symbol Swap?
Ok hey.

Say ive got a character animted putting on a helmet. Ok, now I have another character I want to use the same animation for another chacracter that has same dimensions, but is just colored differently. The second character has the symbols for arm hand ect just as character one has. Only way I could think is to use swap symbol, but I would be doing it on alot of frames, very tedious. Is there another way?

PS: I was wondering what the synchronise symbols action does?

USB Mass Storage Drivers
i kno this has nothing to do with design but kinda it does.

so the installer says my OS doesnt need new drivers but it actually does. i go to the wesite to download the drivers and its the same installer that wont upgrade the drivers bc "it doesnt need them". but the comp wont recognize my cam ( Concord eyeQ 4060AF). so where can i get updated USB MAss Storage Device Drivers?

heres what shows up on my Device Manager:






please help. thanx

Mass Mailing In Flash
I have developed a simple game in flash... there is a button (email to your friend) in flash.. what is the script in flash to send the game url to nos of user..

Pleaes help....

Bye
Viren

Mass Asset Swaps
I need to replace a ton of art assets. Is there a trick to doing this in bulk? Or do I need put manually resetup each one?

Thanks,
T

Mass MovieClips Problem
Im having some problems in my flash game. I would post this in the game section but it really isnt specific to game programming. Its more in the direction of optimization

I have alot (over 100) of MovieClips on the stage, who are based off of several different classes. A majority of which (90%) use their own EnterFrame events.

I wanted to know if anybody else knew of a way to handle situations like this.

Or how to create some type of event that adds/removes the EnterFrame event when they enter/leave the screen.

In alot of them i only perform the actions coded in the enterFrame event if they are on the screen. However, that alone is not enough.

Is this problem inevitable when dealing with alot of movieclips like this, and should i just reduce the number dramatically.

Or, is their some solution to this problem

Flash Mass Deployment
Is there a way to manually download any current version of Flash and install it manually, rather than having to do it manually through a web browser?
Is there any .msi packages available?
If there is a yes response to any of these questions, please.. please let me know.

This question also applies to Shockwave.

Assigning Mass Variables
Inside a movie clip on the stage i have 15 more movie clips, called box1 - box 15. inside each box instance is a text field called date. i want to fill in the text field in box1 with the current date, and box2 with tomorrow's, and so on. How can i assign all of the dates without writing :

box1.date.text = (todays date)
box2.date.text = (todays date+1)
etc...

It needs to be that way, because I am later checking each day against a slot in an array to see if I need to fill in the proper info for that box.

Mass Speed Movement
i'm kind of newbie here, need some help on mass speed movement like in this intro site...
http://www.dreamshocker.com/oldsite/...2/indexaf.html

how to control the multiple clip mass speed movement....using actionscript



any help would be grateful..


thnx in advance....

Mass Image Load Via XML
Hi dudes,

I have a folder with a number of photos. In my XML file i have the paths to the photo´s and a description. Now i want to preload all the photos in Flash in 1 time. I don´t wan´t to preload the photo´s one by one, i want to preload them all in one. Does somebody know how i can do that? And i also want to show in Flash how many photos there are.

Thank you

Mass Speed Movement
i'm kind of newbie here, need some help on mass speed movement like in this intro site...
http://www.dreamshocker.com/oldsite/...2/indexaf.html

how to control the multiple clip mass speed movement....using actionscript



any help would be grateful..


thnx in advance....

Mass Image Load Via XML
Hi dudes,

I have a folder with a number of photos. In my XML file i have the paths to the photo´s and a description. Now i want to preload all the photos in Flash in 1 time. I don´t wan´t to preload the photo´s one by one, i want to preload them all in one. Does somebody know how i can do that? And i also want to show in Flash how many photos there are.

Thank you

Mass Video Importing
The scenario is this. Flash based website which will post new video clips every week.

I know you can import movie files right into flash, the question is which is the most efficient or only way to do this. Is the only way, like I am dreading right now, is to import each one into a seperate swf file and then load each movie file seperately?

Any advice would be appreciated.

Jonathan

Mass Change Reference Point
I have a bunch (hundreds) of MC's with reference points on the top left and I need them to be in the middle. Is there any way (besides going in each one and changing it) to do this by selecting all and pressing a magical button?

Thanks

Mass Collission Slow Running
I'm having some performance issues with a little game I'm creating. It's basically a lawn-mowing game (don't ask... it's a "learning experience").


I have about 150 mc's (grass) lined up as a field. I have 1 mc (the lawnmower) that is arrow-key controlled.

Each grass mc is running several lines of code each frame, basically determining if the lawnmower is withing 50 pixels of itself. If the mower is within 50, the grass block knows it is now "mowed", and goes to it's mowed state (frame2). This code functions correctly, but all together it bogs down when the field gets big (not to mention other objects are added to the game).

Any suggestions on how to streamline this collission code? Is there a better way than running constant enterFrame's?

here's the grass code:



Code:
onClipEvent (enterFrame) {
if (this.mowed != 1) {
if (_root.mower, hittest(this)) {
mowerx = _root.mower._x;
new1 = math.abs(mowerx-grassx);
mowery = _root.mower._y;
new2 = math.abs(mowery-grassy);
if (new2<=50 && new1<=50) {
this.gotoAndStop(2);
this.mowed = 1;

}
}
}
}

Mass Change Of Stats Of Various Instances
Hi guys... i have 10 instances which i wanted to goto a certain frame with one click of a button.. is there any easy way out other tahn asking them to go to tat frame individually?
the name of the instances are c1, c2, c3, c4.....c10.

i tried this:
for (var i = 1; i<=10; i++) {
_root.event_panel.but_panel.c+"i".gotoAndStop(1);
}
Cant work. : (

[CS3] Mass Loading Jpgs Externally Using Xml
Hi,
I made an image gallery using some tutorial that loads all my jpegs externally using a xml document. Everything works great, except when I preview it online it takes a while for each jpeg to show up. Is there some sort of way that i can get flash to start preloading all images linked in the xml file before or while viewing them so hoppfully theres no loading time (if the user dosent navigate to fast that is) ?

the current test portfolio (sorry but the layout is not finnished so please ignore the size of the links and if you have to scroll down to navigate between pictures):
http://www.monka.se/patrik/monka/portfolio.htm


This is the code for loading the images one by one, if i missed posting something useful or if it would be easier with the .fla file just tell me!


function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portfolio-stilllife.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {

if (Key.getCode() == Key.LEFT) {

prevImage();

} else if (Key.getCode() == Key.RIGHT) {

nextImage();

}

};
Key.addListener(listen);
previous_btn.onRelease = function() {

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {

preloader.preload_bar._xscale = 100*loaded/filesize;

} else {

preloader._visible = false;
if (picture._alpha<100) {

picture._alpha += 10;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}


Best regards
Patrik & Tomas Monka

Mass HitArea Modification With ActionScript
Hi,
I have many animations with more than 700 buttons each. All buttons are just lines (different shapes but always 1px lines) and those are separate objects in the library. I need to change(expand) hitArea to make them easy to click (or any snap to button function would work to). I can do it one by one by accessing each button but anybody knows if i can do it with ActionScript? I just need to save time and work.

Thanks for any help!

Rotate Sprite Around 'center Of Mass'
i have a Sprite and i'd like to spin it (incrementing the Sprite.rotation property) based on the center of itself. i don't know the technical term for that. it's a 2D object, no need for fancy stuff. i can spin it around 360 degrees just fine, problem is that it's spinning based on the top left corner. any help?

Mass MovieClip Colour Change -- HELP
Hiya,

Right, i got an interface thet when the user goes to a section, everything changes colour.

I have managed to get 2 MC's to change colour using the following code:

stop();
id=3


boxcolour = new Color(_root.bottom.content_mc);
boxcolour2 = new Color(_root.bottom2.content_mc2);

but1.onRelease = function () {
_root.id = 1;
}
but2.onRelease = function () {
_root.id = 2;
}
but3.onRelease = function () {
_root.id = 3;
}


_root.bottom.content_mc.onEnterFrame = function () {
if (id ==1) {
boxcolour.setRGB(0x00FF00);
}else if (id ==2){
boxcolour.setRGB(0xFF0000);
}else if (id ==3){
boxcolour.setRGB(0xFF9900);
}
}
_root.bottom2.content_mc2.onEnterFrame = function () {
if (id ==1) {
boxcolour2.setRGB(0x00FF00);
}else if (id ==2){
boxcolour2.setRGB(0xFF0000);
}else if (id ==3){
boxcolour2.setRGB(0xFF9900);
}
}




that works for the 2 movies, but i dont particually want to repeat the code for everysingle MC i need to change, i want to create an array of some sort that lists the rout of all the MC's that need to change any ideas?

the source so far is here: http://intranet.mykindaplace.com/rob...lourchange.fla

swf here:
http://intranet.mykindaplace.com/rob...lourchange.swf


CHEERS FOR ANY HELP

Mass Collission Slow Running
I'm having some performance issues with a little game I'm creating. It's basically a lawn-mowing game (don't ask... it's a "learning experience").


I have about 150 mc's (grass) lined up as a field. I have 1 mc (the lawnmower) that is arrow-key controlled.

Each grass mc is running several lines of code each frame, basically determining if the lawnmower is withing 50 pixels of itself. If the mower is within 50, the grass block knows it is now "mowed", and goes to it's mowed state (frame2). This code functions correctly, but all together it bogs down when the field gets big (not to mention other objects are added to the game).

Any suggestions on how to streamline this collission code? I know there is a better way...

here's the silly grass code:



Code:
onClipEvent (enterFrame) {
if (this.mowed != 1) {
if (_root.mower, hittest(this)) {
mowerx = _root.mower._x;
new1 = math.abs(mowerx-grassx);
mowery = _root.mower._y;
new2 = math.abs(mowery-grassy);
if (new2<=50 && new1<=50) {
this.gotoAndStop(2);
this.mowed = 1;

}
}
}
}

Mass Move In Multiple Frames
I have a flash movie made in adobe flash cs3 (in actionscript 2.0 mode). It's been decided that there needs to be about 50-100 pixels of extra space on the TOP of the movie, adding space to the bottom and right is as simple as increasing the document size, but adding to the top is a bit more tricky. I imagine it would involve going to every single frame on the main timeline and moving everything down (would take a very long time with 200 frames or whatever).

Anyways what is the best way to approach this?

Close Button Not Working - Mass Confusion
Hello all, after all the time I've been fiddling about with flash I thought I could work this one out, but it seems to defy belief!!
Basically I have a picture with an invisible button, once clicked on the button runs a movieclip with an instance - box1, once its opened a close button appeared, called closeBtn1 and the idea is when thats clicked, for box1 to gotoAndPlay frame 80, but no matter where I put the code it doesnt seem to let the closeBtn work! Even trace actions aren't getting recognised!! confusing!!
here's my code that I put in the actions layer of box1


PHP Code:



closeBtn1.onRelease = function() {
gotoAndPlay(80);

}
closeBtn1.onRollover=function(){
    trace("wooop");
}




as u can see I'm trying to trace even if the closeBtn gets rolled over but to no avail.

I have also tried it from scene level and still no joy... obviously a simple mistake, if someone wouldnt mind showing me!

Mass Newbie Confusion Re: Mousedown State
Hi,

I just started using Flash within the past week and I'm having some confusion issues here...

I have a movie that uses animated buttons for navigation. I'm trying to get the button to stay in a "mousedown" state once the user visits that page. I've been reading stuff re: setting variables in html code, etc., and have tried a variety of codes, but I think I'm misunderstanding something somewhere, because I can't get it to work....

My last attempt involved setting a variable in my html code and then trying to get Flash to check for it, but that didn't seem to work. I've read (a lot) about FlashVars and tried some solutions based on that, but I've been unsuccessful in my attempts...

The flash file is located here and if someone could take a look at it and let me know if they're able to get it to work, and how, I will totally appreciate it. I know I'm doing something wrong, but I just can't figure out what it is...

Mass Movie Clip Fading Issue
hey i am trying to make a whole bunch of components fade from alpha 0 to alpha 100

I have lines, text, and dynamic text and when i do a grahic tween, it only fades the lines and nothing else.

is there anyway to have atleast the text fade? should i just make it a graphic?

Thanks for your help

Mass Movie Clip Fading Issue
hey i am trying to make a whole bunch of components fade from alpha 0 to alpha 100

I have lines, text, and dynamic text and when i do a grahic tween, it only fades the lines and nothing else.

is there anyway to have atleast the text fade? should i just make it a graphic?

Thanks for your help

Advanced Math - Mass Collision Detection - Most Efficient Method?
Hi everyone!
I have a kindof advanced question.
I want to know what the fastest way of calculating mass collisions is...
right now, every obstacle checks to see if it bumps into any other obstacle. Some of them move and some of them don't. The point is I need the most efficient method since 20 obstacles means approximately (20 x 19 = ) 380 collision checks per frame.

I assumed simple additions take less so I do that at first, and if successful, moved on to some trigonometry


Code:
for (x=1; x<_parent.totalobstacles; x++) {
if (x != id) {
if (_parent["obstacle"+x]._y>(this._y-_parent["obstacle"+x].radius) && _parent["obstacle"+x]._y<(this._y+_parent["obstacle"+x].radius)) {
if (_parent["obstacle"+x]._x>(this._x-_parent["obstacle"+x].radius) && _parent["obstacle"+x]._x<(this._x+_parent["obstacle"+x].radius)) {
M2x = this._x-_parent["obstacle"+x]._x;
M2y = this._y-_parent["obstacle"+x]._y;
M2h = Math.sqrt((M2y*M2y)+(M2x*M2x));
if (M2h<this.radius) {
M2a = Math.atan2(M2y, M2x)*180/Math.PI;
M2x = -(Math.cos(M2a*Math.PI/180)*(-70));
M2y = -(Math.sin(M2a*Math.PI/180)*(-70));
if (_parent["obstacle"+x].constitution>=constitution) {
this._x -= (this._x-(M2x+_parent["obstacle"+x]._x))/_root.globalcollisionresist*_parent["obstacle"+x].radius;
this._y -= (this._y-(M2y+_parent["obstacle"+x]._y))/_root.globalcollisionresist*_parent["obstacle"+x].radius;
trace("body movin");
}
}
}
}
}
}



Would it be faster to just run through all the collision tests with trig from the get-go? Assume that collisions happen like... 10 or 20 times per frame at max. Most of the time there are either no collisions or a few at a time.

If there's an even better method, PLEASE ADVISE ME!!!!!

Thanks a Tonne.

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 Anything With An L In?
can you have if hitTest Anything??? so if it is hitting anything with say L in the instace name?

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

Copyright © 2005-08 www.BigResource.com, All rights reserved