AS3 images and colors

I need some help with AS3. I got my color pickers working to change the image and background color. So everything is working like i want it for one image. I have about 10 images i need to be able to choose from. I want to be able to select an image from a drop down or something and that image replaces the image in the box. any help is much  appriciated.

not sure what i'm doing with the loader, i went throught the tutorial and got it to work in the tutorial, but i don't know how i would incorporate that function to work with my script. i appriciate all your help.
here is my script on the (turtle image layer).
// theimage is a display object on the Stage.
// blueBtn, redBtn, greenBtn, and blackBtn are buttons on the Stage.
import flash.events.MouseEvent;
import flash.geom.ColorTransform;
// Get access to the ColorTransform instance associated with theimage.
var colorInfo:ColorTransform = theimage.transform.colorTransform;
// This function is called when blueBtn is clicked.
function makeBlue(event:MouseEvent):void
    // Set the color of the ColorTransform object.
    colorInfo.color = 0x003399;
    // apply the change to the display object
    theimage.transform.colorTransform = colorInfo;
blueBtn.addEventListener(MouseEvent.CLICK, makeBlue);
blueBtn.addEventListener(MouseEvent.MOUSE_OVER, makeBlue);
// This function is called when redBtn is clicked.
function makeRed(event:MouseEvent):void
    // Set the color of the ColorTransform object.
    colorInfo.color = 0xFF0000;
    // apply the change to the display object
    theimage.transform.colorTransform = colorInfo;
redBtn.addEventListener(MouseEvent.CLICK, makeRed);
redBtn.addEventListener(MouseEvent.MOUSE_OVER, makeRed);
// This function is called when greenBtn is clicked.
function makeGreen(event:MouseEvent):void
    // Set the color of the ColorTransform object.
    colorInfo.color = 0x00CC00;
    // apply the change to the display object
    theimage.transform.colorTransform = colorInfo;
greenBtn.addEventListener(MouseEvent.CLICK, makeGreen);
greenBtn.addEventListener(MouseEvent.MOUSE_OVER, makeGreen);
// This function is called when blackBtn is clicked.
function makeBlack(event:MouseEvent):void
    // Set the color of the ColorTransform object.
    colorInfo.color = 0x000000;
    // apply the change to the display object
    theimage.transform.colorTransform = colorInfo;
blackBtn.addEventListener(MouseEvent.CLICK, makeBlack);
blackBtn.addEventListener(MouseEvent.MOUSE_OVER, makeBlack);

