Clickable image

Can someone tell me how to make it appear a dialog box by clicking on an image?

Here is my sample code:

var pos2:Shape = new Shape();
            pos2.graphics.beginFill(0xFF0000);
            pos2.graphics.drawRect(382,50,260,240);
            pos2.graphics.endFill();
            pos2.addEventListener(MouseEvent.CLICK, openDialog);
addChild(pos2);

...

private function openDialog(event:MouseEvent):void
        {
            stage.nativeWindow.close();
            var alert = new AlertDialog();
            alert.title = "Warning";
            alert.message = "This operation may harm your computer. Do you still want to proceed?";
            alert.addButton("OK");
            alert.addButton("CANCEL");
            alert.addEventListener(DialogEvent.DIALOG_BUTTON_CLICKED, alertButtonClicked);
            alert.show();
        }

Please and thank you!

Hey gyubok,

You can listen only MouseEvents on objects that implement or extend another class that implements the InteractiveObject class. Shapes are not part of this package. You will need to you something like a sprite in order to meet the MouseEvents such as click. Try to replace your shape with a sprite and see how that works for you:

var pos2:Sprite = new Sprite();          pos2.graphics.beginFill(0xFF0000);            pos2.graphics.drawRect(382,50,260,240);           pos2.graphics.endFill();          pos2.addEventListener(MouseEvent.CLICK, openDialog);addChild(pos2);

