banner ad

Sunday, October 05, 2008

Toggle menu v0 »

In a  navigation GUI where the mouse needs to have a hit test before toggling a menu, animate in a tween like effect and stay open as long as the mouse is on the menu. I had written an example in actionScript 2 a while back and rewrote it in AS3....

Monday, July 02, 2007

avoid mouse »

Ever wanted to get the mouse to avoid a perticular region of the stage. This type of thing always comes up when creating banners and games.  This code is designed to prevent mouse from entering a circle of a given radius.  Method is simple, ...

Friday, May 26, 2006

Particles w Collision v2 »

Collision detection was added to my last border detection v2 post to ceate the following script.  Theoretically this relates back to my circle hit detection series.  I needed to make some adjustements to the collision reaction method in order...

Tuesday, May 23, 2006

border detection v2 »

I was not too proud of my last border detection post.  Not that it did not work correctly, I simply found it too long to implement and use. I rewrote the code using the assign direction boolean value trick.   We simply verrifiy if the...

Friday, May 12, 2006

circle hit detection v4 »

It has been a week  that I am tying to figure out a fail safe circular hit detection mehod.  My problem is simple, every time 2 circles collide at high speed the detection triggers too late.  So I turned to Euclidean Geometry, ...

Thursday, May 11, 2006

rectangle collision v2 »

Border detection combined with a good rectangle collision function can create nice effects.  The only thing I added since my last post is the border detection method.

rectangle collision v1 »

Based on Newtons law of motion, my last posts collision function can also be used in the case of the rectangle rectangle hitTest.

Wednesday, May 10, 2006

circle hit detection v5 »

My last post was dedicated to the study of  hit detections in circular shapes and finding a replacement to the faulty flash hitTest method. The following explores what happens when two circles collide.   Collisions involve forces...

Monday, May 08, 2006

circle hit detection v3 »

In my last 2 posts; circle hit detection v1 & v2, I described 2 techniques to detect if circles collide. Both were great at low speeds but reached a breaking point when speeds were increased. Collision simulations in flash is discrete in the...

circle hit detection v2 »

Handling the collisions of two balls colliding in flash is based on the pythagorean theorem. In any right triangle, the area of the square whose side is the hypotenuse (the side of a right triangle opposite the right angle) is equal to the sum of the...

Thursday, May 04, 2006

circle hit detection v1 »

The next few posts are dedicated to the topic of handling the collisions of two balls. To correctly calculate the collision, we first calculate the area a clip traveled since the last enterframe, we calculate this from the x|y coordinates the old clip...

border detection »

How can I be so dumb as to have forgotten to post the basics of border detection.  Attach a bunch of clips to the stage, give them a speed (vx,vy) and change their x|y values on enterframe. Border detection  verrifies which direction...

Wednesday, May 03, 2006

rectangle to rectangle hitTest »

To detect that a collision occurred between two rectangles using the hitTest movieClip property can be limiting. You may need to accept lower accuracy or you could use some fancier programming. The following example computes the left and right...

Tuesday, February 14, 2006

3D linked menu v2 »

On of the things that bother me the most about using 3D cameras in flash is the fact that once you set one on your stage you are stuck in a 3D world almost everywhere on the stage.  If you had mouse detection moving the 3D menu but you did...

Wednesday, January 18, 2006

OSX derived menu »

 Looking at the OSX menu post and the oscillating movement post; I got a cool idea.  What if the menu wold have an osscillating  y axis. // Radian Conversion var radians:Number= (_clip._x/180) * Math.PI; // y position will be y...

Wednesday, January 11, 2006

OSX menu part 4 »

We can create a Menu that looks like the Mac OSX menu by combining the two hitTest  techniques (the hi lo technique and the Math hitTest). Both have their advantages and disadvantges and serve the purpose of this experiment OSX menu kinematics...

hi lo hitTest »

Simulating the mvieClip hiTest method can also be done with the hi lo method.  What does hi lo stand for, simply the highest point of impact and the lowest point of impact.  Mind you we can also call it the hi lo left right technique but...

Tuesday, January 10, 2006

Math HitTest part 2 »

As seen in the previous example, the new hitdetection method can verrify if the mouse hits the clip on either side of the clips x coordinates.  If we want to add the y coordinates and get a full blown hittest method we add the variables that caluclate...

math hitTest part 1 »

The flash buld in HitTest method has always been somehow limited and excessively CPU intensive when used by many clips at one.  Reliability has also been a factor.  What I want to do is to get a sprite to scale in size once it' rolled...