Converting an Image into a Button

Hello all,
I'm a very new user to Adobe Flash, and am trying to figure out some of the small things. I was wondering if anyone could help me out with how to convert an image into a button (with a URL).
Thank you!
Dave

Let's say you created a button symbol. The first thing you need to do to make it useful code-wise is to assign it a unique instance name.  So you drag a copy of it out to the stage from the library, and while it's still selected, you enter that unique instance name for it in the Properties panel... let's say you name it "btn1"
In AS3, to make a button work with code, you need to add an event listener and event hamdler function for it.  You might need to add a few (for different events, like rollover, rollout, clicking it, but for now we'll just say you want to be able to click it to get a web page to open.  In the timeline that holds that button, in a separate actions layer that you create, in a frame numbered the same as where that button exists, you would add the event listener:
btn1.addEventListener(MouseEvent.CLICK, btn1Click);
The name of the unique function for processing the clicking of that button is specified at the end of the event listener assignment, so now you just have to write that function out:
function btn1Click(evt:MouseEvent):void {
   var url:String = "http://www.awebsite.com/awebpage.html";
   var req:URLRequest = new URLRequest(url);
   navigateToURL(req);

Similar Messages

  • How can i convert an image into gif file as jpeg by using com.sun.image.*

    please help me to convert an image into gif format. i have used sun's impl com.sun.image.code.jpeg package to convert a buffered image into a jpeg file. is there any implementatioln available from sun to handle gif files.

    Many. Try for instance google with 'java image encoders'. Go to the URL http://www.google.com/search?q=java+image+encoders and be amazed of the wonders of modern web search tools.

  • Converting tiff images into jpeg

    I would like to convert tiff images into jpegs with iphoto. I dont want to duplicate all my photos and then have to delete one by one!
    How do I do this?

    Welcome to the Apple Discussions. The short answer is that you cannot. You will have to export the files via the File->Export->File Export menu option, selecting jpeg as the format and checking the box to include the keywords and comments, and maximum size. Then import the jpgs and delete the tiffs.
    You can get all of the tiff files together by doing a search for .tif. Then do a Select All (Command-A) and go to the export menu. Export all to a folder on the desktop. Import the new jpgs into iPhoto.
    To get rid of the tiffs once the jpgs are imported do another search for the tifs and select all again. Then type Command+Delete. That moves the tiff photos to iPhoto's Trash bin. Then empty the bin.
    If you have multiple files with the same file name you'll have to do some renaming before the export. You can batch rename them using the option Title to Date/Time or just date alone. I use the date taken as the file name as that gives me excellent chronological sorting and searching by filename for dates.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Convert Jpg images into patterns (.pat)

    Is it possible to Batch convert Jpg images into .pat files? I am familiar with the define pattern function but what I really need is to convert many jpg's.
    Thanks

    Use edit Define pattern on the image to define a Photoshop pattern. Then use the preset manager to save the pattern as a *.pat file.....
    To batch this you may need to use a Photoshop Script to name the patterns a action define pattern step would have a hard code pattern name. Changing that step to a script could retrieve the document name and set the pattern name the same as the jpeg name.  You could define many patterns that way then use the preset manager select all the defined patterns and save a single *.pat file with that set of patterns.

  • How to convert jpeg image  into vector

    I have jpeg  image which contains line and circle. i want  to convert this image as a vector  and  i need to export  into DXF file format.
    In my illustrator i am not able to find live Trace option. how to enable live trace option.
    can anyone  help me to convert this,because  i am new to Adobe Illustrator.
    Thanks  in Advance.

    If you do want to use the image trace option here is how you do it:
    If you have nothing selected your contextual menu should look something like this:
    If you have your image selected your contextual menu will look like this.
    You can use the image trace from that button. to find it through the menu go here:

  • How can i convert CR2 images into jpg format, without iPhoto?

    i just import a lot of images with the format .CR2 to mac through "Image capture" is there an app to convert the frmat into .jpg, app like image capture or something like that?

    If Canons software doesn't work...?
    Try Snap Converter, File Juicer or Contenta Converter

  • Making a loaded external image into a button in Actionscript

    My name is Steve Oatman I am a student at
    AIO for a Web Design Diploma
    class: Interactive Telecommunications IMD412 XA
    Professors to bussy!
    I have a flash web site that I am putting together. I am using AS to load some images from an external source. These images are being loaded into a movieclip. These images need to become buttons once they are loaded. The images will link to the particular menu category pages beef, chicken, etc.
    The images are loading fine they just are not responding like a button or link.
    I am getting two error referencing the buttonMode and usehandCursor. Below is just one image that I am working on till I get it to work.
    I am getting these two Compiler error code:
    1119: Access of possibly undefined property buttonMode through a reference with static type flash.display:Loader.
    1119: Access of possibly undefined property useHandCursor through a reference with static type flash.display:Loader.
    This is what I have.
    var myLoader01:Loader = new Loader();
    myLoader01.load(new URLRequest("entrees_images/beef/beef01.gif"));
    addChild(myLoader01);
    myLoader01.x = -269;
    myLoader01.y = -164;
    myLoader01.buttonMode = true;
    myLoader01.useHandCursor = true;
    myLoader01.addEventListener(MouseEvent.CLICK, beefClick);
    function beefClick(event:MouseEvent):void{
    gotoAndStop("beef");
    From me searching online I thought the
    name.buttonMode = true;
    turned the element into a button!
    I have included the fla file. This is in the menuItems_mc which is located in the pageContent_mc frame 40 layer page Image or of course the library.
    I know this is a little in depth sorry and any help would be greatly appreciated.
    Steve
    713/742-3325

    Try something along the following lines:
    var myLoader01:Loader = new Loader();
    function addIt(evt:Event):void{
       var aBtn:MovieClip = new MovieClip();
       aBtn.x = -269;
       aBtn.y = -164;
       aBtn.buttonMode = true;
       addChild(aBtn);
       aBtn.addChild(myLoader01);
       aBtn.addEventListener(MouseEvent.CLICK, beefClick);
    myLoader01.contentLoaderInfo.addEventListener(Event.COMPLETE, addIt);
    myLoader01.load(new URLRequest("entrees_images/beef/beef01.gif"));
    function beefClick(event:MouseEvent):void{
       gotoAndStop("beef");

  • How to convert jpeg images into video file of any ext using JMF

    I want to convert the Jpeg files into video clip with the help of JMF
    any one can help me?
    Plz reply me at [email protected]
    or [email protected]

    I'm not sure of his/her reasoning behind this, but I have yet to find a way to record video with mmapi on j2me. So with that restriction, I can see how one could make it so that it just records a lot of jpegs, and then makes it a movie.
    I would be interested finding a workaround for this too. Either if someone would explain how to record video with mmapi or how to make recorded images into a video. Thanks!

  • How to Convert Bitmap Images into WPF XAML files

    I am tasked with converting about twenty bitmap images into a workable XAML file complete with all of the path statements, line segments, arc segments, etc. Is there a tool out there that take the bitmap image and create an entirely new XAML file?
    Thanks,
    Barton

    Hi,
    maybe:
    http://stevenhollidge.blogspot.de/2012/05/converting-images-to-paths.html
    http://stackoverflow.com/questions/129972/convert-an-image-to-xaml
    http://stackoverflow.com/questions/15082716/can-we-convert-an-image-to-xaml-using-expression-blend
    this is not a trivial task [and maybe beyond the scope of this forum]. If you had some vector image like svg images there might be a control out to use, but with raster images, I dont know of any control or code to use; I *think*, you will have to vectorize
    the image content yourself, which isn't that easy...
    So, is Background and Foreground easily distinguishable? Do shapes overlap? ...
    If there are only some shapes in the image and BG and FG can be separated easily then you could "scan" the image by some chaincode like operation to get the contours/contour vectors and then decide what to do. If there are patterns in BG or FG
    things will become more difficult, you then will have to perform more math-to-image operations and a vector-representation while reading/scanning the image might not be enough (keywords are computer vision, pattern recognition [with multi-linear-forms] etc).
    Maybe an existing computer vision [-able] component loke opencv can help a lot...
    Edit: I just did a google lookup and found eg this:
    http://www.cs.ucla.edu/~dt/theses/vasilescu-thesis.pdf
    I havent read it so far, so I cannot say, if its what you need, but title and a quick view into looks promising/interesting.
    Regards,
      Thorsten

  • Converting raw images into jpeg images

    I am trying to build a small application that can help me to convert raw images (of one of my cam) into JPG image.
    i have earched in google ans found many API ie, JRAWIO,JAI,mistral-0.9.6.809 and Imagero.. but i am not able to understand how to use them in my program..
    JRAWIO is helping me to convert NEF and TIFF. though it has functionality fto use it for CR2 ans othr but i failed to use them..
    plz help me out if possible with code(full if possible) and step by step description...

    Hi,
    we can not do the homework for you but we can help you out to the right direction.
    1- Get the input stream from the image file ( source )
    InputStream is = new BufferedInputStream(new FileInputStream(
                        "C:\\tmp\\sasha.jpg"));
    2- Get your BufferedImage
    BufferedImage buffImage = ImageIO.read(is);
    3- look at the API docs for BufferedImage it contains the image data ( Raster)
    4- I have not looked at the source code for the JRAWIO but I think it uses javax.imageio.* as an underlying transformation engine
    Regards,
    Alan Mehio
    London,UK

  • Converting U8 image into RGB

    I have a pixelink camera that when I run through the IMAQdx vi's, it produces a BW image.  When I view the image, I can select from the palette bar when I right click on the image out display and select rainbow, temperature, etc....but I can't save these colored images.  I'm guessing that the image out viewer converts the U8 image into a RGB image for display.  I would expect that there would of been a VI (or maybe there is and I haven't seen it) that would do this task and allow you to save the image as a RGB.  Is there a VI to do this?
    Thanks,
    guilio_2008

    Do you have the NI Vision Development Module? If so, this sloppy little bit of code will let you change an image palette on the fly, then save out a copy of the color image you see. You can also choose a user defined palette and create your own palette with the color ramp next to the window.
    -root
    Message Edited by Root Canal on 05-05-2009 11:11 AM
    global variables make robots angry
    Attachments:
    happy colors.vi ‏67 KB
    forbidden planet.png ‏629 KB
    happy colors.PNG ‏211 KB

  • Converting an image into numeric array?

    I want to sum all the pixel values in a image. I was thinking of using the Add Array Elements VI. Is their an easy way to convert an U8 or an I16 bit image into a numeric array? Thank you in advance.

    Is this a BW image? (If the image is paletted or color, a summing operation is poorly defined! )
    Just convert your image data to a 2D boolean array using unflatten pixmap, then feed the 1bit pixmap to "boolean to 0..1" followed by the SUM operation (in case it overflows, you might want to convert it to a better representation before summing, e.g. DBL. "boolean to 0,1" generates I16).
    Message Edited by altenbach on 06-01-2005 02:44 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SumImage.png ‏2 KB

  • Convert imaq image into image vidéo format

    hi,
    (i'm using a french version of labview 7.0, so please answer with components in french!!!)
    i need to convert an IMAQ image (coming out from an IMAQ-Acquire vi) into the image format that comes out from the following vi: 
    "Tracer une table de pixels redressé", whic in my case has a 24bit-pixmap in input.  
    On the help I can't find what image format comes out from "Tracer une table de pixels redressé" and after several essays  I can't find a suitable vi converter.
    please help me.
    thank you very much
    fil

    thank you for the reply
    yes i checked but i found nothing special.
    actually i have tried to route the imaq-image into a 'createJPEGfil' vi. then i loaded the jpegfile, routed it into a 'redresser table de pixel' and then into 'tracer une table de pixel radressé' which has the output that i needed ('image'  type).  but that's sad, as i'm obliged to access to the hard-disk; saving and loading a jpeg file, hence slowing down the all thing.
    any other ideaz?
    merci
    fil

  • How convert an image into its RGB value

    i want to find out how to convert an image files such as .gif or .jpg into its RGB value so that i can find out how much amount of a particular colors contain in the image.

    Try this:
    public int countColors(String filename) throws IOException {
    BufferedImage image = ImageIO.read(new FileInputStream(filename));
    Set colors = new HashSet();
    int height = image.getHeight();
    int width = image.getWidth();
    for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
    colors.add(new Integer(image.getRGB(x, y)));
    return colors.size();

  • Batch converting psd images into jpegs in pse 10 or 11?

    I want to batch convert the above. I know i can convert one image at a time. If not can one recommend a batch conversion program which is safe to use and free from viri  and malaware.  Thanks!!

    And when you are in the process multiple files menu what do you select from their to do the batch processing of the psd images to the jpeg images.   I need a step by step here.  Thanks!!

Maybe you are looking for