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




Is HitTest The Right Thing To Use For This?



Hello - I am having a hard time getting a response to an earlier post , so let me see if I re-word it if it helps.

Is hittest the right way to do this idea? I have a MC(a square) that moves by actionscript to the middle of the screen...when it gets to the middle I want the MC to expand to a larger size so I can load pics into it.

Is hitTest the right way to do this?



FlashKit > Flash Help > Flash General Help
Posted on: 06-19-2004, 02:14 PM


View Complete Forum Thread with Replies

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

How Do I Fix This HitTest Thing
ok, i have this menu option, where you move the mouse over it, and it expands. everything is fine there. but, the menu expands even when the mouse is over where the menu is hidden by the mask, here is the fla

Using Hittest On A Different Thing
Okay, there are three movie clips. I'll call them A, B, and C. I want when A touches B, C plays. I think C's actions might be something like this:

onClipEvent (enterFrame) {
if (_root.A.hitTest(B)) {
gotoAndStop(30);
}
}

What am i doing wrong?

Hittest Collision Thing
I NEED an action script for collision or else i cant complete my game i mean i didnt think it would be this hard to fin sum so my car didnt go thrue a wall and dont tell me to search the frigin forums becuase i have bean!!! please if you have an action script post it here it would be most appriciated!!!

What's Wrong With This HitTest Thing?
Something i wrote down wrong?
I can't figure it out....

I try'd all of these, separate and togetter:

onClipEvent(enterFrame){
if(this._x == twee._x){
trace("ja");
}
if(this.hitTest(twee)){
trace("ja");
}

if(this.hitTest("twee")){
trace("ja");
}

if(this.hitTest(twee, true)){
trace("ja");
}
}


anyone? please

:edit:
added the fla

Making A Thing Any Of Which Will Interact With Any Of Another Type Of Thing
Well i know that title was a bit vague but heres what im trying to do, ive been larning to use flash for the past couple weeks, I'm using flash MX, i am expeirienced in other programming languages. What id like to do is to make an object, in this case a turet, which has code in it and can be duplicated, i know how to do that part, but, i want to be able to make it and copy it, and also have an enemy i can copy, a zobie, and have any of the turrets shoot at any of the zombies that get close. They cant all be pre scripted with eachothers names because i want to be able to create either after the program starts.

Basically, the zombies come out all over during the program and the player clicks where he wants to put turrets and those turrets shoot at whichever zombie is closest to them. Im sure its not that hard, and probably would involve arrays, but since im still learning how flash works im not sure how it can be done. Any help is apriciated, thanks. While i wait for a reply I'm going to read some more on how arays work in flash since i think they may be the answer.

Thing Thing Arena Type Game.
I want to make a shooting game, but I had a question first. How can I make the hand follow the cursor constantly, but never leave a restricted area? I would like to know how, thanks.

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)

Please Some One Help Me Its A Little Thing
can sumone help me????

i wanna do a simple flash, and its supposed to look like if there was a identification system, like if u type

User: YoshY

then something like this would appear

User YoshY loged in

but the problem is that i dont know how to do it so could u tell me how???
(u might not have understood this coz i am Brazilian and english is not my first language)

Thanks and please help.... helper if u have ICQ then help me in the UIN shown below(35235145)

How To Do This Thing...............
Well i m creating a new website on Flash 5. Now i want to have a database in which the user will enter there detail. So i want to create something by which the details entered on a form created (on flash) can be added to a database automatically. I mean that when the user will enter his details and press the submit button all the details should be entered in a database on the server. It this thing possible in Flash
I also want to know how can create a feedback form on flash. I mean the user will enter his Name, e-mail etc and all the details r mailed to me on my e-mail account.
Please Help.

1 Last Thing
I figured out how to make a checkbox, and everything works.
Its a 2 frame deal.
Here is my problem. I have like 12 checkboxes. if you check 1 checkbox, all of them turned checked. How can I make this work so each is unique?
Any thoughts?
Thank you for your time.

