ActionScript 3.0 :: Image Transparency And HitTestPoint?

Jun 26, 2011

I'm not sure this is even possible, but does anyone know how to get the hitTestPoint function to ignore transparency for a MC containing a png image?

View 1 Replies


Similar Posts:


HitTestPoint All The Way Or Check If Distance < Something First Then HitTestPoint?

Jan 1, 2011

Which one is more efficient? Or is there even a noticeable difference? I did tests of a circle moving closer to a square and stopping when hitTestPoint returns true. The square was at 0 and the circle was at 500. My first test I did using hitTestPoint the entire time, my second test I did by checking the distance (Pythagorean Theorem way) and if it's below 50 then check with hitTestPoint.

I compared the FPS of each test but they were the same at 30 FPS with 200 circles and at 11-12 FPS with 500 circles. I thought the first test would be slower because I was testing every pixel the entire time while the second test I was only calculating the distance for the most part before testing every pixel.

View 2 Replies

Bring In An Image With Transparency In Flash CS4?

Oct 21, 2009

What's the best way to bring in an image with transparency in Flash CS4?I have a logo in Photoshop that looks great on a black background.  But when I bring it in as a GIF or PNG in Flash, the edges get really jagged.Is there a preferred way to import this so the edges are smooth?

View 2 Replies

ActionScript 3.0 :: Transparency In A Loaded JPEG Image?

Oct 10, 2008

