Can I use sprites on images in Flash?

Hi, I'm designing a calculator-like application in Flash for a school IT project. I made the layout in photoshop, and want to lay out the buttons with sprites (was just on CSS so addicted to those things xD ). I've tried googling and have found something like you can use sprites like buttons (which is good), but I can't figure out how to apply bitmaps to sprite backgrounds vs. plain colors. Can anyone help me with this?
Thanks!

It doesn't have an event listener then, though? Like there's no automatic button down state; if I wanted to use it I'd have to do mouseUp and mouseOut and mouseDown events separately right?
By the way, it's just for confirmation. I found a work around, using my own code. Essentially, you set the source image (eg "BImage" in library) and this function returns a bitmap image
function getSprite(imageSource, xPosition, yPosition, widthValue, heightValue):Bitmap {
          var bitmapOfSource:Bitmap = new Bitmap(new imageSource); //converts the image in the library to a bitmap file/variable/object
         var bitmapDataOfSource:BitmapData = bitmapOfSource.bitmapData; //gets the bitmapdata, which is required to "crop" the image
         var croppedBitmapData:BitmapData = new BitmapData(widthValue, heightValue, true, 0x00000000); //creates a new bitmapdata object/variable which will have the proper height and width
          var cropRectangle:Rectangle = new Rectangle(xPosition, yPosition, widthValue, heightValue) //defines the rectangle to be cropped out, which will be used later
         var positionPoint = new Point(0, 0) //defines the point where the cropped rectangle will be placed, to be used later
          croppedBitmapData.copyPixels(bitmapDataOfSource, cropRectangle, positionPoint); //copies the specified pixels and sets them to the new bitmapdata object (if your parameters were BImage, 0, 0, 50, 50; this would crop a square side length 50, from position 0, 0 of BImage)
          var finalBitmap:Bitmap = new Bitmap(croppedBitmapData) //converts the new bitmapdata object to a useable bitmap
          return finalBitmap
stage.addChild(getSprite(BImage, 0, 0, 320, 240));
Is my code, if anyone is looking for the same thing. Like CSS xD give it the background image, then the x, y, width, and height, and it'll just print out that portion of the image. Of course, if there's native support, I'd want to use that, which is why I'm double checking. Sorry if I'm being/making you repeat the same thing over and over :/ If you don't reply I'll just assume there isn't native support for sprite down states... already been very helpful. Thanks once again!

Similar Messages

  • Can I use 60 MB/s Compact Flash cards in my EOS 40D?

    Can I use 60 MB/s Compact Flash cards in my EOS 40D?  I have been using 30 MB/s cards for several years and would like to get faster speed if the $)D will accept the faster cards

    It will accept them but it may not transfer any faster. That's limited to the buss used back then which was most likely the fastest it could be in it's day.
    "A skill is developed through constant practice with a passion to improve, not bought."

  • Can I use Photoshops example images on my companies web site?

    On the Photoshops CD, there is a lot of example images, Can I use these example images on my companies web site?

    Here's the process to roll back:
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, download and save Firefox 3.6 to your desktop for future installation. http://www.mozilla.com/firefox/all-older
    Close Firefox 4.
    You could install Firefox 3.6 over it (many have reported success) or you could uninstall Firefox first. If you uninstall, do not remove your personal data and settings, just the program.
    Unless you have installed an incompatible add-on, Firefox 3.6 should pick up where you left off. If there are serious issues, please post back with details.
    Note: I haven't actually tried this myself!
    Does that resolve the NASA issues?

  • How can I use a vector image to stretch with the backgrounds in Muse master pages?

    How can I use a vector image to stretch with the backgrounds in Muse master pages?

    Maybe there's a bug.  I think it's only showing it when it wants to because look:

  • The error that I am getting is this "Time Machine can't use the disk image because it can't be written to."  Any ideas on the fix for this?

    The error that I am getting is this "Time Machine can't use the disk image because it can't be written to."  Any ideas on the fix for this?  When I go to the Time Capsule my Macbook Pro shows that it is locked, I think I did something wrong, but can't figure how to unlock it to see if that fixes it.

    As far as we know, Time Machine cannot write to a disk image. It needs to write directly to the Time Capsule disk.

  • Time Machine can't use the disk image because it can't be written to.

    Time Machine can't use the disk image because it can't be written to. help!

    VictorSMiller wrote:
    I just started getting the same message.  I'm using a Western Digital My Book 3TB disk.  Normally I have the backups done with the disk attached to Airport Extreme.
    I hate to have to tell you this, but backing-up that way is unreliable and not supported by Apple.   See:  Using Time Machine with an Airport Extreme Air Disk.
    Backup failed with error: The target disk image volume is read-only.
    Most likely, you got this message before all this started:
    What that doesn't explicity say is, the backups failed the verification.  When that happens, Time Machine marks the sparse bundle as damaged and won't back up to it anymore (even if Repair Disk can't find the problem).  See #C13 in Time Machine - Troubleshooting for details.

  • Using fireworks rollover images in flash

    I'm trying to create the best way to use a series of fireworks rollover images in Flash and was hoping some flash gurus had ideas.  I'm creating a photo album of sorts in flash, except when you click to bring up a photo, you can mouse over certain parts and have the text labels on the images change.  I have a lot of images and therefore a lot of rollovers.  I have a central layer called 'content' where the images get displayed.  What is the best way to include these rollovers in my flash documnet?

    Well guess what, it doesn't:
    http://www.ctc-belgium.be/TEMP/test.cfm
    This is the code (images are in the same subfolder):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <cfform format="flash" action="../upload.cfm"
    style="background-image:ero1.jpg;
    background-repeat:no-repeat; background-position:top right;
    text-align:center; border:1 solid black;">
    <img src="ero2.jpg" />
    </cfform>
    </body>
    </html>

  • How can I use Flash_Slideshow.SWF in my Flash CS4 document?

    Hi,
    I have downloaded a nice Flash Slide show file (.SWF) and would like to use in my Flash CS4 document without any modification (as it is). How can I use it? There is no .Fla file this Slide Show. It just works using xml file.
    Please do help.

    Hi,
    You need to load a .swf file in your flash document using the loader class. I'm assuming you are using the AS3. Please click on the below link which helps you to use the loader class.
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html
    Thanks

  • How can I export a full image from flash to jpeg?

    Hi,
    First of all hello to everybody.
    Could somebody give a  hand with this? I am trying to export a flash image to jpeg. I can do it but the image is cropped when I open it in photoshop. This is the original image (is is an screenshot and not exported with flash):
    [IMG]http://www.flickr.com/photos/22338638@N06/4615821418/[/IMG]
    And this is the image exported with flash (as you can see it is cropped on the right):
    http://www.flickr.com/photos/22338638@N06/4615821566/
    Why is the second image cropped?
    I would really welcome any help.
    Thanks,
    Iván

    Hi,
    My image is on the stage and the stage is as large as the image. I haven´t publised the image. Do I have to do it?
    THANKS A LOT IN ADVANCE!!!
    Iván

  • Can I use Photoshop Elements images to illustrate a book I plan to sell?

    If I were to use Photoshop Elements images, background designs etc and cut and paste, copy and use in collages to illustrate a book I plan to sell, am I breaking copyright laws?

    Yes, you can do this. Adobe is concerned about people who reverse engineer the programs, not about people who use them as intended. Of course, for any additional styles, shapes, etc, it would depend on the developer's license terms. But there is no restriction on using PSE to create things to sell, no more than on PS.

  • Can we use fill for images???

    All
    Had a question regarding changing images dynamically.
    Here's my requirement .I have an image and i need to change the color of the image dynamically when the user select different colors from the color pallete.
    I don't want to create have like 100 images and use those based on what the user selected.
    Can we achieve this in javaFX where i fill the image with a different color .Something like how we would use the "fill" attribute for circles and rectangles to fill in colors.
    Please help me out.
    Thanks

    You can also use Blend, it works well to colorize black & white images, for example.
    I played a bit with rakeshmenonp's code:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.image.*;
    import javafx.scene.effect.*;
    import javafx.scene.Group;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.layout.*;
    def img = Image {
        url: "file:///E:/Documents/Perso/Images/KM200.png"
    def imageViewCA = ImageView {
        image: img
        effect: ColorAdjust {
            brightness: 0.0 // -1 to 1
            contrast: 1     // 0.25 to 4
            hue: -0.7       // -1 to 1
            saturation: 1.0 // -1 to 1
    def imageViewBL = ImageView {
        image: img
        effect: Blend {
            mode: BlendMode.SCREEN
            topInput: Flood {
                paint: Color.BLUE
                width: img.width
                height: img.height
    def imageViewOrig = ImageView {
        image: img
    def imageGroup = Group {
        content: [
            ImageView {
                image: img
            Rectangle {
                opacity: 0.5
                fill: Color.RED
                width: img.width
                height: img.height
    Stage {
        scene: Scene {
            content: [
                Tile {
                    columns: 2
                    content: [ imageViewOrig, imageViewCA, imageViewBL, imageGroup ]
    }

  • How can i use an animated image in FORMS

    I like to use an animated image, means a jpg image created by a jpeg_animator, in a simple control image.
    Thanks for help.
    null

    i used an animated gif in my application.
    You could animate it, by using an activex-control (freeware). Download it from http://www.codeguru.com/atl/Gif89a.shtml.
    it works fine!

  • How can I use single source images in text?

    I'm using RoboHelp HTML 11, and I want to use single source images of icons in text, so that I have the ability to update the source image, as needed, and all instances of the image are updated automatically. The look is as follows:
    I've tried snippets, but they force a paragraph return in the text which I don't want.
    I tried inserting the source code for an image into a variable, but when I inserted the variable into the text, I got an error message in the text.
    Is there a way to use variables to do this or some other method?
    Thanks.

    HI there
    The one possible drawback to this approach would be if the image size changes. You *MAY* find that saving a different sized image and replacing one would result in perhaps needing to visit each instance of the image and right-clicking and choosing "Reset Size".
    I'm not sure why your variable failed with the image. Generally, it's simple to insert an image into the variable. I typically start the process by typing something like "XX" as the variable value. Then in the UDV pod, select the XX and replace it with the desired image.
    Cheers... Rick

  • Can I use an Iphone Image (not the apple logo) in a local flyer at my school?

    Can I make a flyer containing the images of an Iphone but not the apple logo. I'm a student and I'm buying used cell phones and reselling them to help with bills. I buy a lot of Iphones and I wanted to promote this. Is this allowed or do I need permission

    I should add I just plan on putting up a few flyers around my campus...nothing big.

  • How can I use MapQuest API in Adobe Flash CC?

    Hi all,
    Since Google Maps API will be deprecated in 3 months I'm trying to use MapQuest instead. (MapQuest Developer Network: Map APIs, SDKs and Web Services - MapQuest Developer Network)
    But I can't import the component MQFlashMapsAPI_7.1.5_MQ_MOBILE.swc into my project.. Any idea why?
    I've read that I have to import the core.swc from the Flex SDK.. I've put the core.swc file in the components folder, but when I'm going into the components window in Adobe Flash, neither core.swc or MQFlashMapsAPI are visible.
    Do you what should I do in order to import MQFlashMapsAPI in my project ?
    I'm using Adobe Flash pro CC
    Thank you for your help,

    I would be really shocked if it requires ActionScript 2.0 but CC doesn't support that. Otherwise I honestly don't know why it would want a flex library in a place you can't utilize Flex.
    You say you've used this API before. Is this the same MapQuest SWC version you successfully used before or is it updated? What version of flash did you successfully use this in? Lastly did you get Flex from Adobe (4.6.0) or Apache?

Maybe you are looking for