Is This Thing On?
Hey all.
I am helping someone out with a flash presentation. They know very little about flash, and wanted to do it all himself. Things worked "ok" but now we are getting into some functionality problems (didn't see that coming)
The problem: pause the audio (narration)
The other problem: the audio was just dragged into the timeline. Not as a MC
The other problem: everything is in 1 fla file. Not split into external.

First question is, can a pause button even get put in? Could it work?
This is a VERY low paying job, so if its a lot of work....I prolly wont make it happen.
Thank you TONS for any input

Thanks Man, 1 More Thing Please :)
um...
all my movie will get faster or only shapes??

One More Thing
In reference to my previous post i wanted to mention that the animations work if you hit the refresh button as well. I thought that would be a valuable piece of information.
Thanks
Don

Sorry But First Thing First....
Are there any tutorials that will tell me how to make a flash website.... I have flash mx on a relatives PC and basically i have made reasonably good html website using my own templates e.t.c. and now want to learn flash. Sorry im sure you get this a million times i did try the search couldnt find much.... :S so whats first?

One More Thing
oh and the flash file is not part of a web page, i'm using the projector. it autoplays when the cd is inserted

I Am Almost There. One Last Thing And I'm Done. Please Help
OK!!! I've got this code:
on(release){
getURL("phasp.jpg","_phasp");
}
Every FLASH expert knows that the above code opens this jpg in a new window, ok fine. That I have sorted. now what i want is that this jpg opens in a new window but without having an address bar. In other words, the window to scale to the size of the picture.

I hope I make sense...

Any help will be appreciated.

Trying To Do The Right Thing...
Hi All

I am trying to do the right thing and place all my actionscript on a single frame on the root timeline. I am trying to reference two buttons within a movie clip called intro_mc. The first button start_btn works fine but the second button go_btn will not work. Can someone explain to me where I am going wrong. Thanks in advance


Code:
stop();
intro_mc.start_btn.onRelease = function() {
trace("hit");
intro_mc.gotoAndStop(2);
};


intro_mc.go_btn.onRelease = function() {
trace("hit");
intro_mc.gotoAndStop(3);
};

Ok Here's The Thing
..Ive got a problem im working on, and im wondering which is the best way to go about it.

Theres a certain number of dynamically loaded .jpgs on the screen, every 2 seconds, i delete 10 of them, and load in another new 10 .jpgs (say combined file size of 50k). This will go on and could end up with LOTS of jpegs being displayed say over 5000 over time.

The thing i'm not sure about, is to allow these .jpgs to be cached or not? I'm worried that its going to fill up the users tempory space for cacheing files, but of course if you allow cacheing then it saves on download time.......which way is best??

thanks for any help..
boombanguk

Oh And One More Thing...
i have two movie clips that do exactly the same thing... yet one works when i put it on the time line and one doesn't...

any ideas... all it is is a one second fade... the logo works and the other mc doesn't...

they are identical... i even recreated the other mc... thinking that it might have just been a glitch in my flash program...

The First Thing I See....
..when I load my index.html is the swf square (empty) and then
loads the image.
How I do to evit this?

Thanks

Is There Such A Thing?
i need to be able to load text into a dynamic text field and for it to be able to scroll??

really need some help peeps

One More Thing.....
I need some bad help with forms....as in email/comment forms and newsletter forms!

p.s.
same thing applies for what i was saying earlier....about the verbal thing!

Fly In Thing
Here's something I made a while back. (I think I even posted it on this site, but that was with an old account, and I can't even remember the account's name anymore...)

Recently souped up to be faster, more efficient, and just overall, cooler.