Im quite new to the ActionScript scene so apologies if thisquestion has already been answered elsewhere. I am creating a 2dshooting game, and Im loading multiple images of various enemiesfrom several jpg files, but when I display these on screen heimages have a big black square round them. Now when I amprogramming in another language such as OpenGL, if I wanted to getrid of this I would enable an alpha blending function and set 100%transparency for the black colour which I want to hide. So I loadthe jpeg file and store it in a BitmapData variable, and then Icopy this into a new BitmapData variable with transparency enabledand set to 0x00000000 (fully transparent black). I thought thiswould solve my problem butt no joy. My code is shown below:public class GraphicsLoader extends Sprite {

public var loader:Loader; // The bitmap loader
public var bmp1:Bitmap;
public function GraphicsLoader(path:String)

[code].....

View 4 Replies

Actionscript 3 :: Duplicating A PNG Image Causes Loss Of Transparency

Nov 10, 2011

I am using LoaderMax to load an external PNG and display it in many places so I use the following code to duplicate the image:

[Code]....

View 2 Replies

Export Flash Image To Illustrator : Bad Colors And No Transparency?

May 15, 2008

I've tried to export my vector work from Flash to Illustrator. The result is bad : colors have faded and transparent colors became opaque. It is a shame that Flash doesn't provide a correct export function to
Illustrator now that Flash and Illustrator are both Adobe's softwares.

View 1 Replies

Flash :: Change MovieClip Transparency As A Single Image?

Aug 27, 2010

Here is my code:

var menu = new Menu ();
menu.x = 0;
menu.y = 0;[code]...........

This works, but transparency varies for each element MovieClip separately, but I would like that would have changed the whole MovieClip transparency as a single image.

Menu(); is generated from XML.

View 2 Replies

ActionScript 3.0 :: Force The Tint To Cover The Entire Image, Including The Transparency?

Oct 13, 2010

I am using TweenMax to animate a PNG with some transparency. With TweenMax, I add a tint to the animation.

When the tint is applied, it obviously only tints the non-transparent part of the bitmap.

Is there any way to force the tint to cover the entire image, including the transparency?

View 1 Replies

HitTestPoint Is Not Working?

Jun 15, 2010

I'm trying to make a simple platform shooter game, although I just cant seem to get jumping right. hitTestObject works fine, but hitTestPoint doesn't seem to work at all.[code]on that last bit, if I use hitTestObject instead, it works fine, but when i use hitTestPoint, I just fall through the ground as if nothing is there.and I want to use hitTestPoint so I can make floating blocks

View 2 Replies

ActionScript 3.0 :: Why Is HitTestPoint Not Working

Jun 9, 2011

I'm probably missing something about which parameters I'm supposed to be passing.Here is the code:In the first class (the hitting object belongs to this class):[code]It always traces "Didn't work" when I drag the instance of the first class over the instance of the second class. What am I not understanding about the hitTestPoint function?

View 16 Replies

ActionScript 3.0 :: CacheAsBitmap And HitTestPoint?

Sep 19, 2011

Why does hitTestPoint isn't working on DisplayObjects that has cacheAsBitmap set to true?It does work, but it takes the Whole rectangle of Display object, not respecting wheather or not pixel is transparent or not (transparent pixels return true after hiTestPoint)

View 3 Replies

ActionScript 3.0 :: Cant Get HittestPoint To Work?

Jan 20, 2011

im trying to create a menu that drops down when you roll over it. however I cant get hittestPoint to work.I have a movieClip on my stage with a class attached. Inside this movieClip is another movieClip with an instance name of "hitBox"

ActionScript Code:
package {
import flash.display.*;
import flash.events.*;[code].....

Is it possibly to do with the mouseX and mouseY being local?

View 1 Replies

ActionScript 3.0 :: HitTestPoint Not Working Right

Nov 20, 2011

Anyone know why "hitTestPoint(character.x, character,y, true)" would be hit testing off the origin point in the center of the character, and not the whole shape??This is my code from my document class. There's a custom splat class in there, but don't worry about that. This code is inside 2(1 nested) for loops.[code]

View 1 Replies

ActionScript 3.0 :: HitTestPoint & Mouse_move?

May 19, 2009

I have been using hitTestPoint so far with mouse_move listener, which means if the mouse was stationary over target area when that listener was added the desired action wont happen until mouse moves.

Basically I have this window in the middle of the stage where loader loads pictures and when picture loads if the mouse moves over that window some other stuff appears.The listener is added after each picture is added and if the mouse was stationary above the loader when that happened it doesnt trigger hitTestPoint (until mouse moves).

I have seen somewhere this same effect, but it worked even if the mouse was stationary above the image when image appeared.

[Code]...

View 2 Replies

ActionScript 3.0 :: HitTestPoint Not Working?

Mar 3, 2011

I have the beginning of a game that looks a bit like Asteroids. The first version of the game worked, but was very code-heavy (every object was individually coded) so I decided to move the bulk of the code to document classes.

I wanted to have certain objects interact with eachother (bullets with asteroids, asteroids with ship, etc.) but they can't find eachother. Also, as you may notice in like a second from now, the whole code is handled by a single document. I guess I should do something about that as well?

Code:
package
{
import flash.display.MovieClip;
import flash.text.TextField;

[code]....

View 5 Replies

ActionScript 3.0 :: Multiple HitTestPoint With Arrays?

Mar 26, 2009

How would I change this to do a few test points,if (mydude.hitTestObject(myratarray[i])){

is it along these lines? if (mydude.hitTestPoint(myratarray[i].34,myratarray[i].12,true)){

View 2 Replies

Flash :: Use HitTestPoint When A Movie Is Scaled?

Oct 20, 2010

Google says that[code]...

is the way to test for the mouse being over a DisplayObject. This works if my movie is displayed at 100% scale. But if maximise my browser window so the Flash movie changes scale, it all goes to pieces.

View 1 Replies

ActionScript 3.0 :: HitTestPoint With Nested Object

Jun 28, 2010

Recently I was trying to use hitTestPoint with a nested movieclip against another non-nested one. Then if the nested movieclip was found to collide with the the registration point of the other movieclip (shapeFlag was set to true of course), the nested movieclip would move down by 1 pixel until it wasn't colliding.[code]What happens is that the while statement doesn't kick in until the registration point of obj3 is over obj2, but it doesn't break until obj3 is not over the bounding box of obj. Alternatively, if I change obj1.obj2.y to obj3.y it does stop at the correct spot.Actually I guess the problem isn't obj2 being nested in obj1, the problem still occurs when it's taken out of obj1.

View 8 Replies

ActionScript 3.0 :: HitTestPoint Stops A MovieClip

Nov 1, 2010

I have my two MovieClips and I both of them collide and the hitTestPoint works, but I want to make that one MovieClip will not be able to go on if that second MovieClip is in front of it but its can turn so that it to another side so that it can move.

View 0 Replies

ActionScript 3.0 :: HitTestObject / HitTestPoint Not Working Sometimes

Oct 8, 2011

Why does this happen ?

Code:

Main:
ActionScript Code:
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;

[Code].....

View 0 Replies

ActionScript 3.0 :: Change Code To HitTestPoint?

Mar 4, 2012

I've followed a tutorial and everthing works fine but I'd like to use hit-tests instead of the intersect-code. change the code so it works just the same with hit-tests.I dont get the same result.

View 4 Replies

ActionScript 3.0 :: HitTestPoint( X, Y, True); Implementation?

Jun 2, 2009

Testing this function and running it 11k times on a shape where I use:
 
shape.opaqueBackground = true;            shape.cacheAsBitmap = true;
 
Is extremely slow.. It seems to take 4 to 5 seconds to check a 101 x 101 tectangular area.I'm wondering how it is implemented...I know the code for the SDK is available?I can 'getPixel' from a bitmap to get the very exact color of that pixel in 1/1000 that time.If I happen to have the bitmap data.But with a shape that is already 'treated as a bitmap' (see above) using hitTestPoint  can stop your system. It should not be vastly inferior to work with Shapes than it is with bmp data..

View 3 Replies

ActionScript 3.0 :: HitTestPoint Inside A MC Not Working?

Aug 16, 2009

PHP Code:

//Move Enemies Events
function moveEnemies():void {
//Runs through every enemy stored in the array.
for(var c=0; c<enemyArray.length; c++) {

[code]....

View 11 Replies

ActionScript 3.0 :: While Loop & HitTestPoint Malfunction

Feb 15, 2010

[Code]....

This code serves the purpose of raising the character upon going up a hill. However, since the game will be on a large space (larger than the document size 1000x750) I am moving the ground (mc_Blockers) instead. This code is supposed to push the mc_Blockers down then it intercepts with the characters y. But instead, it just throws the character really high. When I examined it closely, it seemed to me that it threw the character up till the bounding box of the mc_Blockers (the whole stage is drawn, I'm not using blocks for floor, etc.).

View 1 Replies

ActionScript 3.0 :: HitTestPoint Trouble When Moving Root?

Jan 18, 2010

basically, I'm having trouble with the hitTestPoint method. As soon as I move the root of the swf, it no longer works as it should.To see what I mean, run this code:

Code:
package todd.test
{

[code].....

View 6 Replies

ActionScript 3.0 :: HitTestPoint - Hittest Doesn't Work?

Dec 30, 2008

I have this code so that when a spaceship goes through a blackhole it plays the spaceships moveiclip. This works fine on the first part of the code when the user just clicks the start button.However, i have put in a difficulty setting and when you change the difficulty setting the hittest doesn't work anymoreand there are no error messages. I have tried putting the blackHoles array in the difficulty function but nothing changes and i didn't really think this would make a difference as the easy function is already using the blackHoles array outside the difficulty function.

View 7 Replies

ActionScript 3.0 :: Get HitTestPoint Data As An Array Or List?

Oct 5, 2010

So, pretty much I have made a little flash app for a project at uni, and I have a tree which these little bat creates land onI have drawn the tree as a MC, and then use a hitTestPoint function to check wether the centre point of each bat character is touching the tree. If so land... blah blah pretty simple.Except I need to create a function that actually randomly spawns these characters on the tree. So to do this i would ideally have a get function that collects every x and y point on the and stores this data into a list

View 8 Replies

ActionScript 3.0 :: HitTestPoint And Defining A Range Of Values?

Sep 15, 2011

Is it possible to definine a range of values for the x or y parameter of hitTestPoint?

For example... hitTestPoint(100, rangeOfValues, false);

I've tried a few different things but nothing has worked so far.

View 1 Replies

ActionScript 3.0 :: HitTestPoint Not Recognizing Full Shape?

Nov 20, 2011

why "hitTestPoint(character.x, character,y, true)" would be hit testing off the origin point in the center of the character, and not the whole shape??

This is my code from my document class.  There's a custom splat class in there, but don't worry about that. This code is inside 2(1 nested) for loops.
 
function hitTestBalls(e:Event) {
for (var i = ballArray.length - 1; i >= 0; i--) {
for (var m = MonsterArray.length - 1; m >= 0; m--) {

[Code]....

View 3 Replies

Flex :: HitTestPoint Not Giving Correct Results

Sep 27, 2010

I have a movie clip on which I have added a MouseEvent.MOUSE_OUT listener.[code]...

Now the logic is to remove the movie clip on MOUSE_OUT and add it back to stage on MouseOver of another button. The intended functionality is like a slider showing some info

The MouseEvent.MOUSE_OUT firing in this case is not functioning always as expected. When I move the mouse out of the moveclip fast it fires. If I moveout very slowly it does not fire and consequently the movieclip remains on the stage. [code]...

View 4 Replies







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