ActionScript 3.0 :: Check Pixel Transparency?
Aug 4, 2009
I am trying to get the alpha values in the rect of one (playball_mc) clip inside another bigger clip (dst_mc). The clip dst_mc has a bitmap attatched and also has a shaderFilter that calculates the alpha values.ut I only get alpha values of 0xFF.Does anyone know what I am doing wrong or where the alpha value gets lost?
CODE:var rSource:Rectangle=new Rectangle(playball_mc.x,playball_mc.y,80,80)
dst_bmp.draw(dst_mc);bmd1.copyPixels( dst_bmp , rSource, new Point(0,0) );
for
[code]........
View 9 Replies
Similar Posts:
Sep 10, 2011
I have a game and the user clicks on a button (a_btn), they are brought to frame 2 and they have to answer a question. If they get the question correct the alpha transparency of the a_btn is set to zero.
What I would like to be able to do is see if a number of buttons have zero alpha transparency then the user gets a complete message. This is what I have so far:
ActionScript Code:
if (c_btn.alpha=0 && h_btn.alpha=0){
infoComplete.text = "WELL DONE, GAME COMPLETE";
}
View 9 Replies
May 31, 2010
Can I check if a pixel is transparent or not in a bitmap?
I want to count the nr of transparent pixels and nontransparent pixels.
View 0 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
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
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
Oct 2, 2009
See [URL] Now there is a button called Answera, which when clicked should have a symbol (movie clip) called Check appear at the cordinated specified. Check exists in the libary (but does not have an instance name) and no where else on the stage. when I run this code I get: 1180: Call to a possibly undefined method Check. -> var rightCheck = new Check(); How is it undefinded if it exists in the libary?
View 7 Replies
Jan 27, 2011
The following is my codes. This is still work in progress; so, you will see some functions with empty contents. Plus, this is my first Flex application; please bear with me. This is a quiz application that gets the questions and answers to each questions from a ColdFusion web service. There are three types of questions, True or False, Multiple Choice with single selection, and Multiple Choice with multiple selections. So, based upon the question type, the application would dynamically generate the appropriate amount of radio buttons or check boxes for the users to select. I got these working. The problem that I am having is, I am not sure how to check what the users have actually selected. In some other forums and posts on other web site, it said that I can use event.currentTarget.selectedValue to get the user selection. But when I actually do it, I got a run-time error saying, "Property selectedValue not found on mx.controls.FormItem and there is no default value." My question is, what do I need to do to capture the user selections?
[Code]...
View 1 Replies
Oct 31, 2009
I'm creating a DressUp kind of game using only external .png files for items (such as dresses, hair styles, bags etc).Some of my image files have transparent space left/right of the drawing itself. What I want to do, is set the hitArea of that certain movieclip (which contains the .png file) only to the visible area (to the actual drawing). This would be a fairly easy job if all the items had have the same size, but sizes are different from item to another.Taking the attached image, the grey area should not respond to mouse events.
View 1 Replies
Mar 6, 2009
s there any way to make PNG 24Bit transparent Image from MovieClip? I tried google a lot, but didn't found any transparent Method.
View 6 Replies
Jul 17, 2009
I created an image in Photoshop that included a gradient layer fading from transparency to a foreground color (in this case, black). I saved this image as a PNG file and imported the file onto my Flash stage. The gradient appears on the image as expected when viewing the stage in the Flash editor, however, when I test the movie, the gradient no longer appears.
View 2 Replies
Aug 15, 2009
I have created a swf for the header of my website. On the top layer I have an image that stays static while the rest of the header changes images. I am trying to get the static image to be fairly transparent but am not having much luck. I created the image in PS I saved it with transparency but it doesn't look right in the swf.
View 2 Replies
Apr 11, 2011
For anyway having that problem in Actionscript 3 clicking through the transparent parts of a PNG file. I finally figured it out:
var hitTestPoint1:Boolean = false;
var myHitTest1:Boolean = false;
var objects:Array;
clip.addEventListener(MouseEvent.MOUSE_DOWN, doHitTest);
clip.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
clip.buttonMode = true;
[Code]...
View 1 Replies
May 30, 2010
URL..they rocky frame you see is a PNG and it's converted in MovieClip to be able to change it's index so it's always in front of the other objects.Problem: once I get what I want (MC+png is in front of everything) I'm not able to interact with anything under the MC anymore.I know the problem it's that the png extends for all the MC space but I really need to make those object under the frame interactable.
View 2 Replies
Feb 8, 2011
im using the pngEncoder from adobe, its working great. But all my .PNG's are saved with a whit bg, how to export with transparent?
ActionScript Code:
function eventPostPictureToServer(e:TimerEvent):void
{
var urlLoader:URLLoader = new URLLoader();
[code]....
View 1 Replies
Apr 4, 2006
I have a PSD with about 30 layered transparencies. I exported each individual layer as a PNG 24 with the transparent background in tact. I then made identical layers in Flash just like I had in Photoshop, and imported each PNG to it's corresponding layer at which point I converted the graphic to a movie clip for future scripting animations. Once I got to the 24th layer Flash quit recognizing my transparencies and my first Flash layer masked anything else I brought in from layer 24 on....but the layers above remained OK!! I checked and double checked my Photoshop exports and had several Flash "gurus" check my work. Nobody can figure out what is wrong! Is there a limit to the number of PNG tranparencies allowed on seperate layers in a Flash document?
View 7 Replies
Dec 22, 2008
I'm working on a project where I want to use a transparent png, and when authoring in Flash CS3 (using actionscript 2.0) the png image appears transparent just as it should. However when I test it the .swf file loses the transparency entirely. The png image was saved for web from photoshop as png-24.
View 1 Replies
Jan 18, 2009
I found FlashObject script easy to understand and apply ... in part due to good instructions and the handy 'Generator.'
It validated W3C too!
One problem. My background color turned to white. How do I specify a background color, or transparency?
View 1 Replies
Jan 30, 2009
With CS3, when I entered a movieclip, I could see the other movieclips/stage in the background. But now when I enter a movieclip with CS4, I get the stage color as the background. If I try to test that "scene", the objects are in the top left corner.
It makes positioning from within a movieclip very very difficult.
View 1 Replies
Nov 5, 2010
I have a flash SWFObject on a pafge and i want to make the background transparent so that the base HTML background shows through. This is my code:
var so = new SWFObject("images/topnav.swf", "flash", "100%", "100%", "6","#000000");
so.addVariable("xml", "data.xml?time="+new Date().getTime())
so.write("flashcontent");
[code].....
View 1 Replies
Aug 31, 2007
Is there a way to turn off the transparent appearance of the toolbars when you drag them in Flash CS3. For example, when I drag the actionscript toolbar, it turns transparent and it's really lagging on my system
View 2 Replies
Mar 15, 2011
I have a problem I can't seem to fix - why wont the transparent attributes of the PNG files I have substituted into the XML gallery wont show? instead there is a heavy white border that overlaps other images in when the flash is rendered
var tn:Number = 0;
var current_tn_x:Number;
var current_tn_y:Number;
[code].....
View 1 Replies
Oct 18, 2007
I'm an art student and have produced some pieces in Flash 8. Now I've been asked for a high-quality (i.e. a letter-sized print at 600dpi) image, but the animation uses transparency.
I've been able to generate vector-based PDFs that I can blow up to as big as I want with no quality loss, but the transparency dissappears.
When I conserve the transparency, I get something that'll print at about 1/10 the size I need at 600dpi.
If it's not possible from the Flash Player (or from Flash 8), then does anyone know of an alternate program that'll do this for me (preferably free or cheap)?
View 1 Replies
Sep 14, 2009
I'm using AS2 with Flash CS4. How can I change the alpha of a ComboBox? I tried:
MyCombo._alpha = 25;
// and
MyCombo.alpha = 25;
But both have no effect on my ComboBox, it just appears to have the alpha set to 100.
View 1 Replies
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
Nov 5, 2009
I need to use te colorTransform to change the color of one movieclip in stage. I can do it, but I loose the original degrades illustration has. How to apply the color transform but defining one alpha to the new color, so what is being fill doesn't looses its appearance?
cor_tv = new ColorTransform();cor_tv.color = picker_fundo.selectedColor;
root[que_tv].tv.transform.colorTransform = cor_tv;
root[que_tv].tv.alphaMultiplier = 0.5;
View 3 Replies
Jan 5, 2010
If I have a graphic that is fully transparent in places, can I make only the non-transparent portions of the graphic respond to mouse clicks? I realize I can probably do this with a few lines of code, e.g. detect the click and then check the alpha value under the mouse. But I was looking for something simple. For example, in Director there is an "alphaThreshold" in a graphic that determines at what alpha value a bitmap will respond to mouse clicks. Does Flash / AS3 have a similar capability?
View 1 Replies
Apr 16, 2010
I've made a flash image with the gif extention with Adobe Flash CS4 Pro. I have set the WMODE to tranparent and i've set the Transparency at the giv tab to transparent to. But now comes the difficult part. Each time when I export the image the background is still white.
What did I do wrong? and how can I fix it?
View 8 Replies
Sep 1, 2010
Im trying to create an as3.0 navigation with a few buttons.Each button is a png image.When im importing images to the stage i dont have any transperancy issues but the problem is that they are not smooth enough, especially because im animating them using TweenLite.I thought that the only way to do it properly is to load all the images using as3 into bitmap objects and then use the smoothing property.The problem is that everytime that i assign the png to a bitmap object i lose the transperancy information and i get a white background...Anyone knows how can i keep the transperancy information from the png onto the bitmap object ?
View 2 Replies
Oct 26, 2010
I have created a peelback advert that peels down from the top right. All is well apart from it it obstructs the user ability of the site underneath as the peelback advert is effectively over the top. I have been giving some guidlines to stop this but i am struggling to understand them. The instructions specificall say that the file must be set with the transparent parameter.
Here are the options that i have:
OPTION 1:
import flash.external.ExternalInterface;
// Function executed in answer to the event
function onClic(pEvt:Event):void {
[code]...
I think it could be the latter two that i need but am not entirely sure, i have tried them but have failed in my attempts?!If this is definetly the way to do it i will persevere! If these are not the way, what does the corner_show/hide method method do?
View 3 Replies