You give it a picture (Bitmap image or something you just drew in Flash-doesn't matter which) and it constructs it, pixel by pixel. Each individual pixel flies in from the sides of the screen. The trouble is that it takes a little long and is nowhere near practical for anything-uses way too much CPU power. And even when I'm really pushing it in terms of CPU usage, it still takes longer than i'd like for it to finish.

Well, regardless, the image that it winds up with is 100% perfect, and it stops once it's done. Puts in pixels from top to bottom.

Some Thing To Know About XML/AS2
you just can't trust childNodes to be ordered in the way you expect it when enumerating them with [i]. had to check node names

The Tag Thing..
i know i have seen this effect before but i cant find the tutorial

can someone help me...

i did a search and couldnt find it..

look at the attach

One More Thing.....
I need some bad help with forms....as in email/comment forms and newsletter forms!

p.s.
same thing applies for what i was saying earlier....about the verbal thing!

Xml Thing
Hi,

Iv'e been developing a little app using flash/xml. It works perfectly, but sometimes it doesn't load the xml...

The usual scripting I use is something like this:


Code:
var myXML:XML = new XML();
myXML.ignoreWhites = true;
myXML.onLoad=function() {
//All to be done with the xml's info
}
myXML.load("xmlURL.xml");
What am I missing?

One More Thing....
How would I go by adding flash to jewelry to make it look like it is reflecting in the sun so to speak? Here is an example of what I am talking about: Example

Help With This Little Thing Please.
Ok, well I've been messing around trying to improve on my actionscript and I came up with this:


ActionScript Code:
my_color = new Color(object_mc);
myColorTransform = new Object();
object_mc.onEnterFrame = function() {
    my_color.setTransform(myColorTransform);
    myColorTransform.ra = 50;
    myColorTransform.rb = _root._ymouse;
    myColorTransform.ga = 40;
    myColorTransform.gb = _root._xmouse;
    myColorTransform.ba = 12;
    myColorTransform.bb = (_root._xmouse-_root._ymouse);
    myColorTransform.aa = 40;
    myColorTransform.ab = 70;
    var xMouse = _root._xmouse;
    var yMouse = _root._ymouse;
    if (Math.abs(xMouse-this._x)<1) {
        xMouse = this._x;
        yMouse = this._y;
    } else {
        this._x -= (this._x-xMouse)/6;
        this._y -= (this._y-yMouse)/6;
    }
};


I have been trying to make this MC rotate via _xmouse/_ymouse but I can't seem to get it to work. Any quick help for me?

How To Do This Thing
Please anyone tell me how to make navigation like this site http://www.kurtnoble.com/ have. This is done with actionscript or with motion tweening.

An Amazing Thing, That I Don't Know How To Do
Hello... thank's to view this post..... I' was searching in internet for amazing flash sites.... and in one of this sites appear a thing that I can't explain very good... it's like a pop up but is a new window that doesn't have the borders and title of the "Internet Exporer"... I don't know if you understand what I mean..... but here is the link http://www.sub7designs.com/test/ ....

If you know how they do that.... can you explain it... or make a litle explanation

thank you very much


CaVi21

I Tried The Count Thing
var a, b;
var score = 0;
function makeProblem () {
a = Math.ceil(Math.random()*12);
b = Math.ceil(Math.random()*12);
problem = a+" + "+b+" = ";
}
function checkAnswer () {
count++;
if (count == 10) {
gotoAndPlay ("Scene 4", 1);
} else {
// they got it right
if (answer == (a+b)) {
score++;
answer = "";
rightAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
makeProblem();
// they got it wrong
} else {
wrongAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
}
}
}
makeProblem();

thats the code i did, but that doesnt seem to count i think the count is in the wrong spot but i cant figure out where to put it, if i move it i get errors.

No Way Some Thing Is Wrong
no way
i make it step by step as you told me
the first mc loop and the second dosen't show up

can you send me a simple mc as i want to do to my e.mail

i will be glade if you do

Help Please On Open Thing?
I have recently purchased flash 5, it is a great program, but $300, f*** that, i got it at a discount place for $150.

Ok, on to the question, I want to know how to make a link(or whatever it is called in flash) open up in the movie, like a box slides in with my writing and stuff in it, all i can figure out how to do is to open up info from another separate creation in a different window, please help?

LoadMovieNum F*****G Thing
loadMovieNum ("loops.swf", 2);

First is the above code correct??? and second is that I have loops.swf loading into level 2 because I have another .swf loading 1 it works at the moment but this one doesn't WHY?? andis there a better to have two loadmovies running at the same time...

the other is track1.swf and I want this in level 1

ok thanks guys and gals

D

For Musicman 1 More Thing
hey,
dude how do i set the code to work where do i put each one of them, in the movie clip or where to make him move foward..

angle = walker._rotation * Math.PI / 180

d = 10

walker._x += d * Math.sin(angle)
walker._y += d * Math.cos(angle)
Thanx in advanced
Advanced sky|::...

Hello I'm New To This Whole Thing, And Flash...
I hope the get to know this site more better sooner or later, and make new friends! I'm glad to join!! I hope that this site and the people will help me out a lot, and I will learn from it all. Thank you!

Sorry One More Thing On The Last Post:
I meant to say that sometimes my tweens are smooth and nice; sometimes they are jerky and wierd...

want to know what the secret is to have them smooth all the time.....

thx ahead of time guys

Impossible Thing 1
HI,
First I sent a question how to disable keyboard, now I’m asking IS IT POSIBLE?

The Wierdest Thing
I run this script and it works but then the last duplicate of my movieclip always dissapears I do not get it. Also if anyone can give me suggestions how to make this code more flexible so it can be used by many movieclips at the same time that would be great I am having trouble making this easily customizable, functional, and adaptable for all movieclip instances on my stage.
onClipEvent (load) {
_parent.stop();
num = 20;
n = 1;
ini_timer = Math.ceil(getTimer()/1000);
}
onClipEvent (enterFrame) {
elapsed_timer = Math.ceil(getTimer()/1000);
if (elapsed_timer>(ini_timer + 2)) {
while (n<=num) {
_parent.ball.duplicateMovieClip("ball" + n, n);
_parent["ball" + n]._x += _width * n;
n += 1;
}
}
}

One More Thing - I Hope
Can I get a button to open a word document or do I have to zip it and link it to the zip.

Thanks!

Kate

Cant Get This Thing To Print
I'm a newbie to Flash and posted this questionn there with no results so I thought I'd try here.

With a little help from my friends here in FK, I figured out how to make my scroll bar work! :-)

Now I need to figure out how to make it print. On my main timeline, I have 3 layers, the second layer is the one I want to have print. It's nothing more than about 4 pages of text.

I've got my button all set up and ready to be assigned an action.

When I try adding the "Print" action, by default it gives me this code:

on (release) {
printNum(1, "bmovie");
}

That seems to print out the 1st layer in the movie, not the 2nd layer I'm trying to print. So I switched the 2 layers around, and that didn't help. I changed the

on (release) {
printNum(1, "bmovie");
}

to

on (release) {
printNum(2, "bmovie");
}

and that didn't help.

Any ideas on how to solve this? I;m using Flash MX

Thanks

Cursor Thing
How do i get a movieclip to go from the cursors postion to a point on the flash movie

Can You Help Me With This Fullscreen-thing?
Hey FlashFreaks, to be short, here's my problem:

I'm opening a Flash-intro in the browser, after the flash intro it goes to the main-preloader and then to the mainsite. So far so good, but what I was trying to do is that I wanted to let the main-movie open in a fullscreen pop-up (with a little "close pop-up"-button in the corner).

How can I do this? I'm familiar with Flash and a little bit with actionscripting....

ErGoDyNe1

ergodyne1@hotmail.com

Are There Any Scripts To Do The Same Thing
Thank you for the information, but I was wondering if there is a script similar to this concept, yet not with the MC increasing is size, but the MC behind in magnifing,

point = new Object();

point.x = _x;
point.y = _y;

localToGlobal(point);


dX = Math.round(_root._xmouse - point.x);
dY = Math.round(_root._ymouse - point.y);
distance = Math.round(Math.sqrt((dX * dX) + (dY * dY)));

threshold = 100;
if (distance >threshold){
distance = threshold;
}
_parent._xscale = (100 + threshold) - distance;
_parent._yscale = (100 + threshold) - distance;

Thanks

Does Anyone Know How To Do This Cool Thing?
Hey Does anyone know how to do this cool flash, http://www.hugeinc.com, I cant figure it out, does anyone know?

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