Flash8 HitTest Works Wierd With Rotating Objects?

Dec 29, 2009

How would i make hitTest work better with a rotating object(AS2). Becase i have a circle and it if gets near the rotating object (actually pretty far away) it starts the script,(new x and y)

I think thats the rotation script, becuase i took a break for like 4 days becuase it was irritating.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Flash8 - Use One HitTest For Multiple Objects?

Jul 28, 2010

I'll try to make my question pretty short and simple.

[Code]...

So what I'm trying to do is make the character stop when it runs into something. I can do that, but it will only work for one "block" movieclip I put on the stage. What can I do to make this work for multiple "blocks"?

View 2 Replies

ActionScript 2.0 :: AS2 Hittest On Rotating Shapes /w Mouse

Mar 27, 2011

I've googled for hours and found nothing. I did find a lot but none involved hittesting with a mouse cursor. I'm trying to make a simple maze game, so far it works, I die when I hit squares and rectangles, but I die incorrectly when hitting a rotating rectangle.Because it rotates, the bounding box is larger and a normal hittest sees bounding boxes, meaning it won't work.Make it so that my mouse can go near the rotating rectangle without dying until I actually touch the actual rectangle instead of the bounding box.

View 2 Replies

ActionScript 2.0 :: Flash8 Why Can't Ever Get Hittest To Work

Mar 28, 2011

i am making a game where a ninja runs through a course, every thing is running smoothly. EXCEPT hittest will not work, hittest never works on ANY of my projects. I know im doing it right, because ive even tried copying and pasting working ones. Look at the attached fla file to see what im talking about.is it my computer that wont let it work, because the exact codes worked for all of the people on youtube that used it.

View 2 Replies

ActionScript 2.0 :: Hittest Only Works Once?

Jan 26, 2010

when i make this script:

onEnterFrame = function(){
if(ss.hitTest(_root.c2)){
_root.ss._x = -49.4;
}
}

it only does go to cords -49.4 once, after ss have hit c2 once it doesn't react when it hits c2 again!

View 9 Replies

ActionScript 2.0 :: Check When Flash8 HitTest Whilst Dragging?

Jul 29, 2009

Is there a way to check if a movieclip I am currently dragging, has hit another movieclip?

View 1 Replies

ActionScript 2.0 :: Flash8 Projecting Points On Rotating Object?

Sep 6, 2009

I'm trying to project "collision" points on a car for a racing game I'm making, similar to this image:

The car's registration point is the bottom center, so the bottom point is easy to place. It's also easy to get the top point using simple trigonometry. However, I can't seem to figure out how to project the two side points. I've tried drawing a bunch of different triangles to figure out how to project the points, but I can't get it to work

View 1 Replies

ActionScript 3.0 :: HitTest Works But Also Returns Error

Sep 5, 2009

Perhaps I should leave well enough alone, but it bugs me that my hitTest gives me an error message even though it seems to work as intended. I have two movieClips running side by side. The second clip, the hitTest object is actually in an array that I keep pushing every second.

[Code]...
 
I have tried to trace cars[i].name and it returns "instance XXX" instead of what I would have expected, which would have been something like cars1, cars2, etc... If that is creating the error, I don't know how to fix it. I have thought also that perhaps the array itself is being referenced, but again I wouldn't know how to change it.

View 11 Replies

ActionScript 2.0 :: HitTest Function Only Works On Y Axis

Oct 14, 2003

