Actionscript 3 :: Checking Pixel Color Value Of A 3D Object?
Oct 6, 2011
I have a spinning sphere, built using the away3D engine, it is wrapped in a bitmap. I need to be able to check the color value of the pixels in the sphere, however BitmapData only plots the 2D image, not the 3D sphere. So, the values become wrong. If I try to apply it to the sphere I get nasty errors. I have literally been stuck on this for days.
View 1 Replies
Similar Posts:
Jul 19, 2009
for example,graphics is an object from a movieclip ojbect.I want to get the pixel color at the x,y location in the movieclip.How to do?
View 5 Replies
Jul 11, 2009
Can I detect the color of a pixel or an area in a Display Object?
View 2 Replies
Dec 16, 2011
I want to check whether the color = a certain color then appropriatly react. This is done in flash AS3.
the code I've got is
if(cal_mc.color == 0x0000FF) {
p1score = p1score + 25;
(cal_mc being the object)
It executes without any errors but doesn't work. Can anyone tell me what I'm doing wrong with the if statment?
View 1 Replies
Jun 19, 2009
I need a function that retrieves the average hexadecimal color values of a group of pixels in a square. Like a 4x4 area, and I want to be able to calculate what the average color is by retrieving the color of each pixel.
View 4 Replies
Sep 28, 2010
I'm currently making a color picker (pretty standard one, pretty much the same as photoshop with less options at the moment: still in early stage). Here's the picture of the actual thing : [URL] The problem is : to retrieve the color of the pixel that is under the color selector (the small one, the other is the mouse), I have this line that I thought would do it :
_currentColor = Convert.hsbToHex(new HSB(0,
((_colorSelector.x + _colorSelector.width/2)*100)/_largeur,
((_colorSelector.y + _colorSelector.height/2)*100)/_hauteur
));
Just to clarify the code, I simply use the coordinates of the selector in order to create a new HSB Color (saturation is represented on the X axis and brightness (value) on the Y axis of such a color picker). I then convert this HSB Color to Hexadecimal and assign it to a property. The hue is always set to 0 at the moment but this is irrelevant as I only work with pure red to test. It partially does what I wanted, but the returned color values are inversed for most of the corners:
[Code]...
View 3 Replies
Dec 6, 2009
Imagine a black box with a white X inside of it. They are both inside a single movieclip called "box". What I want to do here is with actionscript, replace the White X (0xFFFFFF) with Red (0xFF0000), while the black isn't affected at all. I've thought about making two more movieclips (one for the X, and the other for the block), but it would be easier for me if it just replaced certain colors.
View 4 Replies
Oct 28, 2010
Grab the color of a vector item at a specific pixel without converting it to a bitmap object and then using getPixel?
View 8 Replies
Jun 8, 2011
Is there a way to retrieve the color of a generic pixel on the screen using the mouse pointer inside the Stage of Flash Player? With the getPixel method of the BitmapData class you can get the color of a pixel only if the mouse is over a bitmap image, but what if I need the color a generic pixel on the screen?
View 4 Replies
Mar 10, 2011
Say I have drawn a triangle with[code]...
When the user clicks a point inside the triangle, we will get the x and y coordinates, do some calculation with those values and get some (lots) of pixel coordiantes accordingly (all of those calculated points will be within the triangle). And finally, change the color of those points (something different than triangleShape fill color).
View 1 Replies
Oct 15, 2008
Is there a way to get the color of a pixel that the mouse clicks on. I want to load text into a dynamic text box according to that color.
View 12 Replies
Feb 10, 2011
is it possible to pick the color of a uni filled shape? If not, is it possible to retrieve the color at pixel x:0 y:0?Otherwise how do I pick that pixelcolor using bitmapdata.
View 2 Replies
Dec 7, 2010
I'm quite new to ActionScript and I was wondering is there a way to get the (pixel) color of the HTML layer under a flash movie? I have an idea of making a transparent flash movie covering a part of a website and then getting the color of underlying HTML layer, to make some realtime transformations or other stuff.
View 2 Replies
Feb 23, 2011
What is the best way to turn turn off (using PixelBender) colors that fall within a certain range. For example, turn off all colors between 0x0000FF and 0x00FFFF. This has to work in Flash.
View 2 Replies
Jul 29, 2011
I'm having trouble with this code
var imageMap:ImageSnapshot= ImageSnapshot.captureImage(object);
var pixelValue:uint = imageMap.bitmapData.getPixel(x, y);
View 1 Replies
Oct 5, 2011
I have a bitmap with many colors on it. When the user clicks each color needs to trigger a different method. However, I have no idea how to check the color value of the selected bitmap. I can create a new sprite and check the value of that fine through bitmapdata.getpixel() but when I need to actually check the actual bitmap I cannot get it to work.
View 2 Replies
Sep 22, 2011
I have a few movie clips that change color when they are rolled over and rolled out of which is great and works correctly but now I have add glows to those buttons to serve as borders or a stroke and when you roll over the buttons the color and the filter color changes.
View 3 Replies
Feb 20, 2007
I am making a movie that has to be published to Flash Player 6 and want to set a bunch of movie clips to have the same color. Here is my function:[code]My problem is that I get the error message:"Hexadecimal digits expected after 0x" referring to the 4th line of my function.
View 7 Replies
Mar 29, 2012
I am working on Flash CS5 , and I would like to "lock" any moves or selection on the pixel grid.For example if I am moving with my mouse a square placed at x:10 and y:56 I want to have someting like x:456 and y:78 and NOT x:456,4 and y:78,8Same thing for the selection, it select sometimes half of a pixel or a quarter, and it is very anoying... I am loosing a lot of time to check every element each time I placing, moving or selecting or creating to be sure it is an integer number.
View 3 Replies
Aug 6, 2010
In my script I create a button that when clicked, creates a blue square. However, I want to remove any blue squares that exist before creating the new square (because as it is a low opacity square creating another one will make it more solid, as well it's just more objects that the system has to keep track of).Here is my code:.as
ActionScript Code:
package{
//importing required classes for this to work
[code].....
View 2 Replies
Feb 18, 2009
How can I check for the presence of something on the stage? I want to disable mouse clicks on the currentTarget while an image is loading, and I'd like to use the presence of a progress bar as the determinant to proceed.
Code:
If (progressBar is somewhere on the stage)
{
currentTarget.mouseChildren = false;
currentTarget.mouseEnabled = false;
}
View 2 Replies
Mar 30, 2010
I am looking for a fairly simple image comparison method in AS3. I have taken an image from a web cam (with no subject) passed it in to bitmap data, then a second image is taken (this time with a subject) to compare this data, from these two images I would like to create a mask from the pixels that match on both bitmaps. I have been scratching my head for a while, and I am not really making any progress. Could any one point me in the right direction for pixel comparison method, something like getPixel32()
View 2 Replies
Dec 11, 2009
I want to do something like this in Actionscript 3:
if(variable is Object) ...;
else ...;
Where variable could be a String(), Number(), Array(), Object()...Currently the above check returns true for all of these types, which makes sense. I only want it to return true for objects made with new Object(), however.
View 2 Replies
Aug 7, 2009
Is there a way to check whether a loader object is in the process of loading something? I need to create an if statement that checks if the loader has an open connection. So far, what I thought of is:
ActionScript Code:
if(loaderInstanceName.contentLoaderInfo.bytesLoaded > 0)
{
// do something
}
Here, I'm just assuming that if bytesLoaded is greater than 0, than it's probably loading something. But I don't think it will revert back to 0 after the loader finishes loading an external resource. So after that, bytesLoaded will always be greater than 0 even though it isn't in the process of loading anything. Is there any other property that I can use which says whether the loader object has an open connection?
View 2 Replies
Feb 10, 2010
I have a name for the object, but it doesn't seem to work.Anyone know why this doesn't work?
Code:
if (sprite) {
removeChild(sprite);
[code]......
View 8 Replies
Jun 16, 2010
Using Actionscript 3 is there a way to search one bitmap for the coordinates matching pixels of another bitmap?
[URL]
Somehow you would have to loop through the bigger bitmap to find and the the pixel range that matches and return those coordinates. For example the Bitmap with the "E" is 250 pixels over and 14 pixels down in the bigger bitmap.
View 2 Replies
Jul 21, 2011
I've got to build a kids game at the moment for my school, and I was planning to have a sort of archaeological dig, with the kids required to rub the screen (it's for a touch-screen) to "un-earth" the bones underneath.I was thinking of either erasing an overlay and checking for a hitTest between the two objects, or coloring in with a line or something.Is it possible to color something in and check when the object has been completely colored? or possible to erase an overlying object? and if so, can you point me in the direction of a tutorial or a quick explanation?
View 2 Replies
Nov 28, 2011
I'm attempting to make a platform game. Each level is contained within it's own MovieClip, which has it's own class. Each of these classes extend the Level class, which provides basic functionality for all levels.
Each individual level has a numPlatforms variable which stores the number of platforms in that particular level. I currently have a for loop that runs from 1-numPlatforms and sets the level area (the image, more or less) the platform contains:
[Code]....
Is there any way to check if a variable exists within a MoveClip? I've trying comparing it to null and also to undefined, but neither works.
View 2 Replies
Nov 23, 2009
I have a 100x100px image. I want to get 1 pixel vertical line from x- 1 to 100. How can I do that?
View 7 Replies
Jan 13, 2010
In Actionscript 3, I'm trying to build a button to go back from a content frame to a main menu. When the button is clicked, IF the content frame has a movie in it, that movie should stop playing. Flash keeps throwing a "null object reference" error on all pages that don't include a movie. I even tried putting in a check to see if the movie exists, but that doesn't work, either.
ActionScript Code:
function return_to_menu( me:MouseEvent ):void {
if ( flashmo_contents.flv_movie ) { //this line produces errors in frames where the movie
[code]....
View 2 Replies