Similar Messages

  • Background images and color

    What instance would background image and background colors
    not show in a browser? (All other images are fine)

    Cosmic rays.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:gbu845$7gd$[email protected]..
    >A color specification without the required octothorpe
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "TC2112" <[email protected]> wrote in message
    > news:gbu7sb$782$[email protected]..
    >> Hello,
    >>
    >> Some examples would be incorrect CSS, an incorrect
    link to a CSS
    >> stylesheet, another element with a background color
    "on top" of the
    >> background blocking it, an incorrect path to the
    image....
    >>
    >> The answer is in the code.
    >> Do you have a link you could post?
    >>
    >> Take care,
    >> Tim
    >>
    >> "TaraLeigh" <[email protected]>
    wrote in message
    >> news:gbu7bj$6hs$[email protected]..
    >>> What instance would background image and
    background colors not show in a
    >>> browser? (All other images are fine)
    >>
    >>
    >

  • FCPX: Still Images and Color Effects

    What I am doing is not working so clearly I am doing it incorrectly . .  .
    I have some still images and want to change the color to night-time "over time". I thought I could use keyframes to do it but when I do that, it changes the color of the entire image instantly. It is not a gradual change. Maybe I am setting the keyframe in the wrong place, I am not sure. Anyway here is how I am settin the keyframs and also the panel I am working in to do the color adjustment. It seems the keyframes are being set in the "Transform All" section and I want them in the color section but can't get them in there. Can someone please tell me how to do this correctly?

    Tom, I have a question. I can split the clip -no problem; however, when I add the first color correction (going from day to night color), it is going to apply the color change instantly with no gradual fade to night. In the second clip, I can do another color correction going from night back to day but, again, it will be applied instantly. I think I might be misunderstanding your method. Can you explain, please.
    Or are you saying that one clip would be day and one would be night, and the cross-dissolve would blend the two?

  • Question on scanned images and coloring in Photoshop

    I have some sketches from my drawing class that I would like to scan and color in Photoshop. I scan the sketch
    but I can't add color. I've tried 'lassoing' a portion of the drawing
    but the paint bucket still won't add color.
    What am I doing wrong? Please help.
    thanks.

    The Paint Bucket tool may be the wrong tool, or at least you may have its Threshold set to a low value, as it replaces pixels only of a similar color to the one you click on.
    It may be more direct to just select the Brush tool and set up a large brush to paint solid color in the region you selected.
    If you want to get into more advanced functionality, which will allow you to correct mistakes or continue to adjust your colorizing for example, perhaps you will want to create a new layer and paint on that layer.  Without knowing your goals it's hard to advise further, but you might also want to learn more about Layer blending mode "Color" vs. "Normal".
    -Noel

  • Jpeg images and color gamuts

    When I make a jpeg image in my camera, it is assigned the adobe rgb gamut.
    What happens when it is imported in LR? Does the gamut change to prophoto automatically?
    When I print the jpeg do I have to specify the color gamut? If it isn't prophoto rgb, there is no place to specify the gamut?
    Can anyone explain?
    Andy

    Yes it is. You might want to read up in the manual about still importing and also about audio sampling rates.

  • Optimizing images and color problems in Catalyst

    I really need your guy's help.
    First of all, I am trying to figure out the best way to optimize images. I have a bunch of logos that are pdfs/ai files that I want to make thumbnails and full size images for a part of my portfolio site. No matter what I do the logos get choppy. Whether creating jpegs in illustrator, rasterizing the images, etc. Any ideas?
    Also, every time I bring an AI file into catalyst blacks/grays seem to be different. Anywhere I use any kind of low opacity or something things are screwed up. Faded whites in illustrator are bright white in catalysy. Low opacity whites (grays) are brown. WAY off. Any ideas there?
    This is driving me crazy and I have a deadline for this coming up very soon. I feel like I have gotten nowhere after hours and hours of this
    Thanks!

    Hi there,
    Here's a collection of material that should help:
    FAQ: How do I optimize Illustrator graphics for best performance in Flash Catalyst?
    Here are a few specific snippets from that collection that apply to your specific situation:
    -To reduce color differences when comparing colors in Catalyst and Illustrator/Photoshop, set Proof Colors to "Monitor RGB" (In Illustrator, go to View> Proof Setup and choose Monitor RGB). (From Ian Giblin's slide deck, pg. 19)
    -When creating documents in Illustrator that will be imported into Catalyst, set the document color space to RGB. There is a new document profile for Flash Catalyst built into Illustrator (select it from the New Document menu in Illustrator's new document dialog box). This does other helpful things like turning on "Align to Pixel Grid, and setting your document size to the commonly-used 800 x 600 pixels.)
    -Regarding the choppy logos, try using the "Optimize vector graphics" command in Catalyst (select your logo on the artboard, and in the Heads-Up-Display, choose Optimize artwork and then Optimize vector graphics. This feature is made for optimizing vector art for good performance, while still maintaining the ability to edit the vectors later if needed. You can also convert the logos to raster images right inside of Catalyst, by choosing "Rasterize" instead of Optimize vector graphics. More details are in this great FlashCats blog post.

  • How do I restore a photo to its original image and color?

    I do not know where to find the "restore to original" feature.  I forgot to make a copy before I changed the photo.  This is new to me.
    Mark Only

    If you've saved over it and closed it, you can't.  If you haven't closed it, use undo to get back to the original.
    You don't have a backup or the original on a memory card?

  • How to send images and other colored text in email body

    Hi
    We are using SAP CRM 4.0 and we would like to send email to our customers using actions configured for activity. Our objective is to send Marketing Emails containing <u>Images and Color texts</u> in the BODY OF THE email and not as a PDF attachment.
    The only relevant provision we could see in SCOT is either Text or PDF. On using text , we are loosing all images and color. The PDF option works , but the email generated is a blank email with PDF document as attachment.
    We want the matter to be inserted in the body of the email and not as attachment.
    Please do let us know if any one has faced similar situation and is there a resolution.
    Thanks and Advance.
    Regards
    Sachi

    Are you pasting in the HTML code?
    You can't use the formats in the CRM editor to set bold text, etc.  You have to use the HTML code and have set the Form up as Internet mail
    http://help.sap.com/saphelp_crm40sr1/helpdata/en/82/dbfd38ccd23942e10000000a114084/content.htm
    Here's the first screen setting for my test email:
    Form          Y_TRADE_SHOW_INVITATION        / Trade Show Invitation (Test)
                                                                                    Form Usage              1 Internet Mail (SMTP)                        
        Text Type               1 HTML                                        
        IBU Scenario                                                          
        Customer Scenario                                                                               
    Page Format             DINA4         Status    Created                                                                               
    Characters Per Inch     10.00                                         
        Lines Per Inch          6.00                                          
        Style                   SYSTEM SAP Smart Forms Default                                                                               
    Created By         MANECITO            Changed By         MANECITO   
         Date               01/16/2007          Date               05/22/2007 
         Time               09:49:12            Time               18:01:51   
    then, your email has to have the HTML tags
    A bare minimum is your email has to have the <HTML> tag at the top, but it's advisable to be sure you have a more complete setup like this:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .style1 {
         font-size: x-large;
         font-family: Verdana, Arial, Helvetica, sans-serif;
         font-weight: bold;
    .style2 {
         font-family: Verdana, Arial, Helvetica, sans-serif;
         font-weight: bold;
    .style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; }
    -->
    </style>
    </head>
    <body>
    ENTER YOUR HTML MESSAGE HERE
    </body>
    </html>

  • No background images and missing styles - everything white

    somehow every page on firefox displays white with no style or background images. I thought it might have been something having to do with firebug or developer plugin, so I disabled them both, upgraded to the latest firefox version and STILL I have a white screen.

    I appreciate the response. I checked the settingx you suggested and everything was correct.
    I'm on a mac. Below is the shot of the firefox post we're in right now.
    http://calproject.com/firefox/screen-shot-firefox-page.png
    So this is not a specific site - its ALL sites... As you can see.... all images and color are missing.
    Thanks!

  • Hey, How do I populate my replace colors color library in illustrator? I tried to replace color on a traced/ vectorized image and when I selected and went to the color library CC said I need to use a valid username. I was already logged into my adobe acco

    Hey, How do I populate my replace colors color library in illustrator? I tried to replace color on a traced/ vectorized image and when I selected and went to the color library CC said I need to use a valid username. I was already logged into my adobe account.

    Can you please show a screenshot of what exactly you want to replace where?

  • Access image size and color profile

    Hi all,
    Is it possible to access image size and color profile ? If not, will it be possible in CS6 ?
    Thanks.

    Load the external XMP library and get it from that?

  • Original Image Resolution and Color getting Distorted

    Hi All,
    I am using JAI for reading images from a source i have to read the images and than have to split the images
    initially i was using ImageIO.read() method to read images but for some images it was throwing error as
    javax.imageio.IIOException: Unsupported Image Type
         at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
         at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
         at javax.imageio.ImageIO.read(Unknown Source)
         at javax.imageio.ImageIO.read(Unknown Source)
         at deepzoomconvertor.Main.loadImage(Main.java:370)
         at deepzoomconvertor.Main.processImageFile(Main.java:238)
         at deepzoomconvertor.Main.reteriveAllImages(Main.java:221)
         at deepzoomconvertor.Main.main(Main.java:86)so in such exception cases i am trying to read the images using JAI and i am successful in reading images
    here is the piece of code i am using for this
      BufferedImage result = null;
       SeekableStream ss=SeekableStream.wrapInputStream(new FileInputStream(file), false);
               ParameterBlock pb = new ParameterBlock();
               pb.add(ss);
               RenderedOp rm=JAI.create("JPEG", pb);
               result=rm.getAsBufferedImage();
                 return result;it able to split images but the quality of images are poor it losts its original color format.
    can any one have any idea how to do it while retaining the quality of image color and resolution
    Thanks in advance
    Umesh

    The JPEG you are reading is a cmyk color space one. They're not common, but they do occasionally pop up in a collection of random jpeg images.
    The default JPEGImageReader that comes with the jdk cannot read them. And it will throw an exception - the exact same one you got - stating it can't. JAI's behavior is a little worse. It will read the image without exception, when in fact it to can't read it. It doesn't handle the cmyk aspect right, so you get a messed up image.
    The native JPEGImageReader that comes with installing [JAI-ImageIO|https://jai-imageio.dev.java.net/binary-builds.html] can read them. It appropriately decodes the ICC_Profile embedded within the JPEG and you get a cmyk BufferedImage. But if you wish to render this TYPE_CUSTOM BufferedImage, go grab a coffee while you wait for it to slooooowwwllly paint. You'll have to do a ColorConverOp to turn the cmyk BufferedImage into an rgb one (so Java2D can render it fast).
    Having done all this you'll find that 1) ColorConvertOp makes the image too bright and 2) The native PNGImageReader that comes with installing JAI-ImageIO has an affinity for returning TYPE_CUSTOM BufferedImages (arggg!!!).
    I'll help you fix points (1) and (2) if you get that far. Maybe the best choice is to simply give up on cmyk jpegs. They're only used in printing press environments, and people only use color space aware applications (like Photoshop) to manipulate them in any meaningful way.

  • Check image resolution and color

    Please let me know whether it is possible to get the image resolution and color used in a eps file.
    regards,
    Sashi

    You can specify the resolution for exporting, for document etc but resolution of the raster objects can not be retrieved.
    Color space of the raster object can be retrieved using the rasterItems : colorants or imageColorSpace properties  

  • Changing brightness and colors of an image

    Here's code for an applet that will create a gradient:
    http://www.sitepoint.com/forums/showpost.php?p=1408696&postcount=5
    How would you load an image and do this same thing to the image?
    Also, how could you add a slider to change the brightness?
    Any tips or code samples would be much appreciated.

    Here's the code that changes the rgb values. But, it doesn't work in some browsers and earlier versions of jre. Can you fix it so that it works? Also, how would you add to this code to make it change the brightness of an image?
    (2 files: grad.java and myPaint.java)
    File: grad.java
    import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridLayout; import java.awt.Rectangle; import javax.swing.JApplet; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class grad extends JApplet implements ChangeListener { JSlider[] jss; JPanel mainP, slidP; display disp; Color col1, col2; public void init() { mainP = new JPanel(new GridLayout(1, 2)); slidP = new JPanel(new GridLayout(6, 2)); jss = new JSlider[6]; for (int loop = 0; loop < 6; loop++) { jss[loop] = new JSlider(SwingConstants.HORIZONTAL, 0, 255, 0); jss[loop].addChangeListener(this); } slidP.add(new JLabel("Red 1"), slidP.add(jss[0])); slidP.add(new JLabel("Green 1"), slidP.add(jss[1])); slidP.add(new JLabel("Blue 1"), slidP.add(jss[2])); slidP.add(new JLabel("Red 2"), slidP.add(jss[3])); slidP.add(new JLabel("Green 2"), slidP.add(jss[4])); slidP.add(new JLabel("Blue 2"), slidP.add(jss[5])); //add others in order r1, g1, b1, r2, g2, b2; disp = new display(); mainP.add(disp); mainP.add(slidP); getContentPane().add(mainP); } public void stateChanged(ChangeEvent evt) { col1 = new Color(jss[0].getValue(), jss[1].getValue(), jss[2].getValue()); col2 = new Color(jss[3].getValue(), jss[4].getValue(), jss[5].getValue()); disp.setColors(col1, col2); System.out.println("grad.stateChanged()"); disp.repaint(); } class display extends JComponent { Color col1, col2; public display() { col1 = Color.black; col2 = Color.black; } public void setColors(Color col1, Color col2) { this.col1 = col1; this.col2 = col2; } public void paint(Graphics _g) { Graphics2D g = (Graphics2D) _g; int boxW = 300; int boxY = 300; g.setPaint(new GradientPaint(0, 0, col1, boxW, boxY, col2)); g.fill(new Rectangle(0, 0, boxW, boxY)); } } }
    File: myPaint.java
    import java.awt.Color; import java.awt.Paint; import java.awt.PaintContext; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.ColorModel; import java.awt.image.Raster; import java.awt.image.WritableRaster; /* * Created on 16.09.2004 */ public class myPaint extends Object implements Paint { private Color c1, c2; public myPaint(Color c1, Color c2) { this.c1 = c1; this.c2 = c2; } public int getTransparency() { return OPAQUE;//this constant is in Paint class; } public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) { return new myPaintContext(c1, c2); } class myPaintContext implements PaintContext { private int r1, g1, b1, r2, g2, b2; myPaintContext(Color c1, Color c2) { r1 = (c1.getRGB() >> 16) & 0xff; g1 = (c1.getRGB() >> 8) & 0xff; r1 = c1.getRGB() & 0xff; r2 = (c2.getRGB() >> 16) & 0xff; g2 = (c2.getRGB() >> 8) & 0xff; b2 = c2.getRGB() & 0xff; } public ColorModel getColorModel() { return ColorModel.getRGBdefault(); } public Raster getRaster(int x, int y, int w, int h) { WritableRaster raster = getColorModel().createCompatibleWritableRaster(w, h); int[] data = new int[w * h * 4]; int base = 0; float rat1, rat2; for (int xloop = 0; xloop < w; xloop++) { rat1 = ((float) xloop) / ((float) w);//this is ratio of color1 rat2 = 1 - rat1;//this is ratio of color2; for (int yloop = 0; yloop < h; yloop++) { data[base++] = (int) ((r1 * rat1) + (r2 * rat2)); data[base++] = (int) ((g1 * rat1) + (g2 * rat2)); data[base++] = (int) ((b1 * rat1) + (b2 * rat2)); data[base++] = 255;//alpha } } raster.setPixels(0, 0, w, h, data); return raster; } public void dispose() {} } }

  • I can select a rating and a color label for my images, but I can not sort by rating and color label.

    I can select a rating and a color label for my images, but I can not sort by rating and color label. when I click on the filter drop down, color label is not one of the options.  how do I get both ratings and color lables as an option to sort with.

    You can Filter (not sort) on both color label and rating if you want, open the Filter Bar with the backslash key, then click on Attribute, and then select the stars and color label of interest. If you really meant "sort" and not filter, then you can't do this in Lightroom.

Maybe you are looking for

  • Firefox is incredibly choppy and sluggish on a new computer. Why is this happening?

    I bought a brand new laptop a few weeks ago. For some reason, Firefox is very choppy and slow, especially when I'm scrolling on websites. I noticed there are more problems when I am websites with a lot of image/video content such as Facebook. The wei

  • Blackberry Messenger only works at certain times of day.

    a few days ago my phone crashed, leaving my blackberry messanger not working, a few hours later it started up and everything was fine, however the next day my bbm only worked early in the morning and then started up again around 4, and its did it aga

  • Quirky Magic Mouse Behavior

    I'm having trouble with quirky behavior of a Magic Mouse that's being used with an Intel iMac. In the Mouse panel of System Preferences I have the "Two Finders" option of "Left/Right to Navigate" set on. When in a Finder window set to "list" view I f

  • Invoice Idocs - adding discounts

    I am using basic type INVOIC01 to create an invoice idoc. But I can not get the idoc to work when using payment terms (segment E1EDK18). I am attempting to create an invoice with a discount by using payment terms, but the most common error I get is '

  • RoboHelp HTML 9 - CHM file Lost focus on selected topic on Content tab.

    Dear all, In my generated CHM file, I click on a topic on the Content tab, then I click anywhere in the content displayed on the right pane. The selected topic on the Content tab then not highlighted anymore. Why it happens like that ? Anyone please