My hitTest function only works on the y-axis
This is the code....
onClipEvent (enterFrame) {
// _root.speed = speed;
if (Key.isDown(Key.UP)) {
speed += 3;
[Code] .....

View 1 Replies

ActionScript 3.0 :: Perform A HitTest That Only Works On Children With A Certain Depth?

Feb 27, 2012

I have a problem with the getChildIndex() method. I have an array that stores multiple children and I want to perform a hitTest that only works on children with a certain depth, with one that is lower than the other hitTest "partner". Therefore I want to check the depth of that certain child.I tried to trace the depth, but I get crazy errors doing that. No matter if I do it from the child itself, or from the Document Class.

trace(getChildIndex(foes[7][1][1]))

[7] is the current level, [1] is the type of child and the second [1] is the child itself called [Object EnGob]. I put it there by the push() command.

View 3 Replies

ActionScript 3.0 :: Flash Hittest Only Works On Last Object In Array

Mar 24, 2012

For days now I have been trying to get this hit test to work and which ever way I try it, it always comes back to the same result. I get a hit on the last item I pushed into my array but none on the previous items I pushed in. Also if I put a .sort() on the array it only gives a hit on the last item of the array, no matter which one I push in.

The idea is that I want to drag and drop objects onto the stage, they may not overlap so I need a hit test on the objects so I can make them undroppable when the hit test is true.

This is the part I have for dragging the objects to the stage, and adding them to arrays for the hit test.

Code:
private function onClickDragBuilding1ToGameField(e:MouseEvent):void{
building1Placeholder.x = mouseX-25;
building1Placeholder.y = mouseY-25;

[Code]...

Now if I run this I can add the object to the stage just fine no errors or other issues but the hit test only works on the last object I added to the stage/array and not the previous object I added to the stage/array.

Sso I drag the first object to the stage. (no other object are available yet so nothing happens, this is as it should be) Then I drag a second object to the stage, this reacts to the first object and returns the hit test as true. (Also great and working as it should.) Then I drag a 3th object to the stage, this reacts to the 2nd object I dragged just fine and return a true value, but it does not react to the 1 object I dragged onto the stage. Then when I drag a 4th object to the stage it will react to the 3th object I added, but not the 1st ad 2nd object.

View 4 Replies

ActionScript 2.0 :: Hittest - MC Movement Works Only When The Y Position Of The Mouse Is Over The 300 Px?

Jan 21, 2004

Ive got a code to move a MC on the main stage together with the mouse, in the the X axis,. difficult to explain. But now the client wants that this MC movement works only when the Y position of the mouse is over the 300 px. I thought I need a hit test or something elese. Please help. Here is the whole code.

[Code]....

View 1 Replies

Flash8 :: XML Works, But Not In HTML

Jan 27, 2010

I have created a program that pulls large amounts of data from an XML file. The program works absolutely perfect if I test it in Flash or open it in IE. The problem I have run into is that when I put the program into a webpage using the following code (neither one works), it no longer connects to the XML file. Am I missing something in the code?

PHP Code:

<object width="880" height="800">
<param name="complete_bikes" value="flash/complete_bikes.swf" />
<embed src="flash/complete_bikes.swf" width="880" height="800">
</embed>

[Code]....

View 3 Replies

ActionScript 2.0 :: Flash8 Loader Works In Flash IDE, But Not In HTML.?

Mar 23, 2009

I made a very simple loader, it's only a textbox with a percent loaded displayed.

It works perfectly when I use Test Movie in the Flash IDE but when I upload the .swf to my webserver, I get a blank grey box until the entire game is loaded, then it starts the game.

Is there any common mistakes one could make that would lead to this behaviour?

-- Detailed information -- Flash 8 game has 2 scenes. Loader, and MainGame Loader scene has the following code in frame 1:

Code:
stop();
onEnterFrame = function()
{

[Code].....

frame 2 has all my dynamically loaded movieclips placed on the stage (since I can't use 'export to frame 1' or that breaks the loader) frame 3 has a bunch of mp3's the game uses (same reason)

MainGame Scene has one frame that has actionscript code that does everything by code alone, loading movieclips and sounds dynamically.

It's that simple, and the loading works perfectly with various bandwidth settings using Test Movie, but once loaded from a website, the loader fails to appear at all, instead you are greeted to a grey box until the game is fully downloaded.

View 1 Replies

ActionScript 2.0 :: Flash8 Function Works But Not When Called By Interval?

Dec 2, 2010

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval.

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */
//////////////////////////

[code]....

View 7 Replies

ActionScript 2.0 :: Mouse Listener / Wierd Focus Bug?

Jan 26, 2009

I have a flash piece that replaces the mouse with a knife/sword graphic. When the user clicks (anywhere) the knife animates, 'slashing' the background. The click does something like..knife.gotoAndPlay(2);The animation is about 10 frames long... The problem is sometimes the click does nothing, as if it takes a single click just to focus the mouse. Rapid-clicking seems to have the desired effect if it wasn't for the aforementioned bug. I've tried a mouse listener as well as the standard on... methods and I'm still having the issue.Also, unfortunately due to client restrictions I'm having to code this flash piece in AS2 as opposed to AS3.

View 1 Replies

ActionScript 3.0 :: Wierd Bug Revolving AddChild And GotoAndStop?

Feb 20, 2009

I have this code:

Code:
upgradesCase.gotoAndStop(upgradesCase.currentFrame - 1);
upgradesCase.addChild(new Powerup());

But for some reason I couldn't see the new Powerup object (the values doesn't reach 0, so it's not the problem), so I kept testing, and found out that if I change it to this:

[Code]...

View 0 Replies

ActionScript 2.0 :: [CS3] HitTest On Moving Objects?

Jan 22, 2009

I'm making a game where a character moves around a level and stays in the centre of the screen as the background scrolls past. I have created a movie clip of an enemy that moves up and down, and used hitTest to stop my character flying through the enemy and also to deduct a point from the score. However, if my character hits the enemy and stays underneath him, the enemy's movement pushes my character out of the screen, and you can no longer see him.

View 3 Replies

ActionScript 1/2 :: HitTest On Multiple Objects?

Jun 29, 2009

Im trying to make a small game. Could someone take a look at the CS4 and CS3 fla files attached and tell me how to make the game reset when the red circle touches the block boxes.

View 7 Replies

Flash - HitTest With Objects From Two Arrays?

Feb 2, 2012

Basically what I'm looking to do is hitTest bullets inside an array (spawn via addChild -> pushed into an array) with another array containing ships (spawn via addChild -> pushed into an array as well).At the moment I have:

function moveEnemyLarge():void{
var target2:EnemyLarge;
for(var i2:int=0;i2<enemyShipArray.length;i2++){

[code]....

.. and a near identical function for the bullets (using variables: i, target).What is the easiest way for me to hitTest the objects within my bullet array with the objects in my ship array. Putting "target" in the PLACEHOLDER slot doesn't work, and from what I've seen some people will shove the one for() inside of the other.

View 2 Replies

ActionScript 2.0 :: HitTest On Multiple Objects?

Jul 1, 2009

I have many black boxes fallling down and i want the game to reset when the black boxes touch my red circle. I used this code for my boxes:

ActionScript Code:
this.createEmptyMovieClip("canvas_mc",10);
myInterval = setInterval(addbox1,500);
function addbox1() {

[Code].....

View 9 Replies

ActionScript 2.0 :: Using HitTest Function With Several Objects?

Apr 16, 2007

I want to make a hitTest functions that detects if a object is hitting any of several objects. Is there a way to do this? I thought I could do this with a array and for loop. But I think that will use to much CPU when this is loaded every frame. Is there any other way?

View 1 Replies

ActionScript 3.0 :: Using A For Loop With Hittest Objects

Apr 19, 2012

I'm trying to get something quite simple to work, but can't figure out what's happening here. I have five identical MCs (Bat characters), and the user can drag a bottle to feed them.

There is a hittest object (called WormEat) inside the bat's head. When the bottle, which is attached to the cursor touches the bat's head, it toggles to frame 2 of the bottle, which should play an animation of the liquid going down to empty.

This code is all working fine, except that when the code toggles to frame 2 of the bottle, it remains static. The animated Movie Clip doesn't play.

If not, perhaps a Switch statement could work, but I'm not sure how to use that method with Hittest..

Code:
var DragArray:Array = [Bat1, Bat2, Bat3, Bat4, Bat5];
for (var i:int = 0; i < DragArray.length; i++) {
DragArray[i].addEventListener(Event.ENTER_FRAME, CollisionWorm);

[Code]....

View 14 Replies

Classic Tweens Not Rotating Objects

Jul 25, 2011

So I just started using Flash CS4 from Flash 8, and I like it so far, but there's on major problem: the "classic tweens" (motion tweens) aren't rotating some of the objects I have. Like there's this flame thrower I drew, and I rotate it at the end of the motion tween, but it doesn't rotate. It will just wait till the last frame and then it will show the rotated frame. Motion works in the motion tweens, but not enlarging or rotating... why? It seems more like a glitch, because sometimes I make a classic tween and it rotates stuff just fine, but sometimes it just doesn't... what am I doing wrong here? What's going on?

View 3 Replies

ActionScript 3.0 :: Reassigning Z Value To Rotating Objects?

Feb 21, 2009

I need to reassign z value to some objects that are rotating in 3d. (see attachment).

This is my code: but it doesn't work:

ActionScript Code:
for (var i:uint=0; i<container.numChildren; i++) {
cont[i]=container.getChildAt(i)
//cont[i].z=cont[i].transform.getRelativeMatrix3D(root).position.z;

[Code].....

View 6 Replies

Flash 10 :: New 3D Tool For Rotating Around Objects?

Jun 21, 2010

Whats the 3d capability in flash cs5, I've been told there is a new 3d tool for rotating around objects. Does that mean an obj import is possible? I am eventually aiming for a series of gear wheels, one facing the screen rotating on its z axis. Is this possible.

View 0 Replies

IDE :: Dragging Objects - Rotating And Easing

Aug 22, 2009

I have two drag-related questions. The first one is how to rotate an object by clicking and holding on it, then moving the mouse round in circles. Think of a clock face, and the user clicking and holding on one of the hands, then spinning it around. The centre point would be the part of the hand that's attached to the middle of the clock face, and the other end of the hand would be able to rotate 360 degrees around the face.

The second one (and not related to the first one, a separate query altogether) is how to drag something horizontally along the screen, but have it stuck at a certain speed. So if the user tries to quickly drag the clip from left to right, it will not reach the right instantly, but instead follow the cursor at a slow speed.

View 1 Replies

ActionScript 2.0 :: Movie With Several Objects - HitTest Repeating

Oct 25, 2010

I have several objects in a separate movie and want to perform a hitTest with them and my other object 'knexman' which is noted below in the script. Basically what's happening is that when I trace the output of the hitTest, it increments about 5 or 6 at a time with each enemy collision running into the knexman object. All I want to do is when objects run into the 'knexman', to increment and trace it by one. Once I get it to increment by one I can accurately conditionalize how many lives are left etc.

onClipEvent (load) {
function reset(){
this._y=0;
this._x=random(600)+300;
enemySpeed=random(15)+5;
this.gotoAndStop(1);
[Code] .....

View 8 Replies

ActionScript 3.0 :: HitTest -- RemoveChild Multipal Objects?

Dec 20, 2010

basically im trying  this code code:

var cur:curFlap = new curFlap  ;
var con:cont = new cont  ;
Mouse.show();

[code].....

View 7 Replies

ActionScript 3.0 :: HitTest Fast Moving Objects?

Aug 26, 2009

I'm just curious how you'd hitTestObject a fast moving object? The problem I'm having is that my bullet seems to skip over large areas depending on the speed. Since the speed of my bullet is 40 pixels per millisecond (I think), it seems to only appear on the stage in instances that are 40 pixels apart, so I cannot hitTest in between those instances.

Here's an image of the bullet patturn as I hold down the shoot button. It just looks like this, unchanging. I won't be able to hit the yellow object ever.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved