In ActionScript 2 simple Collision detection?

I'm doing a simple maze game, but the collision detection doesn't work. I have the player moving with the arrow keys, and I'm doing so that when the player collides with the wall, it goes to a certain range. I have this code in the wall clip:

onClipEvent (enterFrame) {}

If (_root.player.hitTest (this))

{

gotoAndStop ("death");

}

}

Name of the instance of the player's 'player' and the wall instance name is "walls1". When the player hits the wall, the player goes right through it. I'm sure it's something with the collision, not the 'gotoAndStop ("death")"; because I've tested it with "gotoAndStop (5);" and the player is still through the wall.

If someone could help me, I would really appreciate it. Thanks in advance!

What object expect you goto frame 5 ("death")?

You should move your code to the main timeline and target objects.

Tags: Adobe Animate

Similar Questions

  • Animate simple Collision in edge detection

    I'm new to lively edge and I created a game in which a player moves their character left and right on the screen, trying to avoid colliding with the other characters. I searched for a good and simple collision detection function/algorithm/plug-ins use to detect these collisions.

    The characters are all simple rectangles (convex?) and the other characters move vertically along the y-axis while the character of the hero can move left, right, upwards or downwards. I have 2 two questions that I can't solve right now:

    1. how to keep my character of heroes within the scene (I don't want him to go off the stage when the Player tries to move it left/right/etc... too far;)

    2. how to I detects collisions between hero and 20 characters or other character that drive up and down along the y axis?

    My thoughts are that inclusive would be all that is necessary for this game pretty simple because I don't have a lot of characters to check collisions and my characters are all rectangles. I stripped down so that two objects on the stage (a blue and red rectangle) and I overlap right now (should indicate a collision) and tried to implement the following code to detect the collision. I put this function in the action of compositionReady:

    var Object1 is sym. $l ("BlueRectangle");

    var object2 = sym.$("RedRectangle");

    If (object1.x < object2.x + object2.width & & object1.x + object1.width > object2.x & &)

    Object1.y < object2.y + object2.height & & object1.y + object1.height > object2.y) {}

    The objects are in contact with

    Alert ("Oops! You crashed! ») ;

    setInterval (sym (e), 35);

    }

    But it nothing happens when I test the project hosted in a browser. No alert occurs. What I am doing wrong?

    Once I understood how to apply the code to run the detection of collision for several rectangles that could collide with my hero character?

    How to set the interval to periodically check the collisions and what is refresh rate?

    Any help would be greatly appreciated!

    Here is another resource that can help you to understand this: http://paultrani.com/2013/02/drag-drop-in-edge-animate/

  • Management change of HPSMH Collision detection

    Hello world

    We want to just implement collision detection mechanism in the management of change HPSMH. That means that if a CR was raised with a service assigned within a specific date range (say from 2nd to 4th month) .then if any new CR is triggered with the same affected service in the same amount of time then it will show a validation that the services concerned has already been used in a few other CR in the same amount of time.

    Hello and welcome to the HP support community!

    You have posted this question in the section the Community Forum of HP Android tablets.

    According to me, that's not the right area for your question.

    Myself, I have absolutely no idea what you're talking about!   :/

    WyreNut

  • Collision detection changes the location of the MovieClip at random?

    Hello

    I was woundering how I had to code a program in AS3 on collision detection, it would change one of the objects collide at a random X & Y location?

    something like that, but works...?

    ship.addEventListener (Event.ENTER_FRAME, enter_frame);

    function enter_frame(event:Event):void {}

    {if (Ship.hitTestObject (target)}

    Target._x = random (1000)

    Target._y = random (1000) ;}

    }

    Found how do, but it does not work

    It is an AS2 implementation using the random method in your event handler function.  For AS3, use the Math.Random () as a multiplier and the properties of AS3 position (x / y, not _x/FLF).

    ship.addEventListener (Event.ENTER_FRAME, enter_frame);

    function enter_frame(event:Event):void {}

    {if (Ship.hitTestObject (target)}

    Target.x = Math.random () * 1000;

    Target.y = Math.random () * 1000;

    }

    }

  • Table element collision detection

    Hello!

    This is part of my code:

    var boxArray:Array = [];
    //...
    function init():void {
        stage.addEventListener(Event.ENTER_FRAME, loop);
    }
    
    function loop(e:Event):void {
    //...
    
    if(boxArray.length == 0){
            var totalX:int=9;
            var totalY:int=8;
            var spacing:Number = 10;
            var box_mc:MovieClip;
    
            for(var i:int = 0; i < totalX; i++){
                for(var j:int = 0; j < totalY; j++){
                    box_mc = new Box();
                    boxArray[i] = box_mc;
                    box_mc.instanceName = "box"+i+j;
                    trace (box_mc.instanceName)
    
                    box_mc.x = 80 + i*(box_mc.width+spacing);
                    box_mc.y = 70 + j*(box_mc.height+spacing);
                    addChild(box_mc);
    
                    trace (boxArray.length)
                    //---------------------------------------------it works:)
                }
            }
        }
    //there i need to add collision detection for array elements with "ball". Ball is a movie clip on stage.
    //need something like that i think:
    
    function collision(){
            var target = one of array element:)
    
            if(boxArray[target].visible==true){
                if (boxArray[target].hitTestObject(ball)==true) {
                    ballSpeedY*=-1;
                    score=score+100;
                    trace ('Score= ' + score);
                    boxArray[target].visible=false;
    
                }
            }
        }
    
       collision();
    
    
    
    //...
    }//end loop
    

    If anyone can help me I will be grateful

    Greetings and sry for my English :)

    In your collisionDetector function you want to set up two loops as you did when you created them to be able to go through all.  If you were to store in a single dimension table, it would be a loop less to deal with.  If you want / can do depends on if you need to retain the knowledge where the boxes are compared to the i / j clues when it comes to the "/ / do something ' is part of the treatment.

    In order to store in a single dimension table just use the push() method of the array class instead of their assignment with the brackets [i] [j].

  • Slider &amp; amp; Collision detection issue

    I couldn't find anything to help solve my problem thanks to my various research and turned to the publication. First - I am strictly a fan and try to create a timeline of the biography of a genealogy site that I am building.
    I have a scroll bar with a graph like the dredger pocket watch. What I hope to achieve, is that when the Watch has crept along the timeline and is is arrested on a marker (shown as a year), I'd like to pop up the relevant text on this date in time.

    My cursor is a movieclip and markers of the year are buttons. Through my research, it seems that I need to use both the collision detection and a certain type of load a script attached to it. It is quite possible that I am too far from my skill level, but I wanted to tender hand in case there may be help for me.

    I don't really have any code to show that I am very uncertain as to what would be the code appropriate to begin with. You can see an example of what I'm trying to accomplish here-> my scroll bar

    I currently have the text attached to the "over" frame in the button for example.

    Thank you in advance,
    Randy

    Hello

    A quick solution to a situation that involves no collison detection must follow the x position of your clock instead, Minesweeper movieclip. You can use collision detection if you want, but by the way you set up your movie, it will involve a lot of targeting and recovery of the property. This track requires that you only add a few lines to a code you already have.

    Follow these steps

    (1) from the main stage, double-click your mc with the clock and the line in. Create a new layer and put 2 on that dynamic text boxes. Give the first instance of 'xpos' name text box and the other an instance name of "marker". XPos position near the bottom right of the scene and the marker on the opposite side. We will use these boxes for testing.

    2) click on the Actions layer and look for the line that says:

    ratio = Math.round (this._x);

    This guy below

    XPos.Text = report;

    Test your movie and you should see your x on the lower post update when you drag the clock. By working? Well, that's what we want.

    (3) according to the type of line last in what follows

    space var = 3;

    If (ratio > 36 - space & ratio)<>
    Marker.Text = "1900";
    } else
    If (ratio > 172 - space & ratio)<>
    Marker.Text = "1915";
    } else
    If (ratio > 399 - space & ratio)<>
    Marker.Text = "1945";
    }

    OK - explanation - what is happening here is to check if the clock is on one of the markers and we send the right text to the other created textbox marker information previously. If you test your animation and drag toward the center of the 1900 marker you will see its position x is about 36. The space variable adds or subtracts 3 on this position so that we have a good size "struck the area. In other words, if the x position is between 33 and 39 while we are on the marker of 1900. 1915 marker is the same with the other two - between 169 and 175, between 396 and 402 is marker of 1945.

    You can now replace the marker.text = "1900" line with what you want. You can make the box marker text a movieclip and it melted or slide in with the information you want.

    If it helps, then remember to delete the xpos off stage text box and delete the line of script that uses it. It was just to test.

    Here's the complete code

  • Collision detection - then click on next picture

    Hello
    I just took the collision detection works on my classes, but I was not able to get the movie to go to another frame on the collision. What's my problem - I can't use go to 'Film1' in the handle on me, Manager of collisionData. For some reason, it won't let me SO I tried to call another Manager to the statement, moviejump = true. It also did not work - pointers please? Thanks for any help!

    Just set a variable in your collision Manager (a global variable would be easier), which means a frame break. for example:

    on ' t handle me, collisionData
    frameJump = true
    end

    Then, during your exitFrame script, check if this variable has been set:

    on exitFrame me
    If frameJump then
    go to section 3
    end if
    end

    -Ben

  • collision detection: custom class and table

    so I do a shooter from top to bottom for the pleasure, but have been struggling as I am new to programming.

    I have

    var player: player = new Player();

    enemy var: Array = new Array();

    now I searched on the net, but that's what I tried to work with.

    public void checkCollisionWithShip(): void {}

    for (var e = Enemies.length - 1; e > = 0; e-) {}

    If (Enemies [e] .hitTestObject (player)) {}

    trace ([e] Enemies);

    Life = 1;

    updateUI();

    trace ("ship collision!");

    }

    }

    }

    However, whenever my (player) ship hits an enemy, nothing ever happens.

    looking forward to your answers.

    Thank you very much for your time.

    Unfortunately the code that you decide should be shown is not code that needs to be shown.  Which calls the function where the collision is detected?  I don't see anything for this.

  • Collision detection

    Hi, so I applied a few detections of collision on walls using a table. Now I'm stuck when he tries with a single clip (see code). I get an error of syntax of 1084.

    below is what I got so far:

    import flash.display.Stage;

    import flash.display.MovieClip;

    import flash.events.KeyboardEvent;

    import flash.utils.Timer;

    import flash.events.TimerEvent;

    Variables

    var player: Player = MovieClip;

    var pDir:String = new String();

    var pStepSize:int = 5;

    var wallArray:Array = new Array (wall1, wall2, wall3, wall4, wall5, sidewall1, sidewall2, sidewall3, sidewall4);

    var purse: MovieClip = hands;

    var gameTimer:Timer = new Timer (0);

    Identical to gameTimer but then using an ENTER_FRAME (a loop with your framerate speed);

    stage.addEventListener (Event.ENTER_FRAME, __ontick__);

    Init

    Player.Stop ();

    IRDP = "NONE";

    gameTimer.delay = 25

    gameTimer.repeatCount = 0;

    gameTimer.start ();

    Events

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyPressedDown);

    stage.addEventListener (KeyboardEvent.KEY_UP, keyPressedUp);

    gameTimer.addEventListener (TimerEvent.TIMER, __ontick__);

    Functions

    function onTick(e:TimerEvent):void

    {

    movePlayer();

    rotatePlayer();

    collisionDetectPlayer();

    }

    function __ontick__ when using an ENTER_FRAME event

    /*

    function onTick(e:Event) {}

    movePlayer();

    rotatePlayer();

    collisionDetectPlayer();

    }

    */

    function keyPressedDown(e:KeyboardEvent) {}

    var: key: uint = e.keyCode;

    if(Key == Keyboard.Left) {}

    IRDP = 'LEFT ';

    Player.Play ();

    }

    if(Key == Keyboard.Right) {}

    IRDP = 'RIGHT ';

    Player.Play ();

    }

    if(Key == Keyboard.up) {}

    IRDP = "UP";

    Player.Play ();

    }

    if(Key == Keyboard.Down) {}

    IRDP = "DOWN".

    Player.Play ();

    }

    }

    function keyPressedUp(e:KeyboardEvent) {}

    var: key: uint = e.keyCode;

    If (key == Keyboard.LEFT |)

    key == Keyboard.RIGHT |

    key == Keyboard.UP |

    key == Keyboard.DOWN) {}

    IRDP = "NONE";

    Player.Stop ();

    }

    }

    function movePlayer() {}

    If (IRDP == 'LEFT') {}

    Player.x = pStepSize;

    }

    If (IRDP == 'RIGHT') {}

    Player.x += pStepSize;

    }

    If (IRDP == 'UP') {}

    Player.y = pStepSize;

    }

    If (IRDP == 'DOWN') {}

    Player.y += pStepSize;

    }

    }

    function rotatePlayer() {}

    If (IRDP == 'LEFT') {}

    Player.rotation = - 180;

    }

    If (IRDP == 'RIGHT') {}

    Player.rotation = 0;

    }

    If (IRDP == 'UP') {}

    Player.Rotation = - 90;

    }

    If (IRDP == 'DOWN') {}

    Player.rotation = - 270;

    }

    }

    function movePlayerBack() {}

    If (IRDP == 'LEFT') {}

    Player.x += pStepSize;

    }

    If (IRDP == 'RIGHT') {}

    Player.x = pStepSize;

    }

    If (IRDP == 'UP') {}

    Player.y += pStepSize;

    }

    If (IRDP == 'DOWN') {}

    Player.y = pStepSize;

    }

    }

    function collisionDetectPlayer() {}

    for (var i: uint = 0; i < wallArray.length; i ++) {}

    var wallTemp:MovieClip = wallArray [i];

    {if (Player.hitTestObject (wallTemp))}

    movePlayerBack();

    }

    }

    function collisionDetectMoneybag() {}

    If (player.hitTestObject (moneyBag) == true) {}

    If (dir == 'LEFT') {}

    Move the drive

    Player.x += 1;

    }

    If (dir == 'RIGHT') {}

    Player.x-= 1;

    }

    If (dir == 'UP') {}

    Player.y += 1;

    }

    If (dir == 'DOWN') {}

    Player.y-= 1;

    }

    }

    }

    What Miss me? Help is very appreciated!
    Matt

    If you read the error message is indicating a syntax error... He said that a final brace is missing.

  • Collision detection problem

    Hey guys,.

    I practice so the creation of a platform game. I have a movement system works, but when you try to add collision with platforms I have a problem.

    I did add each platform in a table and then check for the collision between the player and each platform, since I have just a bunch of instances without the platform symbol name on my stage. The problem with this is that my jumping code, I use a Boolean "onGround" value, which determines whether or not the player is "on the ground". And since my loop "foreach" across ALL platforms, even if the player is on a platform of some, there are other, it won't, and if it returns the onGround Boolean false.

    It's a problem with my code of jumping in general, I wonder where I get out of here. If I need to change my code from jumping, or change the collision, or what. Any ideas would be great. Here is my code:

    package  
    {
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.KeyboardEvent;
        import flash.display.DisplayObject;
    
        public class Main extends MovieClip
        {
    
            var arrowUp:Boolean = false;
            var arrowDown:Boolean = false;
            var arrowLeft:Boolean = false;
            var arrowRight:Boolean = false;
    
            var arrowUpReleased:Boolean = true;
            var arrowDownReleased:Boolean = true;
            var arrowLeftReleased:Boolean = true;
            var arrowRightReleased:Boolean = true;
    
            var onGround:Boolean = undefined;
            var isJumping:Boolean = undefined;
    
            var vx:Number = 0;
            var vy:Number = 0;
            var acceleration:Number = 1;
            var gravity:Number = 0.3;
            var jumpForce:Number = 7;
    
            var speedLimit:uint = 6;
    
            var platformArray:Array = new Array();
            var platformNumber:uint = 0;
    
            var thePlatform:MovieClip;
    
            public function Main() 
            {
                stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
                stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
                stage.addEventListener(Event.ENTER_FRAME, update);
    
                for (var i:uint = 0; i < numChildren; i++)
                     {
                         if(getChildAt(i) is Platform)
                         {
                             platformArray.push(getChildAt(i));
                         }
                     }
                for each (var platform:DisplayObject in platformArray)
                {
                    if (platform.hitTestPoint(player.x, player.y + 20, true))
                        {
                            vy = 0;
                            onGround = true;
                        }
                }
            }
    
            function keyPressed(event:KeyboardEvent):void
            {
                if (event.keyCode == 37)
                {
                    arrowLeft = true;
                    arrowLeftReleased = false;
                }
                if (event.keyCode == 38)
                {
                    arrowUp = true;
                    arrowUpReleased = false;
                    isJumping = true;
                }
                if (event.keyCode == 39)
                {
                    arrowRight = true;
                    arrowRightReleased = false;
                }
                if (event.keyCode == 40)
                {
                    arrowDown = true;
                    arrowDownReleased = false;
                }
    
            }
    
            function keyReleased(event:KeyboardEvent):void
            {
                if (event.keyCode == 37)
                {
                    arrowLeft = false;
                    arrowLeftReleased = true;
                }
                if (event.keyCode == 38)
                {
                    arrowUp = false;
                    arrowUpReleased = true;
                    isJumping = false;
                }
                if (event.keyCode == 39)
                {
                    arrowRight = false;
                    arrowRightReleased = true;
                }
                if (event.keyCode == 40)
                {
                    arrowDown = false;
                    arrowDownReleased = true;
                }
    
            }
    
            function update (event:Event):void
            {
    
                //ACCELERATION
                if (arrowLeft)
                {
                    if (vx > 0)
                    {
                        vx = 0;
                    }
                    if ((Math.abs(vx)) < speedLimit)
                    {
                        vx -= acceleration/2;
                        player.x += vx;
                    }
                    else
                    {
                        player.x += vx;
                    }
                }
                if (arrowRight)
                {
                    if (vx < 0)
                    {
                        vx = 0;
                    }
                    if (vx < speedLimit)
                    {
                        vx += acceleration/2;
                        player.x += vx;
                    }
                    else
                    {
                        player.x += vx;
                    }
                }
                if (arrowUp && onGround)
                {
                    vy = -jumpForce;
                }
    
                //DECELERATION
                if (arrowLeftReleased)
                {
                    if (vx < 0)
                    {
                        vx += acceleration;
                        player.x += vx;
                    }
                }
                if (arrowRightReleased)
                {
                    if (vx > 0)
                    {
                        vx -= acceleration;
                        player.x += vx;
                    }
                }
    
    
                //GRAVITY
    
                player.y += vy;
    
                if (!onGround)
                {
                    vy += gravity;
                }
                if (onGround && !isJumping)
                {
                    vy = 0;
                }
                if (vy > 0)
                {
                    onGround = false;
                }
                else
                {
                    onGround = true;
                }
    
                //COLLISION
    
                for each (var platform:MovieClip in platformArray)
                {
                    if (platform.hitTestPoint(player.x, player.y + 20, true))
                    {
                        vy = 0;
                        onGround = true;
                    }
                    else
                    {
                        onGround = false;
                    }
                }
    
                trace (onGround);
            }
    
        }
    
    }
    

    Thank you

    PS what is happening right now with that code is that the player hit the platform and stops, but onGround rest false

    Probably, there is too much code for anyone to really go. However, from what you said on your loop for:

    for each {(var plate-forme: DisplayObject dans platformArray)}

    If (platform.hitTestPoint (player.x, player.y + 20, true)) {}

    Vy = 0;

    onGround = true;

    }

    }

    I think what you want is to put a break; in there right after onGround = true; -C' is to say stop the treatment when you find a ground plan.

    Also, there are a couple of collision of good systems out there that might make this a little easier and more robust. Take a look at the Kit of detection of Collision (CDK):

    https://code.Google.com/p/collisiondetectionkit/

  • Collision detection - falling through objects

    * EnglishVersion follows after German *.

    Hallo Zusammen,

    ICH habe ein ernsthaftes problem in Flash. Ich bin ganz gut actually in der Materie und programiere just Jump & Run Spiel ein drin.
    However kommt are just dennoch zu einem ernsthaften problem, das ich nicht losen kann.
    Wenn ich in meinem Spiel die Figur bewege, soll sich nicht die Figur, das level therefore does moving. Dabei gibt yesterday are several container, as opponents as Bonus usw items und die.
    Alle haben eine "Gravitation" (im ENTER_FRAME) objects, fallen die dafur sorgt, dass sie nach unten, wenn sie nicht auf einen auftreffen Boden.
    Works das im Prinzip recht einfach, dass nur verschiedener Ebenen durcheinander hindurchfallen objects. Das vielleicht liegt an den (localToGlobal) - Koordinaten oder so something?
    Konkret ist das problem, dass objects additional einer Ebene (bsp. eine "Bonusitem-ebony") durch den Boden (der "Boden-ebony") fell. Objects, die der Ebene wie der Boden sind, das nicht however tun same.

    ICH habe das bad als Helferinelement CS3 sales, so dass ihr euch das problem anschauen könnt.
    Der link pesimos:
    www.Tobias-Reich.de/flashproblem.fla

    Yesterday ist auch noch der once Code:

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    / * Press the keys for a while see what happens! * /
    addEventListener() event. ( ENTER_FRAME, fall();
    Stadium. addEventListener () KeyboardEvent. ( KEY_DOWN, move();
    ( var ballLayer:MovieClip = new MovieClip()();
    addChild ()ballLayer ();
    / / ball is down-> falling down after a certain time
    var ball:MovieClip = new ball()();
    ball. x = 100;
    ball. y = 150;
    ballLayer. addChild (ball);
    / / ball on the same layer-> it works perfectly fine!
    var ball2:MovieClip = new Ball2()();
    ball2. x = 120;
    ball2. y = 150;
    ball2 addChild ()();
    var field:MovieClip = new Ground()();
    on the ground. x = 100;
    on the ground. y = 200;
    field of addChild ()();
    function ( ()eautumn: event():void { }
    if () ! on the ground. hitTestPoint () ball. x, ball. y, true)){
    ball. y +=5;
    }
    if () ! on the ground. hitTestPoint () ball2. x, ball2. y, true)){
    ball2. y +=5;
    }
    }
    ( function move()e: KeyboardEvent ():void { }
    on the ground. x +=5;
    ballLayer. x +=5;
    ball2. x +=5;
    }

    PS Mir ist klar, dass im Spiel right in own Klassen und nicht naturally in der chronology programmiert wird. DAS nur der yesterday dient der Situation Einfacheit.
    I hope, ihr mein problem being.
    Ich bin ratlos, half mir bitte!

    Alles gute und einen guten Rutsch ins Neue Jahr.

    Tobias

    ----------------------------------------------

    Hello

    I have a serious problem with the Action Script. I'm about to code a new Jump & Run game with a simple gravity engine.


    And that's where I got my problem I can't solve.

    When you move the player through the levels, I want to spend the layers instead of him. If the player remains in a way where it is but the enemies, the Earth, elements... move around - as in most of these games.

    Gravitation is expected to affect every article/enemy (by ENTER_FRAME) and moves each object down until it touches the ground.

    The problem is, somehow objects of different layers do not get the right hitTest to information. So when two objects--the first on the same layer on the ground, moving both, all right. But as soon as I put the object in a container separated as 'itemsContainer:MovieClip' and I suggest that the subject is not getting the right result for hitTestPoints. (Maybe it has something to do with localToGlobal?)

    So, after a certain time when you move the ground and the itemLayer, it does not control its still on the ground and falls "down" - off the stage...

    I kept the code for you in a separate file of CS3. I hope that someone can see this problem and knows a response!

    Tobias-Reich.de/flashproblem.fla

    For those who do not want to download the code:

    ActionScript code:
    / * Press the keys for a while see what happens! */
    addEventListener() event. ( ENTER_FRAME, fall();
    Stadium. addEventListener () KeyboardEvent. ( KEY_DOWN, move();
    ( var ballLayer:MovieClip = new MovieClip()();
    addChild ()ballLayer ();
    ball is down-> falling down after a certain time
    var ball:MovieClip = new ball()();
    ball. x = 100;
    ball. y = 150;
    ballLayer. addChild (ball);
    ball on the same layer-> it works perfectly fine!
    var ball2:MovieClip = new Ball2()();
    ball2. x = 120;
    ball2. y = 150;
    ball2 addChild ()();
    var field:MovieClip = new Ground()();
    on the ground. x = 100;
    on the ground. y = 200;
    field of addChild ()();
    function ( ()eautumn: event():void { }
    if () ! on the ground. hitTestPoint () ball. x, ball. y, true)){
    ball. y +=5;
    }
    if () ! on the ground. hitTestPoint () ball2. x, ball2. y, true)){
    ball2. y +=5;
    }
    }
    ( function move()e: KeyboardEvent ():void { }
    on the ground. x +=5;
    ballLayer. x +=5;
    ball2. x +=5;
    }
    PS of course, I know I'm not supposed to code in the timeline, but I did it for you allows to easily see the point.

    I hope someone could help me with this. I'm quite desperate!

    Have a happy new year to you all!

    There is no rule that says that you cannot use the timeline... feel free to ignore someone who insists it is not.

    The problem arises because your ground is gradually moving to the right, its x property increases, but the ball (ball) is not (ballLayer is).  Thus, when the ground is moving beyond this property of the ball x - 100 (which is inside the ballLayer)...

    If (! ground.hitTestPoint (ball.x, ball.y, true)) {}

    becomes a real condition and the first ball falls.  Given that the other, ball2, is moved, its x property is changing as the terrain changes.  I don't know if what follows will give you the result you expected and after, but it is more in line with what you are doing...

    If (! ground.hitTestPoint (ballLayer.x, ball.y, true)) {}

    .

  • Placement test / collision detection and HAVE

    Hello
    I am trying to find a way to perform a hit test on an object on the stage. The object makes its appearance through actionscript (block)
    and the object that it is player.
    This will work once I put the block on the scene not manually and not through actionscript, but I want the code allows to call the block because I called several blocks.
    See attached code...
    Could someone please tell me what I'm doing wrong?
    is it not possible that way?

    Thank you!

    Dear adamlewen
    If you want to remove each hittest movieclip, you must do it in a loop "for". so you can detect the hit test and make the corresponding visual effect.
    Here is a sample file: take a peek...
    you have some problem with naming movieclips that I think...
    you duplicated in your table, the elements that cause conflicts

    http://www.parspake.com/Majid/Flash/adamlewen.fla

    good luck and feel free to contact me if you have another problem
    concerning
    MajiD

  • Simple PLATFORM detect script?

    I hope there is a simple solution for that - I operational requirement before Monday.

    I built two versions of a simple site: one stupid version for cel phones/blackberrys, etc., a sensitive version for regular ol ' Mac and PC. The version of cel is the default page. One of the computers is in a subfolder.

    Rather than enter a complex script that will endeavour to take account of all types of pocket which could hit the site, it seems it should be easy to detect for Mac & PC with javascript simply and deliver them accordingly in the subfolder. Handhelds should ignore just javascript and stay where they are... right?

    I'm not a javascript person, though - so if anyone has a simple script that does this, I would be very grateful.

    Also, is my hypothesis on the handhelds simply ignoring javascript fix, or will they choke on it and does not make the page?

    Thank you very much!

    A few responses:

    http://www.hand-interactive.com/resources/detect-mobile-JavaScript.htm

    Includes a file to include downloadable javascrript. Then, just make a call to DetectMobileLonger() which returns a Boolean value. If it is false, redirect.

    Works fine now.

  • the interference of tiles collision detection

    Hi, I have a bunch of tiles, I try to use as walls for the avatar (maze in place) and I encountered a problem with the detection of collision between two bricks and an avatar, as well as several instances of the same brick. Code attached.

    the_wall is a string. to help the flash to convert this string into a table to use object notation:

  • HP Simple pass - detects not fingerprint reader

    Hello

    This is my first post so I apologize if it appears in the wrong place. I'll have a problem with the fingerprint reader and HP simple pass identity protection software that came with my Dv6-3121nr. For some reason any all of a sudden since this morning it will not work. There is no light on the sensor, and it fails every time and movement. When I run the single pass software and go to the fingerprint section, it shows the fingerprint reader is not connected. Interestingly, when I go to Device Manager I see no biometric devices listed under there. I read on another thread that some options below biometic devices in Device Manager solves the problem.

    I already tried pass Simple uninstall/reinstall the Recovery Manager and also uninstalled and updated validity sensor but still no go.  Here are some other details:

    Laptop model: Dv6-3121nr

    Operating system: Windows 7 premium 64-bit

    Paleoclimatology sensor DDK version: 4.1.139.0

    I can't find any other information on how to solve it. Can anyone help?

    Thanks a bunch!

    Hello SM1251,

    I looked at your laptop and there is no Windows 8 drivers for it.  Have you tried to install the driver of Windows 7 in compatibility mode?

    1. Visit the HP Support and download the Windows 7 drivers for the hardware that you want to try.
    2. Download the driver to your desktop.
    3. Allow extraction until the complete but close the installation process, when it comes to the top.
    4. Navigate to the C:\swsetup\ folder.  You will see your driver listed here.  They usually have a name such as "sp48918".  Navigate to this folder.
    5. In the folder of your driver, you will see a file "setup.exe".  Right-click on this file and select Properties.
    6. Go to the tab "compatibility".
    7. Click on the box that says "Run this program in compatibility mode dethrone" and also select Windows 7 in the menu dropdown.
    8. Check the box that says "Run this program as an administrator", below.
    9. Save these changes, and then double-click the "setup.exe" to start the installation.
    10. Once installation is complete, restart your PC and check the functionality of the hardware.

    Please let me know if this helps solve your problem.

    Good luck!

Maybe you are looking for