Stinkin Hit Test
hey flashers,
well, heres the thing, im making a flash site, and i have the menu bar at the top, and a loaded bg at the bottom. on the menu bar, i have a little movie clip that has a drop down menu inside it. i made a button over the whole menu so that when you roll over the menu bar,
on (rollOver) { tellTarget ("menu") { gotoAndPlay (2); } }
so the menu drops down and the buttons are in it. fine. but when i roll over one of the buttons in the menu, the button to make the menu drop down, kicks in with its rollout action because im over a different button.
on (rollOut) { tellTarget ("menu") { gotoAndPlay (10); } }
so what i want to do, is in the rollout action, i want to tell it, if the hit test on the menu movieclip = false, then its ok to gotoAndPlay (10), but otherwise, not to rollout. is this possible? if so could you please provide me with the AC for this button? thanks a bunch to whoevers gonna help me lata all.
Jà©Ôß
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-22-2002, 06:55 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
I Don't Want No Stinkin' Rollover
Is there a way in Flash 5 to have the cursor not change to the hand when you rollover a button?
I want it to stay as the arrow no matter where the mouse is on the page.
My Stinkin' Progress Bar Won't Work
Hey guys!
I have a loader component that is acting to load jpgs from the web. I simply created keyframes at every ten frames or so and used the property inspector to load the picture in ... to create a slideshow of sorts.
I would like to have a progress bar to show the progress of these jpgs loading, as they are fairly large photos.
Can this work with a single loader component loading many different jpgs?
If so ... do you have any tips? I believe I've done everything correctly.
Should autoload be set to true or false?
All I have done in an attempt to make this work is dragged a progress bar component to the stage, given it an instance name, and designated the loader's instance name as the source.
Please provide any help you can!
Thanks,
Tara
How Do I Make A Stinkin Health Pack?
I have a health pack connected to a parachute and after 15 seconds it falls and the hero can pick it up and restore health. The parachute and health pack are inside the same clip and the following timer code is on the first frame inside the mc.
Code:
stop();
this._visible =false;
function wait() {
this._visible = true;
gotoAndPlay(2);
clearInterval(myTimer);
}
myTimer = setInterval(wait, 15000);
On frame 2, I have a tween of the parachute and healthpack slowly falling to the Earth. On the last frame I have this code:
Code:
stop();
if (this.hitTest(_root.character)) { gotoAndPlay(1); health +=1; }
After 15 seconds, the clip becomes visible and it falls to the ground like normally. However my character gains health, but the clip does not go back to the first frame again. How can I make it so that when the character touches it, the health pack will disappear for another 15 seconds and the character will gain only 1 health.
Whats The Simple Preloader Stinkin Code?
I cant believe this, but i forgot how to do the most simple preloader.
I have 2 scenes, one called PRELOADER and the other called MAIN.
In the preloader scene, i have an animation sitting on the first frame, and a layer for actions under it. In the first actions frame, I need to code to put in there just to tell the program to load in my "main" scene, and then when its done, to continue to the main scene.
UGH!
Flash 8 Quiz Guru Needed: Make Link Appear For Next Test Only If Test Taker Passes.
Greeings, all,
Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am forgetting. The test taker makes their selection(s) or answers, and clicks a "check answer" button. They then get a feedback statements depending on whether they have answered correctly or not. Many questions involve multiple selections to be correct, but all must click on the "check answer" button to advance to the next question.
The point is that all of this functionality is coded in the component(s) which make the template so versatile. A copy of my .fla shouldn't actually be needed (I am guessing here), because the component code is what I believe needs tweaking, at least the part where the final percentage of correct answers is calculated at the end of the test, and that percentage is compared to a user-defined passing percentage score.
I think this requires a Flash Quiz Guru, who knows just how to connect the pass or fail result to a new button or a "go to" redirect. I don't know whether the same effect could be accomplished by frame scripting, but I expect tweaking the component(s) code would seem a more direct approach.
I cannot fill in the blanks for any idea that is just an idea. If anyone can code this, make it work and test it, and direct me to where the snippets must be placed, I would be deeply grateful. This is about education, not a game or commercial razz-ma-tazz.
Are there any Flash Quiz Guru's who can help me out with this?
Thank you.
regards,
stevenjs
____________________________________
"I am but an egg."
--Stranger in a Strange Land
Flash Quiz Guru Needed: Make Link Appear For Next Test Only If Test Taker Passes.
Greeings, all,
Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am forgetting. The test taker makes their selection(s) or answers, and clicks a "check answer" button. They then get a feedback statements depending on whether they have answered correctly or not. Many questions involve multiple selections to be correct, but all must click on the "check answer" button to advance to the next question.
The point is that all of this functionality is coded in the component(s) which make the template so versatile. A copy of my .fla shouldn't actually be needed (I am guessing here), because the component code is what I believe needs tweaking, at least the part where the final percentage of correct answers is calculated at the end of the test, and that percentage is compared to a user-defined passing percentage score.
I think this requires a Flash Quiz Guru, who knows just how to connect the pass or fail result to a new button or a "go to" redirect. I don't know whether the same effect could be accomplished by frame scripting, but I expect tweaking the component(s) code would seem a more direct approach.
I cannot fill in the blanks for any idea that is just an idea. If anyone can code this, make it work and test it, and direct me to where the snippets must be placed, I would be deeply grateful. This is about education, not a game or commercial razz-ma-tazz.
Are there any Flash Quiz Guru's who can help me out with this?
Thank you.
regards,
stevenjs
____________________________________
"I am but an egg."
--Stranger in a Strange Land
Flash Quiz Guru Needed: Make Link Appear For Next Test Only If Test Taker Passes.
Greeings, all,
Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am forgetting. The test taker makes their selection(s) or answers, and clicks a "check answer" button. They then get a feedback statements depending on whether they have answered correctly or not. Many questions involve multiple selections to be correct, but all must click on the "check answer" button to advance to the next question.
The point is that all of this functionality is coded in the component(s) which make the template so versatile. A copy of my .fla shouldn't actually be needed (I am guessing here), because the component code is what I believe needs tweaking, at least the part where the final percentage of correct answers is calculated at the end of the test, and that percentage is compared to a user-defined passing percentage score.
I think this requires a Flash Quiz Guru, who knows just how to connect the pass or fail result to a new button or a "go to" redirect. I don't know whether the same effect could be accomplished by frame scripting, but I expect tweaking the component(s) code would seem a more direct approach.
I cannot fill in the blanks for any idea that is just an idea. If anyone can code this, make it work and test it, and direct me to where the snippets must be placed, I would be deeply grateful. This is about education, not a game or commercial razz-ma-tazz.
Are there any Flash Quiz Guru's who can help me out with this?
Thank you.
regards,
stevenjs
____________________________________
"I am but an egg."
--Stranger in a Strange Land
(Authoring Mode-test Scene-test Movie )Different Results WHY?
(Authoring mode-test scene-test movie )Different results WHY?I will get mad working on a quiz for a month plz help: im working on quiz game -frame by frame- its 15 scenes each scene contain about 70 frames with 70 action script :go to and stop - go to and play - stop every thing is fine till scene No. 11 in the authoring mode when choose from control menue enable simple buttons - enable simple frame action : its working fine scripts executed fine but when going to test movie mode some scripts doesnt work WHY? what mistakes i have done? what should i do ? how can a void such a problem ? any suggestions PLZ??? Thanks in advanced
Buttons Work In Test Scene But Not In Test Movie...WHY?
Hi all,
I have buttons in a movieclip i've used
_root.
and the buttons work when i do test scene but when i try and test movie the buttons link back to the wrong screen. why is this? There is no apparent reason as the scripting seems fine.
Loading Test File In To A Dynamic Test Box
i am making a flash app and part of it is being able to enter the name of a text file in an input text box and hit a button and if there is a text file with the name you entered in the same folder as the swf it will load it in to the dynamic text box. attached Is a file of how far i got on my own.
thanks
How Do You Test Preloader In Test Movie?
hey... another question...
how do i test my preloader in the Test Movie?
when i use Test Movie the file is already 100% loaded so i dont know if my preloader is workin or not. is posting it in the web the only way to test if the preloader is working? thanx in advance. peace and prayer
alex
Test Scene Vs. Test Movie
Whenever I have done work in flash, these two commands have always worked the same. However, this one time, I test scene and the thing works exactly as I would like it to. When I test movie, one of my movie clips doesn't show. I can not find any problems in the code, and the layers all seem right, does anyone know of a difference between these so that I can look for a different problem? I have been racking my brain and the brains of others for about a week now on this. Thank you for any help.
Steve
Test Scene Vs. Test Movie
I have Scene 1 as a loader, and Scene 2 as my movie...
when I "test scene" for Scene 2 the quality looks great!
but when I "test movie", my Scene 2 movie looks like crap!
Anyone know why!? I went to "publish settings" and put all my settings at highest quality possible. jpg's are at 100, and flash settings are all at 100 and best quality.
They are imported jpg's by the way. And look great until I export or even preview as a flash movie. (????)
Thanks.
Test Scene Different Than Test Movie
I am doing a picture page in flash and for some reason it works when I do test scene, but it doesn't work when I do test movie. Does anybody know why this is happening.
[MX04] Diagonal Line Hit Test Or Drawn Line Hit Test
i have this guy who maves around and you can draw i gave it an instance name of "linesd" i dunno and i want to make it so the square will not go through the line that i draw in the swf. if you cant help with that can you help me with diagonal line hitTest i ban do vertical and horozontal ut diagonal is realy hard because it does the hitTest for the movie clip box not the line itself
-jakeA
Movie Works Properly In Test Mode, But Only In Test Mode.
I have a button that has a gotoAndStop action, sending user to specific label in the timeline. This button works fine when I test the movie. But when I open the file directly from the swf - well, it's strange. It appears to go to that frame, but the contents of the frame is missing. What might be the problem? Again, it all works fine when I test it (Ctrl+Enter.)
thanks.
Variables Help - Test.swf?one=test
I was wondering if anyone can help me, flash seems to be able to handle variables input from the browser ok
e.g.
http://www.tobeon.co.uk/test/test.swf?one=hello
however I don't know how to get it to accept variables for other levels
(example in link above I cant get the variable "two" in the movie "movie" to work)
things like _level0.one=hello and _level0.movie.two=hello doesn't seem to work
any help it is v important?
Thanks in advance
"Test Scene" Acting Differnet Than "Test Movie"
I am trying to build a cartoon. I am going through allot of pain staking measures to sync up stuff. It is behaving (mouths and sounds) different in Test Scene, than Test Movie. I am using 20 fps. Is that a good idea?
I am issing something major? This is making me nutz.
Any ideas?
Thanks,
: grey :
Percentage Test Of A "Hit Test" ?
Hi all,
Ok, we can do hit test with movies and coordinates but, how can we test if two movie clips collide (for example a trashcan and a garbage) in more than 50% ?
I mean if the garbage fills more than 50% of the area of the trashcan how can i grab this ??
Any ideas ?
Hit Test Help
Hello,
Hopefully this is an easy one. I've just been looking at it too long! K,
here goes.........
Scene 1 , Symbol1
In my symbol timeline I have a MC with this action on frame 14....
onClipEvent (enterFrame) {
if (this.hitTest(_root.cannon.ball) == true) {
nextFrame ();
}
}
I have a stop action on frame 14 and a fade animation on frame 15 of the
symbol timeline. The hit test keeps sending the timeline back to the
beginning of the symbol instead of next frame. I tried frame label and frame
number with no luck. If I remove the stop action on 14 , the timeline plays
through. Any ideas???
Thx in advance!
~GD~
How Do You Test FPS?
How do you test your FPS in a movie. I added a graphic to a movie that runs at 20 fps and it slowed it down, I would like to know how I can track what FPS it is going at.
Thx,
-Kac
Hit Test
I have a game like flash piece that uses hit tests to keep a guy from walking through walls. Works pretty well. Problem is - if he just hit a wall (hit test = true) - let's say going down, he stops, but if to his right is a corner, he will go through the next piece. ANyone know how I can check multiple hit tests at the same time? Thanks!
Hit Test
I draw 2 circles on the stage, and converted them to a movie clip (instance name "circle1" and "circle2" respectively). I have the following script inside "circle1":
onClipEvent (load) {
startDrag (this,true)
}
onClipEvent (enterFrame) {
if (this.hitTest (_root.circle, true)) {
_root.textfield="hit"
}
else {
_root.textfield="no hit"
}
}
For some strange reasons the above code doesn't seem to work. I don't know why. Pls help. Thanks in advance!
Test
I want to make a test in flash. So far I have it so that when they type in their name at the beginning it shows their name at the end of the test. I am struggling in coming up with a way to do it? If you can help me out, I would really appreciate it.
Hit Test Help
my character's instance is "sky" ok now i want him to blow up when he hits a wall how do i go about to do this can someone please help me .im making a game and i need to know how to do this ok cool
thanx in advanced
Advancedsky|::.
Another Test
This is for testing of format in Flashkit.com
I think you all will excuse me….
Another Test
How can I display an image in this discussion forum, and how can I make bold or italic few words in this forum. I have seen some people posting questions which are neatly decorated and indented. I want to display my LOGO beside my signature.
Thanks in advance
Test
This is a test This is only a test.
[swf width="396" height="378" background="#000000"]http://www.doa.myeva.net/INWORKS3.swf[/swf]
Hit Test
Sorry, this really is kind of a lame question given the tutorials on the site, but, I'm still kindof lost.
Can someone give an explanation of hit-test, how to use it, etc.? I understand the basics, I think, but I'm still kind of lost.
Thanks if advance,
Darque9
Help Hit Test
hey flashers,
well, heres the thing, im making a flash site, and i have the menu bar at the top, and a loaded bg at the bottom. on the menu bar, i have a little movie clip that has a drop down menu inside it. i made a button over the whole menu so that when you roll over the menu bar,
on (rollOver) {
tellTarget ("menu") {
gotoAndPlay (2);
}
}
so the menu drops down and the buttons are in it. fine. but when i roll over one of the buttons in the menu, the button to make the menu drop down, kicks in with its rollout action because im over a different button.
on (rollOut) {
tellTarget ("menu") {
gotoAndPlay (10);
}
}
so what i want to do, is in the rollout action, i want to tell it, if the hit test on the menu movieclip = false, then its ok to gotoAndPlay (10), but otherwise, not to rollout. is this possible? if so could you please provide me with the AC for this button? thanks a bunch to whoevers gonna help me lata all.
Jà©Ôß
Hit Test
Hi there,
I need some help with a racing game I am making. here is the situation:
I have a car which sits centre stage... the track and all the obstacles move underneath it.
When I create the hit tests for the items around the track, I can only seem to make ONE shape hitTest script work at any one time. Is this a limitation of actionscript?
For example... I created a loop which tests to see if my car has hit one of up to 99 obstacle movieclips scattered around the track. This works fine:
onClipEvent (enterFrame) {
if (_root.obstaclehit == 0) {
for (i=0; i<100; i++) {
if (hitTest(this._root.road["obstacle"+i])) {
_root.obstaclehit = 1;
}
}
} else {
_root.obstaclehit = 0;
}
I have also managed to attach a scipt to my sandtraps, this works fine too. This tests to see if my sandtraps SHAPE hits the x,y co-ordinates of the car.:
onClipEvent (enterFrame) {
if (hitTest (_root.player._x, _root.player._y, true)) {
_root.sandhit = 1;
} else {
_root.sandhit = 0;
}
}
But I also need to attach the same script to another shape and when I do, the script doesn't seem to work:
onClipEvent (enterFrame) {
if (hitTest (_root.player._x, _root.player._y, true)) {
_root.grass_hit = 1;
} else {
_root.grass_hit = 0;
}
}
Can I only use ONE HitTest script on ONE shape?
Any hints as to how I can work around this, so I can have several different types of shape? I would like to have several different shapes which affect the car differently. Grass, Bollards, Sand, Boundary walls, Ramps, etc, etc...
Any help would be greatly appreciated.
Kind regards,
Simon.
Hit Test
If you're able to help...
I'd like to attach the following scripts onto two (or more) shapes:
onClipEvent (enterFrame) {
if (hitTest (250, 250, true)) {
_root.obstacle_type1_hit = 1;
} else {
_root.obstacle_type1_hit = 0;
}
}
The problem is, when I attach this script to other shapes, I can only get ONE instance of the script to work... all the rest are ignored.
e.g.
onClipEvent (enterFrame) {
if (hitTest (250, 250, true)) {
_root.obstacle_type2_hit = 1;
} else {
_root.obstacle_type2_hit = 0;
}
}
This is for a racing game and I'd like to create several different layers of SHAPES, and alter the result to change different variables when the hitTest returns true.
Any help would be appreciated.
Regards,
Simon.
Test
How can I change colors like this using only ActionScripting
http://www.sitevendor.com/fkqueries/colorchange.swf
Test
oh.. nothing.. just trying out the sig
Hit Test
I need sum help with this hit test stuff
I have 2 movie clips
one named wall the other man
the wall is just one side and i used the wall movie clip a few times to form a maze.
i need for frame one to go to frame two when the man hits the wall
i have this code but it doesnt work
wall.hitTest(man);
if (wall.hitTest(man)) {
equals;
true;
gotoAndStop (2);
}
What am i doing wrong? its driving me nuts ive tried everything i know! some one please help
Hit Test
I need sum help with this hit test stuff
I have 2 movie clips
one named wall the other man
the wall is just one side and i used the wall movie clip a few times to form a maze.
i need for frame one to go to frame two when the man hits the wall
i have this code but it doesnt work
wall.hitTest(man);
if (wall.hitTest(man)) {
equals;
true;
gotoAndStop (2);
}
What am i doing wrong? its driving me nuts ive tried everything i know! some one please help
Hit Test
i made this game, i have some Hit Test working (the finish line) i need some help with the track so when you cross it its a game over
http://www.angelfire.com/my/poogas/carmaze.fla
this is just a test file so it sux and more levels will come too
Cpu Test
cpu test
is it possible to test the users cpu power, so that you, for instance, can make movies in 3 different qualities so the user gets the best performance without lags?
i had an idea, that you might create a very cpu-intensive scene, and then test how many frames per second the user's cpu can cope with. if it can't render more than 5 fps, then play the smallest version, if it can render only 10 fps, then play the medium version, and if it will render 15 fps, then play the largest version.
i'm new at scripting, so if anyone could help me i'd be really grateful.
"my scene is quite heavy on the cpu because it contains a lot of alpha layers."
Cpu Test
cpu test
is it possible to test the users cpu power, so that you, for instance, can make movies in 3 different qualities so the user gets the best performance without lags?
i had an idea, that you might create a very cpu-intensive scene, and then test how many frames per second the user's cpu can cope with. if it can't render more than 5 fps, then play the smallest version, if it can render only 10 fps, then play the medium version, and if it will render 15 fps, then play the largest version.
i'm new at scripting, so if anyone could help me i'd be really grateful.
"my scene is quite heavy on the cpu because it contains a lot of alpha layers."
Help With Other Hit.test
hey there are 2 types of hit.tests, one is the box around the object and the other one is the object. how do i make the hit.test so it is the one that IS the object instead of the box around it?
thnx
-evan
Test Me
Hmmm, ok well i was wondering... I always seem to learns stuff quite quickly when it comes to computers, as long as i have something to do, and know what CAN be done, so i was wondering if someone could please help me with sort of a list of things to make with flash to test my skills, and pretty much use alot of stuff in flash, that way I (and anyone who feels the same way as me) will be able to perform the tasks, and learn along the way... this may be sorta alot to ask, im not sure, but if anyone can think of some sort of task they could give me, i would be most gracious... THANKS! (btw im using flash 5)
--Samsa--
Hit Test Not So Hit Test
Ok I have a hit test between 10 mc I call flies and 2 mc I call trigger. This is working but it is not always detecting the hit test. I will place the code here but it is quite a bit of code sorry but you can see what is going on in the hit test part . Also here is a link so you can see it happening.
HIT TEST LINK
When the "+" does hit the trigger the trigger flashes and moves to another random spot but as you can see the "+" is hitting the trigger a lot more time than it is it.
Code:
trigAmount = 2;
trigArray = new Array();
for (i=0; i<trigAmount; i++) {
_root.mapleft.attachMovie("trig", "trig"+i, i);
trigArray[i] = _root.mapleft["trig"+i];
trigArray[i]._x = Math.random()*80-20;
trigArray[i]._y = Math.random()*90-20;
//trace(trigArray[i]);
}
flies = function () {
flies.prototype.onLoad = function() {
this.makeTarget();
};
flies.prototype.makeTarget = function() {
this.xTarget = Math.random()*150-50;
this.yTarget = Math.random()*160-50;
};
flies.prototype.onEnterFrame = function() {
this.distanceX = this._x-this.xTarget;
this.distanceY = this._y-this.yTarget;
this._x = this._x-this.distanceX/8;
this._y = this._y-this.distanceY/8;
if (Math.abs(this.distanceX)<1) {
if (Math.abs(this.distanceY)<1) {
this.makeTarget();
}
}
for (j=0; j<flyArray.length; j++) {
for (p=j; p<trigArray.length; p++) {
if (flyArray[j].hitTest(trigArray[p])) {
trigArray[p].gotoAndPlay(1);
trigArray[p]._x = Math.random()*80-20;
trigArray[p]._y = Math.random()*90-20;
trace("I HAVE BEEN HIT");
}
}
}
};
};
flies.prototype = new MovieClip();
Object.registerClass("fly", flies);
flyArray = new Array();
for (i=0; i<10; i++) {
_root.mapleft.attachMovie("fly", "fly"+i, 1000+i);
flyArray[i] = _root.mapleft["fly"+i];
//flyArray[i]._alpha = 100;
}
Thanks to anyone that can help ****
Help Test Me Please
Excuse me to disturb you, but i've got a problem with my family book (in flash mx)
There is 2 parts on my flash:
1rst----the book on my web page (book.swf)
2nd----the pages, on a folders on the web (pages.swf)
http://membres.lycos.fr/sgstephane
There is no problem on PC's platform (Windows 9x, 2000, XP) but on the Apple OS, pages are not in the right order. Could you help me ?
ps: when i test my flash on my i-mac not connected to the web everything is ok !
2 Second Test..right This Way
is the 'D' on this sample page knocked out? and if not does anyone have an answer?
http://www.jdkopinski.com/test/texttest.html
thank you
josh
Hit Test
Hello,
i am using hittest to check if a MC is over a button.
However i would like to check, if the movie clip is over a circular area inside the button and with same center as this button, and not over any place of the button.
Any idea?
Thanks,
Miguel
P.S: i don't want to change the Hit Frame of the button as someone sugested me cause i want the button to be all active when the mouse is over it.
Help/Hit Test
I have the following code and it is working but it overlaps some movie clips... how do I get it so I can be sure no movie clips over lap
on (press) {
// create new array
signs = new Array();
// populate array
signs.push("symbol1");
signs.push("symbol2");
signs.push("symbol3");
signs.push("symbol4");
// set loop to run through the entire array
for (i=0; i<4; i++) {
// pop the last array element
popped = signs.pop();
// attach movie clip from library and name it newcliplevel
attachMovie(popped, "newclip"+level, level);
// place it randomly on the screen
_root["newclip"+level]._x = int(Math.random()*550);
_root["newclip"+level]._y = int(Math.random()*400);
// remove last element from the array
signs.splice();
level++;
}
}
|