OnPress doesn't work on image...

Hi there,
I am having a problem when trying to add an onPress handler
to a JPG which is loaded into a movieclip.
onPress doesn't work.
ActionScript Code:
for (i=0; i<ecards.length; i++) {
var mc:MovieClip = attachMovie("recipient", "recipient"+i,
i);
mc.loadMovie("images/button.jpg");
mc.onPress = function(){
trace(this._name);
"recipient" is a 100x75 rectangle (same size as JPG).
if I comment the line "mc.loadMovie("images/button.jpg");" it
displays only the original mc and traces the name property, but
when I load the image into it, it doesn't trace it anymore.
Any help would be appreciated.
Thanks in advance!

I got a solution from Ali Inhan at Actionscript.org:
for (i = 0; i < ecards.length; i++) {
var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
mcl.addListener(listener);
listener.onLoadInit = function(m:MovieClip) {
m.onPress = function() {
trace(this._name);
var mc:MovieClip = attachMovie("recipient", "recipient" + i,
i); mcl.loadClip("images/button.jpg", mc);
}

Similar Messages

  • ActionListener doesn't work with image command_button

    Hi,
    with EA4, if I set an ActionListener on a command_button without specifying the image attribute, everything just works fine.
    If I now replace the label attribute with an image attribute, the action listener is no longer triggered.
    It seems that nobody reported this problem before, so maybe I've missed something.
    I tried several ways to make it work, but without success.
    Any clue ?
    Here is the code of my test :
    ** index.jsp :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <head>
    <title>
    Action listener and image command button
    </title>
    </head>
    <body>
    <f:use_faces>
    <h:form id="form" formName="form">
    <h:command_button id="clickButton" commandName="click" image="foo.gif">
    <f:action_listener type="foo.MyBeanActionListener" />
    </h:command_button>
    <h:output_text id="text" valueRef="MyBeanActionListener.text" />
    </h:form>
    </f:use_faces>
    </body>
    </html>
    ** faces-config.xml :
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
    <managed-bean>
    <managed-bean-name>MyBeanActionListener</managed-bean-name>
    <managed-bean-class>
    foo.MyBeanActionListener
    </managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </faces-config>
    ** MyBeanActionListener :
    package foo;
    import javax.faces.event.*;
    import javax.faces.application.*;
    import javax.faces.FactoryFinder;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    public class MyBeanActionListener implements ActionListener {
    private String text;
    public void processAction(ActionEvent event) throws AbortProcessingException {
    FacesContext context = FacesContext.getCurrentInstance();
    ApplicationFactory factory = (ApplicationFactory)
    FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    Application application = factory.getApplication();
    ValueBinding binding = application.getValueBinding("MyBeanActionListener.text");
    binding.setValue(context, "Button was Clicked");
    public PhaseId getPhaseId() {
    return PhaseId.ANY_PHASE;
    public void setText(String text) {
    this.text = text;
    public String getText() {
    return text;
    Thanks in advance.
    Michael

    but with EA4 the TLD doesn't
    define any src attribute for tag command_button.
    Do you (or anybody) have another idea ?oh - sorry about that ... i was looking at some other tag on my JSP and wrote this ...
    yeah, but an absolute URL does solve the problem ... or if u want it to work with a relative URL - use the HTML <base href=".." /> tag to establish the base

  • Onclick doesn't work with images

    why would you not encorporate the onclick event for images, images are after all such a big part of webpages, it severly messes up so many websites, can you please make the next version work onclick for images?
    == URL of affected sites ==
    http://
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)

    If you can't click on images then there is either a problem with that website code like another element is covering the link or you have a problem with an extension.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500. HP says to go through Preview, Image Capture, or Print/Scan in System Prefs. Still doesn't work. Any ideas/similar experiences?

    Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500.
    HP says to go through Preview, Image Capture, or Print/Scan in System Prefs.
    Still doesn't work. Any ideas/similar experiences?

    Sure it is, yet it's called HP LaserJet Professional M1210nf MFP Series *
    Today, I followed your other advice, and deleted the printer, deleted the /Library/Printer/hp folder, downloaded the entire set of driver, re-installed the printer twice, once with the driver, once with Bonjour.
    The Bonjour Printer has the scan option active, but it is doesn't work (refer to above.), it is called M1217nfw
    The Apple Driver Printer doesn't show the scan option at all, it is called M1217nf (as on the http://support.apple.com/kb/HT3669#HP list.) This model number doesn't exist, as far as I can tell. 
    Still, everything works perfectly in Snow Leopard, for a MF printer that has been manufactured years after Snow Leopard was released.
    Why going up in software version means going backwards in compatiblity for brand new product is really the question that puzzles me here.

  • Disk Utility image disk doesn't work

    Disk Utility doesn't help
    Hi there!
    I try to install the os x mavericks update on a Snow Leopard 10.6.4 Mac from the Apple page. A message told me there was an error on the disk so I tried to repair it with Disk Utility. It didn't work. It ask me to make an image copy, It doesn't work neither. I am not able to go back or forward from there.
    There was a message coming up telling me "cannot allocate memory".
    I wrongly supposed it was a external hard disk problem so I bought a 3TB hard disc to make an image disc copy but again it didn't work.
    I try to use Disk Utility to repair or make an image copy of the Macintosh (running from my Mac or the Install DVD) but it cannot repair the hard drive or make a disk image. Depending on the options I choose messages like: "input/output error" or "cannot allocate memory".. keep coming up. I don't know what to do any longer.
    Before going forward I want to save my all my data.
    Can you help me please?

    Step one is to erase and reformat the 3 TB HD you bought. Ensure that it's Mac OS Extended with the GUID option. Next, use something like Carbon Copy Cloner or SuperDuper! to put a bootable backup/clone onto the ext HD. Ensure that you can boot the machine with it. Boot into the backup/clone, launch Disk Utility and repair the int HD. If successful, update it to 10.6.8. Boot with the int HD and update the clone. Once that's finished, try upgrading either it or the clone to Mavericks.
    iMac (27-inch Mid 2011), OS X Mavericks (10.9.4), SL & ML, G4 450 MP w/Leopard, 9.2.2

  • Inserting dynamic image doesn't work for range of records

    Hi,
    I'm using BI Publisher 5.6.3 and E-business Suite 12.1.3.
    I have set up my RTF template so that it brings in a logo image dynamically onto an invoice.
    The code in the "alt text" field behind my dummy image is: url:{concat('${OA_MEDIA}/',//CF_LOGO)} 
    The image is within a repeating loop that loops around the invoices chosen.
    It works fine if I run the concurrent request for a single invoice - the correct logo image is shown.
    However if I run the concurrent request for a range of invoices which should contain a mixture of both logos it doesn't work and prints the same logo for each invoice regardless of what it should be displaying.
    For testing purposes I also output the name of the image, field CF_LOGO (which is calculated in a formula in the RDF file) just before the actual image, and this always displays the correct value even for a range of invoices. As you can see above this is the field that I include in the code to obtain the image.
    Does anyone have any idea why a range of invoices will only display one logo image?
    Many thanks for any suggestions.
    Regards,
    Hazel

    It's a bug in MDM 5.5 SP04.  The fix is in MDM 5.5 SP05.

  • Lightroom 5.7.1, Yosemite OS X - Synchronise Folder function doesn't work in Lr. Is there a compatibility issue? I can see the folders/images in Finder but when trying to synchronise folders in Lr it does not recognise that there are any images and theref

    Lightroom 5.7.1, Yosemite OS X - Synchronise Folder function doesn't work in Lr.
    Is there a compatibility issue? I can see the folders/images in Finder but when trying to synchronise folders in Lr it does not recognise that there are any images and therefore unable to import to catalogue. Anyone has any idea how to make it work. Thanks a lot.

    Hi Elba,
    Thank you very much for your reply. Not sure, however, that we are talking about the same problem.
    I am trying to perform the same function in Lr that I have been doing for many years in the past and has only been a problem in the last few days (possibly coinciding with upgrading to Yosemite, trying to find out whether that is the problem)
    I am not intending to sync any files with Creative Cloud but only trying to use 'Synchronize Folder' function in Lr. Normally, I would right click on a particular folder in Lr catalogue and click on that function to check that the Lr Catalogue is perfectly matching my drives where the original photos are actually stored.
    The problem that I only started to encounter is that I can see the files on the actual drives but they do not appear in my Lr Catalogue and they are completely invisible to Lr. I simply can not get Lr to recognise them and then import them to catalogue.
    If for example, I export images to Ps and then save and close them, they do appear on my drive but are invisible to Lr and I can't get them imported into the catalogue. Import to folder also not producing any results as they are still invisible to Lr.
    Completely baffled by it. Any idea what could be the reason?
    Kind regards,
    Nik

  • Elements 11.  Resize image tool doesn't work.  Tried online chat with Adobe  - no help.

    I recently got a new computer (pc) and decided to download Elements 11 instead of the old version that was on my old computer.   I've discovered that the image resizing tool doesn't work, although the other functions seem to be working fine.
    I tried an online chat with Adobe.  Their suggestion was to buy another photo service from them for $10./month !!

    Do you have Resample Image and Constrain Proportions checked?

  • Translation from CS5 to Cloud doesn't  work correct, navi and linked images are broken.

    Translation from CS5 to Cloud doesn't  work correct, <navi> and linked images are broken.
    The data of CS5 was created at another PC. I installed Cloud version into two different PC. One has had the site data since dreamweaver CS5 and it works correct in Cloud version. Another PC got the site data from remote server and it doesn't work correct. <navi> and linked image are broken.

    Another PC got the site data from remote server and it doesn't work correct. <navi> and linked image are broken.
    This implies your site is not properly defined in DW.  Go to Site > Manage Sites.
    Or simply go to your other installation of DW and export the site definition file from Manage Sites.
    Save it to a flash stick or other removable drive.  Then import the STE file into your 2nd installation of  DW.
    Nancy O.

  • Hue saturation doesn't work on some images.

    My hue and saturation doesn't work on some images.

    Apologies for the brief and cryptic question. Frustration.
    This is a TIFF file. Originally it was a RAW image that had a preset applied in ACR, then a black and white preset layer added. Then a couple small edits with contrast, plus an unsharp mask and high pass, completed with the flattening of the image and finally saved as a TIFF.
    I believe it may have been the flattening, but when I close the image and reopen it it only has one layer. I can go in and edit this reopened image in a new brightness/contrast layer, but hue/contrast seems dead. Unless I colorize the image.
    I have a hue/contrast preset I like to use as well, and if I add that preset when the TIFF is reopened hue and saturation can be manipulated.
    Your question is exactly the one I have been asking. Any help would be appreciated. Thanks for your initial response.

  • Image Policy when I create a PDF file: warn and continue doesn't work

    Hi!
    I need to create a PDF file with lots of images, and I need to know if any of that images is in low resolution (<300 ppi). I have tried to use the image policy in the PDF settings but it doesn't work, because if I choose "Warn and continue" (if the resolution of any image is <300 ppi, warn and continue) the program creates the PDF file but don't warm me and I don't see any message... and I'm sure that there are bad images because I have made a check test with 72ppi images.
    Thank you very much for your attention,
    best regards!!
    (Sorry if my English is not as good as it would be)

    Thank you very much Bernd Alheit, that's perfect for my job!
    Thank you!

  • Itemrenderer with images doesn't work  correctly if variableRowHeight="true"?

    Hi all,
    I have a problem to use itemrenderer in my project:
    I have to show some images in one of my DataGridColumn:
    <mx:DataGridColumn id="datasetcolumn" headerText="DataSet"
    dataField="dataSetList"
    width="240"itemRenderer="DataSetRenderer"/>
    The dataSetList is an arraycollection of images;
    I use Tile as the itemrederer, My DataSetRenderer is:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Tile xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" width="90%" height="100%" >
    <mx:Metadata>
    [Event(name="showCaddwgNOVWebDataset",
    type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import mx.controls.Image;
    import mx.controls.AdvancedDataGrid;
    import mx.core.IFlexDisplayObject;
    import CETEvent.*;
    import view.util.*;
    import mx.collections.ArrayCollection;
    [Bindable] public var myarr:ArrayCollection = new
    ArrayCollection();
    override public function set data(value:Object):void{
    super.data = value;
    myarr = value.datasetList;
    this.myrep.dataProvider = myarr as ArrayCollection;
    ]]>
    </mx:Script>
    <mx:Repeater id="myrep" visible="true" >
    <mx:Label text="{myrep.currentItem.itIconName}"/>
    <mx:Image id="datasetImg"
    source="{myrep.currentItem.itIconName}"
    useHandCursor="true" buttonMode="true" mouseChildren="false"
    toolTip="{myrep.currentItem.itName}"/>
    </mx:Repeater>
    </mx:Tile>
    The problem is:
    Whenever you change the column size or scroll down the
    datagrid,
    the images will be added again.
    if the datasetlist is changed the old images doesn't clean up
    and
    all the images messed up
    Any suggestion is appretiated!
    Thanks in advance

    I loved Ben's suggestion because it promised to be a low-effort workaround, but, alas, I get the same problem: "lvlib is already loaded from this path...".
    I tried Olivia's workaround for CAR 124214. It worked great for the simple lvproj that is posted above. (Hooray!) It didn't work so well in my real project, that has about 30 lvlibs and lvclasses. About 3/4 of the way through the save, I got a compiler error and LabView crashed. (Boo!) I submitted the crash log on this, but it's hard to imagine how anyone in R&D could make any progress debugging this without the source code. (And I can't submit the source because I can't export a copy of it!)
    Anyway, thank you very much Ben and Olivia for your suggestions. I have lvclasses embedded in lvlibs (primarily for organizational reasons) and since LabView tanked while saving one of those, perhaps the workaround doesn't work in this case. I may try again after removing the lvclasses from the lvlibs so that the hierarchy is flatter.
    -Rob 

  • Why doesn't the Zoom work on images in Firefox 4 ? The page Zoom works for webpages but not for pictures like Firefox 3.7 did :(

    I have already seen the "page Zoom" help article and that doesn't solve the problem.
    with Firefox 3.7 i could view an image and use the "control" & + & - keys to zoom in and out but with the new Firefox4 that zoom only works on webpages and does not work for images like it did before.
    is there a solution to this ?
    example:
    http://nssdc.gsfc.nasa.gov/planetary/lunar/images/a11easep.jpg
    when i had Firefox 3.7 , i could zoom in and out but now it doesn't work with Firefox4
    what's the deal ? : )

    Check the Zoom settings: View > Zoom > Zoom Text Only
    * http://kb.mozillazine.org/Zoom_text_of_web_pages
    Press F10 or press and hold the Alt key down to bring up the "Menu Bar" temporarily.

  • Content Aware Fill doesn't work on large images

    When stitching together a large panorama, the content aware tool doesn't work if the image is >30,000 pixels.  When you use the tool on large images (after I have flattened the layers and using the magic wand to select a white area at the top), it runs through the process as if it is going to fill and then after the "fill" window completes, the selected area remains white.
    I noticed on some other forum posts that jpg saving couldn't occur on >30,000 pixel width images, so I changed the image size to 29,999 (from ~39,000) and the content fill tool worked.
    Any ideas from the community if Adobe has a fix for this bug?

    I found that I could get around this problem by doing sections instead of a complete linear fill (when you do panoramas, you tend to have a long white area on the top and bottom of the image - this is what I have been working with). 
    The downside with working in sections is you get some pattern matching issues so you have to go and do spot work until it looks the way you want.
    Another interesting artifact from doing long linear sections is you have an edge (a line) between the fill and the original image.  To remove this, I zoom very close and use the lasso tool to select only that line.  Using the content fill tool to fix this is a very easy, clean solution.

  • Photoshop CS5 doesn't work properly after opening too many images

    Hi
    This is my very first post.
    I'm also new to CS5. I do hundreds of photo touching/cropping that is a part of my job for web.
    Everything is running fine but when ever I open too many images in Photoshop CS5 it doesn't work, I mean it doesn't hang or freezes it just open all files and then doesn't show any images (just blank) and when I closes 20/30 or more images then it get fine.
    I thought it might a RAM problem but i have i3 processor with 4GB of RAM. I have also increased memory usage from 60% to 80% but I'm still facing the same problem.
    Would like to tell that in the previous version of CS3 I never got this problem and worked fine.
    thanks
    --Venkat

    Disabling OpenGL entirely is draconian.
    You could try, if it's not already set that way, going into the Advanced settings and switching OpenGL to "Basic" mode, which uses fewer resources.
    -Noel

Maybe you are looking for

  • IPhone video recover?

    Hi, I was recording a 5 minute video and my iPhone 4 ran out of charge. It does not show in the camera roll I once heard there is a way to recover the file. Any help would be appreicated. Regards

  • How to Panic a Windows 2012 Server?

    Hi Folks, I was looking for instructions/steps/procedure to panic my Windows 2012 Server for a test I am currently running. Can someone please assist? Thanks

  • EAP-Fast

    Hi, I have a AP1100 and a repeater AP1100. The AP acts as a Radius server and the clients (all AIR-350) use LEAP, WPA and TKIP. Everything works just fine. Now I want to secure my environment a bid more and make use of EAP-Fast. I can't get it work.

  • How to use the msconfig in FireFox?

    to change the settings for Flash Player crashes

  • Portal Installation Error in NW2004S

    Input Error: The Solution manager key is not valid.Enter the correct key for host 'otisap11', the system ID 'O11' and the central instance number '12'.