Hope that helps. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Button not clickable image in HTML5 Canvas export?

    Everyone knows about this problem when you use an image as 'up' frame for a button symbol makes it not clickable when HTML5 canvas export?

    Image button works when I "found" in Adobe animate CC, but when I export, it is not clickable, nor shows more status etc..

    I tried to convert the image into an image in a button and a clip in a button, but does not solve the problem.

    When I switch the contents of the frame button to a vector shape, it works fine.

    Any ideas would be greatly appreciated.

    Buttons do not seem to work perfectly. Even with the first image that contains a bitmap image.

    Check if you use spritesheets. If you are and it's a JSON file, then things break. Use either don't not spritesheets, or put your files on a test server.

  • Blast from the past: how to draw clickable images in Dreamweaver CC 2014?

    Need to update some old stuff and can´t find where to draw picture cards on the images.

    First, you must be in Design mode to get the image map tools to appear.

    Once there, the icons of image map should show when you select an image. If they are not, you can have your properties panel themselves are collapsed. There is a small triangle in the lower right corner of the properties panel, click that to expand the Panel to include the image tools.

  • Clickable image ADF

    Hello

    I want to display an icon "favorite" that a user can click. Whenever a user clicks on the icon, I need to call a java method that I wrote which toggle favorite between true and false.

    How can I accomplish this? What I need to use Javascript, or is it a component ADF I can use which has a property, I can put it.

    Thank you!
    Mitch

    Hello

    You can sorround the image with the Commandlink and use the commandlink's action property to call the java method

    Code:



    shortDesc = 'test' id = "i1" / >

  • How to replace the image that contains clickable images?

    I use RoboHelp HTML 8. Some of my help topics have an image that contains several interactive images that allow the user to click to see, for example, the field or button definitions on objects on this image. In the past, I was able to grasp or to create a new image file and give it exactly the same name as the old image file (for example, ccm_assessment_shg.gif)-a new replacing the old. and when I saw the image in RoboHelp HTML, the new image contain still all image maps of the original image.

    However, now I see an image (.png) file in one of my subjects and I would like to replace it, but my old process 'replacement with the same name' does not seem to work. What is my problem? How can I do this in RoboHelp 8? Is the problem related to the file must be a gif instead of a png? (I must confess that it's been several months that I worked in RoboHelp, so I just forgot something. I can't find instructions on the use of image maps and self-help groups).

    Thanks a lot for all the good advice!

    Hello

    Exactly how you try to replace the image? I ask, because if you open the dialog box Image and work this way, you will probably lose the connection with the regions of image maps. My preferred method is to simply work completely behind RoboHelp back by replacing the image using Windows Explorer. RoboHelp should be none the wiser as long as the file name and location are the same.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Add clickable images to Flex

    In my flex-2 design, I have a need to put an image in the program, and then set the image points that trigger events.
    In retail, I want a map of the United States, in which case the user is:
    1 - click on a State.
    2 - mouse on a State
    (I haven't decided)

    An event is raised I may popup a box and display data to the user.

    I don't think I need to use a file pre-generated SWF to do this, as the flex should be able to handle this via AS - 3.

    Here's a way to do it:

    Create a new class that extends the canvas. Place your image (whether in the form of MXML or through ActionScript) in this class.

    The class must have a child UIComponent are complemented by the Image so that it lies on top of the Image. In the updateDisplayList function or when the image has loaded (that is to say, certain events to trigger this), create a series of form s (see flash.display.Shape) object and add them to the UIComponent.

    Draw your shapes with their graphical properties, but use a fill Uni with alpha = 0. You won't get the mouse events if only to draw something and alpha will make them invisible but selectable.

    Add an eventHandler for the UIComponent to capture mouse clicks. The UIComponent will receive only clicks on the forms. You can then be shipping your own event depending on what form was taken or simply let the bubble of click event.

    Note: you can draw directly on the chart of the UIComponent too, but it will be easier to say where the mouse was clicked if you use distinct forms.

    Note: If you want to change the cursor in a helping hand on the form, set the UIComponent = "true" useHandCursor its buttonMode = "true"; its mouseChildren = "false". You need all 3 to see the hand cursor.

  • non-clickable image

    Hello

    I open a new Jframe update whenever a user clicks on the "Update" button located on my main JFrame. Now, what I want is that user should not be able to click the update button again until it has cancel the update previously opened JFrame. I saw these senerios in which a user could do nothing else until it was close the open border as in the case of
    JOptionPane.showMessage....
    Thanks and greetings
    Umer

    Create the model instead of the JFrame JDialog.

  • How to make images orginated table ranked clickable report?

    How do table came from the clickable images to the rank of report?

    Do the small example application with page 4 click img which is IR report showing pictures of the table test_images and v1_test_images.

    The v1_test_images is just seen on test_images that is necessary to seduce the 'blob format' to extract images from the same table on the same report.

    Now, I would like to be able to click on the 'images' in the report and may for example branch to another page etc...

    I know that on the line, there may be a clickable image from the shared components of work/application space images and the image name can be changed with sql.

    But I would like to have multiple images on the same line and those who were taken from the table, as in the sample application.

    workspace: imagetest_ws

    application: 13418

    page in question: https://apex.oracle.com/pls/apex/f?p=13418:4

    user of the developer: guru

    pass: meditation


    rgrds Paavo

    Doesn't seem to be possible to combine the BLOB format masks declarative with standard column links (it looks like a bug). What you can do is to use the apex_util.get_blob_file_src API method to get the URL of the image in the report query:

    ...
      , apex_util.get_blob_file_src(
            'P3_CONTENT'
          , case
              when e.sal > 2500 then 21
              else 41
            end) img1
    ...
    

    and create the link to the image in the HTML column report Expression attribute:

    
    
  • Image in the body of NotificationDialog

    Hello

    I try to include an image in the body of a triggered notificationDialog on the side without head of my application. I see several made BlackBerry applications such as calendar doing this. They have even managed to make the clickable image as ImageButton in qml.

    Anyone know how I can achieve this? (image not clickage would be great to start)

    Thank you.

    * Edit: Added the screenshot of what I mean

    I think his problem is that he use it to headless, as mentioned. Only NotificationDialog is available from headless.

  • How to open a link in the browser when clicking on Image?

    I created a clickable image. Now, I want to open a link in the browser when clicking on Image.

    How to get there?

    Call Browser.getDefaultSession () .displayPage (String url)

  • Dreamweaver CC 2015.3 interactive images - Hotspots do drag and drop does not work

    Dear all,

    I use Dreamweaver CC 2015.3 and try to use the Image Map option. I'm not using it in Liveveiw so there must be another problem.

    I have inserted a picture and give MapId image2. After that, I tried to drag and drop all three circle, polygon, and rectangle. Nothing happened.

    No map tag is packed. Nothing happens. What is the reason?

    Thank you

    Amir

    mamirs wrote:

    ... I have inserted a picture and give MapId image2.

    As much I know "MapId" is not an attribute of html for creating / using the clickable images.

    An image map using an attribute called 'well' in the tag which must match the attribute "name" of the tag. DW will write the attribute well, and tags automatically when you draw a shape, there is no need to add your own before drawing a card form (maybe it's and the use of an invalid attribute is confusing the program?). If you want to change the name of , make you in the properties of the window after you have created a form and DW will automatically update the necessary elements.

    To use the image map tools...

    1. place an image into your page (the tag should be used, image maps do not work on css-background images)
    2 single-left-click on the image in Design view to select it (a black box appears). If you see a blue border and a tab, when you click the image, you again Live View Editor and click on the triangle next to the Code, Split and buttons direct to change design

    3 left - click the shape you want in the Properties window to select the tool

    4. go to the image, click and drag (to a circle or square) or click on several points (for the polygon tool) to create your interactive image tag
    5. change the name of the card on the card Properties window

  • DREAMWEAVERCC 2015: Creating Image maps, please help!

    I have had no problem of creating interactive images before this last update and now I can't even image to align, fine not the real problem: create and edit clickable images. Don't know what happened, I'm in a transitional doc 4.0 that I built the last image maps in. Now, the only way it appears is if I select the code, which is fine, but as soon as I try to draw the map/edit I'm stuck back.

    Shot in the old code from the working file and I can't change it (same question, select code, option, select either the arrow select card or draw a shape, start drawing and then locked) so I'm not sure what should happen.

    There are image maps for us in these pictures.

    Are you accidentally in Live View mode?

    Design and Live are now in a drop-down menu in the taskbar near Code and Split. The editor in Live mode does not image mapping again.

    If you don't have the design view option in the dropdown menu with Live, you will need to make a small change to your fluid grid css file to retrieve.

    If you are in Design mode and the Image Map tools are not displayed, you should see a small triangle at the bottom right of the main window of properties that you can click to retrieve the IM toolbar.

  • The picture card no longer works when the location of the image is changed

    I spent a lot of time creating clickable images on a .png to a graphic image in Dreamweaver CS6.  When I downloaded the file on the web, I realized that I had made the connection between a file that was in my downloads folder. When I changed the source for the file in Dreamweaver hotspots correspond more spots on the image! If I resize the image, the hotspots get resized too, so they no longer correspond. What can I do? The image is the exact same that was used originally, but I had resized it before adding the hotspots.

    Thank you!!!

    I found myself just to redo the map image to fit the new image. It was not as hard as I thought it would be. Based on questions from other people, I realized that there is no easy solution. Thanks a lot for your help!

  • JPG not accessing image map only or import media

    I'm trying to link the WMV file with clickable images on a jpg file in a CHM created by RoboHelp 9. It seems that it works, and if I preview the page, the links work. But when I generate the CHM file completed, media are not accessible. I returned to the project manager and saw that the media had not imported to the project. I have a wen for the Windows file manager and media in the right area of the project. I tried to import as a medium and as a file. I tried as a luggage as well file by selecting the file in the destination list. Someone knows how to do this?

    WIN7 TCS 3.5

    Ok. I added the WMV files in hatracks then lie and output a new CHM file... it worked. Guess you have to do things a little different by connecting media images clickable with hyperlinks. Anyone know what indicates the area green bit on the icon of luggage?

  • An iFrame shows no images, others

    Hi there, I'm a little crazy here. I have an old site running in GL CS2 with some pages that have an iFrame. Although there is that nothing has changed on the page, a page with an iFrame suddenly stopped showing their clickable images. This site has other pages with iFrames that show their images without any problems. The only thing different, is that they are not clickable. When I preview the GL to Firefox iFrame, everything is ok. When I do the same with the page that contains the iFrame that is ok too. The pages are fed by a template page I checked but can not see something wrong. In addition, it has worked before without problems. What Miss me?

    The images appear to be fine.

    There are a few adblockers and system security tools that can filter the images that appear in a path with the word "banners".  See more info on this:

    http://www.WebmasterWorld.com/forum10/5547.htm

Maybe you are looking for