Code only working second time round

Hi all,
got a weird one here and hoping someone can help me.
Scenario is this...got some dynamically created textareas on
the screen and details of each are stored in a datagrid. The user
can select one from the datagrid (dg_elements) and then change
certain params for it, namely xy coords, height, width, alpha
background colour, border colour and border style. Each param is
taken from various components on the stage, textinput,
colorpickers, comboboxes etc
I've a button called but_apply which has this listener...
but_apply_lnr=new Object()
but_apply_lnr.click=function()
// the instance name of the textarea is stored in
dg_elements.selectedItem.element_name
inst = eval(dg_elements.selectedItem.element_name)
inst._x = Number(elex.text)+40
inst._y = Number(eley.text)+90
inst.setSize(Number(elew.text),Number(eleh.text))
inst.depthChild0._alpha=alpharange.value
inst.backgroundColor=backcol.selectedItem
inst.borderColor=bordercol.selectedItem
inst.borderStyle=borderstyle.selectedItem.label
but_apply.addEventListener("click",but_apply_lnr)
So, if I amend the x,y, height width or alpha and click
but_apply then the textarea updates accordingly...however, if I
change the borderstyle, bordercolour or background colour then
these don't change...UNTIL I click it a second time when everything
works!?
So for example I could change the alpha and the width and the
backgroundcolor and first time round the alpha and width will
change, then second time around the bgcolour will update ?!
Why!???? I thought an updateAfterEvent() may help, but it
made no difference.
Can anyone help please!
Thanks
Phil

The UIObject Class is the base class for all V2 Components.
It adds functionality but also hides the MovieClip Class by
defining an API that is not tied to the timeline. As a result there
are often two properties or methods - one from the MovieClip class
and one from the UIObject Class that can be used.
With the second click there apparantly is a reference to the
normal text field (Text Area Component is a wrapper for the normal
text field).

Similar Messages

  • UploadedFile & https Only work first time upload ????

    I am using 10.1.3.4 Jdev. I use UploadedFile interface to upload files from local PC and ftp files to unix server. My "upload" web page works between my local PC and Unix server, but it only works first time upload file and ftp between
    https server (application server--weblogic 10.0) and Unix server. If I just use http without SSL and my codes work fine you can upload file as many times you want and ftp them to Unix server. I used FTP not sftp to transfer files from application server to unix server. Can anyone shed some lights on my head ???? Thx.

    Yes. I changed my code to SFT from ftp. it works. Thx. This URL for sftp: http://www.jcraft.com/jsch/ and is very good .
    Edited by: albertpi on Feb 11, 2010 8:05 AM
    Edited by: albertpi on Feb 11, 2010 8:05 AM

  • My new macbook pro is giving me hardtime. even apple team is not being to solve it. they replace the motherboard first it didn't work. second time they formatted the computer and that also didn't work. every time my mac showing different problems.

    my new macbook pro is giving me hardtime. even apple team is not being to solve it. they replace the motherboard first it didn't work. second time they formatted the computer and that also didn't work. every time my mac showing different problems.
    At first my computer had issues. Once it go to sleep it will not back again. I dropped my laptop at apple store to fix it. After 10  days they returned my laptop saying they were no able to fix the problem so they replaced motherboard aiming if that might help. Acttually that didn't help.I had same issue again. I visited apple store again. This time they said they could fix, if I will allow them to format the harddrive. I said ok. They formatted it. It was working fine for few daysAfter few days compter is taking.even more than 15 min to shutdown. Now computer has another problem. It is being hang frequently like every 20'to.30 min.
    I don't know what to do? I still have one month left on first year warranty. I have requested couple times to apple associates either to fix or replace or refund. They are showing me rude behavior. They are not understanding my situation. I am a student. I need to do lot of home work. Since last three month my mac book and apple associates giving me hard time. Any suggestions are welcome.

    Contact Apple Customer Care - not Apple Care - Customer Support. Have your receipts handy and/or case numbers. Be patient, be calm, and tell your story just as you have here. I get the sense you are not in the US and don't have access to an Apple Store but are going to an independent shop. This makes using Customer Support all the more important. If phoning isn't viable, use registered mail.
    Since time is running short, be prepared to purchase AppleCare to exennd your warranty 2 more years. Yes, you shouldn't have to do this, but it gives you added protection and more opportunities over the next 2 years to claim a replacement computer if you don't get one immediately. After dealing with a similar unhappy situation with a Mac in the late 1990s I finally got a replacement computer and reimbursed for the AppleCare policy.

  • FPGA code only works on alternate executions

    Hi,
    I have some code I wrote for FPGA which, by itself, works fine. I tried to use "Open FPGA VI Reference" as part of a previous (non-FPGA based) VI. However, I find that the full code only works on alternate executions. I thought this may be because the FPGA VI is not being reset properly. However, I have used "Close FPGA VI Reference" and chose "Close and Reset" and the problem remains.
    Any help is appreciated,
    Thanks.

    Hi Gary,
    I hope you are doing well today! What version of LabVIEW FPGA are you using? When you say you are doing 'alternate executions', what exactly do you mean? Do you run your host VI, stop it and then run it again? Have you tried just using Close instead of resetting the FPGA VI? Also, what are you using the reference for? What are you invoking? It would, also, be better if you post a screenshot of your VI.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • GoToAndPlay doesn't work second time

    I have made a simple animation using only the timeline. The animation is covered by a button "Knapp"  (alpha 0) wich activates the actions. The whole thing works fine the first time. The last action says go to and play frame 2, wich has two actions: stop + go to and play frame 4. But this action does not work the second time. I tried to set the action to frame 3 instead of 2 and the same problem occured on another action on the timeline as well.
    Here is the last action on my timeline:
    Knapp.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_11);
    function fl_ClickToGoToAndPlayFromFrame_11(event:MouseEvent):void
        gotoAndPlay(2);
    This is the action on frame 2 (I have removed the instructions):
    stop();
    Knapp.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
    function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
        gotoAndPlay(4);

    Thanks. When I read your answer I discovered "Knapp" was divided in two keyframes. But after i fixed it, it still doesn't work. I have got the animation to end at frame 1 now, after removing the "goto"-action in the last frame, hoping the animation would loop. But it still doesn't continue to frame 2 and follow the same actions as before. It stops at frame 1. I have tryed to use another action in frame 1 to make it play frame 2, but without success. Irritating. Other suggestions?

  • Suspends only every second time when lid closed

    Hello everybody, my problem is as the  subject: to suspend I have to close usually the laptop lid twice.
    I'm using kde, but I have also used years ago fluxbox, tweaking scripts and using laptop-mode (which is not running now). Thanks in advance for every idea where to look.
    /etc/acpi$ cat handler.sh
    #!/bin/sh
    # Default acpi script that takes an entry for all actions
    minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
    maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
    setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
    set $*
    case "$1" in
    button/power)
    case "$2" in
    PBTN|PWRF)
    logger "PowerButton pressed: $2"
    poweroff
    logger "ACPI action undefined: $2"
    esac
    button/sleep)
    case "$2" in
    SLPB|SBTN)
    echo -n mem >/sys/power/state
    logger "ACPI action undefined: $2"
    esac
    ac_adapter)
    case "$2" in
    AC|ACAD|ADP0)
    case "$4" in
    00000000)
    echo -n $minspeed >$setspeed
    #/etc/laptop-mode/laptop-mode start
    00000001)
    echo -n $maxspeed >$setspeed
    #/etc/laptop-mode/laptop-mode stop
    esac
    logger "ACPI action undefined: $2"
    esac
    battery)
    case "$2" in
    BAT0)
    case "$4" in
    00000000)
    logger 'Battery online'
    00000001)
    logger 'Battery offline'
    esac
    CPU0)
    *) logger "ACPI action undefined: $2" ;;
    esac
    button/lid)
    case "$3" in
    close)
    logger 'LID closed'
    open)
    logger 'LID opened'
    logger "ACPI action undefined: $3"
    esac
    logger "ACPI group/action undefined: $1 / $2"
    esac
    # vim:set ts=4 sw=4 ft=sh et:

    I actually do not understand who comands at the end - this handler.sh or the settings in Kde-powermanaging, I guess it's the second, I did remove the actions for suspend on lid close time ago. I made a test now, when I change handler.sh and check "do nothing when lid close" in kde powersettings happens exact the same: performs suspend every second time only.
    button/lid)
    case "$3" in
    close)
    logger 'LID closed'
    /usr/sbin/pm-suspend
    open)
    logger 'LID opened'
    logger "ACPI action undefined: $3"
    esac
    Last edited by steff (2012-07-21 17:08:46)

  • HT1661 Imac 2009 imac 2013 target mode did only work one time

    My 2009 imac has a broken graphics card. The imac stats up as usual and is ok. To copy some files to my hew 2013 imac id use an thunderbolt to firewire adaptor.
    At the first attemp to start up in target mode, is did work very well. The target disk showed up at the new mac and all files were available.
    After this succesfull target mode connection, I have problems to get it n a target mode again. After the first time, I cant manage to get it in target mode for the second time. Or I can start up in target mode (without display hard to check) but it don't show up on the new imac.
    What am I doing wrong?
    Leon

    If by DU you mean the Apple Disk Utility program, it is located in Applications/Utilities.
    Are you saying you can't run that version?
    As far as restarting in Target Disk mode, have you tried to change your Startup Disk in the control panel?
    It sounds like your iBook is having problems reading the DVD. An external firewire DVD drive can be attached to either machine. External Firewire/USB cases can be gotten for under $30 and new Sony DL DVD burners can be gotten for under $30.
    I built my own external drive that works on all of my Mac's and PC's.

  • Button set to infinite attempts only works one time

    I have a project that includes branching into five topic areas. There is a "menu" type page with five buttons on it. Each button is set to allow infinite attempts. Each button is set to "jump to" different slides within the project. When the user finishes reviewing that branch, they return to this menu page and can either select another button to jump to another slide, or they should be able to go back in and review the same area again. However, the button they just clicked will no longer work.
    In my troubleshooting, I have tried using Click Box and Transparent button types. I have tried both with and without the "Include in quiz" setting. I have tried changing "infinite" attempts to "100" attempts. Nothing seems to allow the user to execute the action on that button a second time. Any ideas?

    Hi,
    I tried to simulate this with a small project which seems to be working fine for me.I am attaching the project using acrobat.com.
    https://acrobat.com/#d=i1LzcvsM6gSszRWRCv5XDg
    Let me know if this is what you are trying to do.
    Sikandar

  • Code only works in first frame

    Hello,
    I have several buttons, and when each one is mouse clicked by
    the user, text appears in a dynamic text box. I want to have the
    text appear in a different color for each of the buttons. However,
    it is only working in the first frame, and not in subsequent
    frames. All of the buttons have instance names in every frame (in
    fact, they are named the same in frame 1, frame 2, etc. . .--but
    that doesn't seem to be the problem??) Below is my code. Any
    suggestions? Thanks!

    Found the answer. The code defining the variable:
    var my_color:Color = new Color(textBox);
    must only be on the first frame. The rest of the code must be
    on all the frames.

  • (ObjectInputStream) first time it works, second time I get an error!

    hi,
    Using the following code I am sending a query to a server socket using a PrintWriter.println function and retrieve a vector object (results).
    Client Code
         public Vector getDBResultSet(String query) throws ClientException, IOException{
              Object obj = new Object();
              if (socket != null)
                   try{                    
                        System.out.println("Sending "+query+" to Server");
                        writer.println(query);
                        try{
                             ois = new ObjectInputStream(input);
                             while ((obj = ois.readObject()) != null)
                                  obj = ois.readObject();
                        }catch (EOFException eofx){
                             System.out.println("EOF @ object input stream!");
                        finally{
                             ois.close();
                        return (Vector)obj;
                   }catch(Exception e){
                        e.printStackTrace();
                        throw new ClientException("<html>Error: <br>"+e.toString()+"#"+e.getMessage()+"</html>");
                   }finally{
                        //writer.close();
              }else throw new ClientException("no connection!");
         }Server side code
         public void communicate()
              try{          
                   while (true){
                        String q = reader.readLine();
                        Vector vec = db.getResults(q);
                        oos = new ObjectOutputStream(output);
                        oos.writeObject(vec);
                        oos.flush();
                        oos.close();
              }catch(Exception e){
                   e.printStackTrace();
         }First time everything goes OK.
    Second time on the Client-Side I get strange errors like "ClassCastException Java.lang.Object" and if I comment out the "while" line I get a "socket closed" error...
    any ideas what is wrong with it?

    Thank you. input and output variables are Inputstream and outputStream objects.
    However if you notice, I open the ObjectInputStream inside getDBResultSet() method. So whenever this method is called a new ObjectIputStream shall be initialized. That is why I close the ObjectInput/outputStreams right after the try/catch portion.
    I tried starting the ObjectInputStream inside the connect method (which initialized the connection with the ServerSocket object) but wheneven connect() was called the GUI hanged!
    I don't know what am I doing wrong...
         public void connect() throws Exception
              if (socket == null){
                   try{
                        System.out.println("opening connection...to "+host+" at port "+port);
                        socket = new Socket(host, port);
                        input = socket.getInputStream();
                        output = socket.getOutputStream();
                        in = new DataInputStream(input);
                        out = new DataOutputStream(output);
                        reader = new BufferedReader(new InputStreamReader(in));
                        writer = new PrintWriter(out, true);          
                        //ois = new ObjectInputStream(input);
                        System.out.println("Connection established!");
                   }catch(IOException e){
                        try{
                             if (socket != null)
                                  socket.close();
                             System.out.println("ERROR WHILE CONNECTING... SOCKET IS NOW CLOSED!");
                        }catch(IOException x){
                             x.printStackTrace();
              else
                   throw new ClientException("connection active!");
         }

  • Adobe will only work 1 time and it will not open anything after that. I have to unstall it and

    I can only get Adobe to work one time and after that I need to unstall it and reinstall it to use it agin.I have Windows 8 aopp.

    Hi starjeep1,
    Please let me know what version of Reader are you using?
    Try repairing Reader by navigating to the 'Help' menu and see if it works for you.

  • My delphi code only works in DAQ driver 6.6 but not in upper version. Why?

    Hi,
    I'm using delphi 6 to program my application. My code was working fine if I'm using DAQ driver 6.6. Now I want to update my driver, but my code doesn't work. It doesn't work for another version of driver, except 6.6. My program will crash if not using 6.6. I'm not using ActiveX controls to communicate with the card. I'm using dll instead. I wonder is it some functions in 6.6 no longer exist in upper version. My code is in the attachment. Thank you
    Attachments:
    DAQInterface.pas ‏39 KB

    Hello;
    That is probably the case there. One thing you can do to double check if that is actually the problem is to probe each NI-DAQ function and see which one is giving you the error.
    Then, you can open the NI-DAQ on line help and search for the function you used on your code. If you can't find it, that means the new version of the driver doesn't support that function anymore.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • USB 4G LTE modem won't work second time trying it during the day :(

    I have a VERIZON USB551L 4GLTE modem. In the morning the laptop fires up and modem fine. Then trying to disconnect it takes forever, or it will sit there and say initializing. VZAM version 7.6.3.1. HELP

    Anonymousy, I can understand why it would be frustrating having a device startup normal one time, but then have issues with subsequent attempts. Do you receive an error message when trying to connect the second time? Try evdotech's suggestion of removing the SIM card and rebooting the computer. Also, I checked and the newest software version of VZAccess Manager for this device is 7.7.1, so you may also want to update the software.
    Please try these steps and let us know of your results.
      MarquiaF_VZW
    Follow us on Twitter @VZWSupport

  • Code only works if I add Extra character

    Hi, so there's a bit of code I use to keep a running list of pages I need to print (puts it in a textbox), solely depending on if certain boxes are checked... Say I have 3 checkboxs, and each represents a certain page or pages to be printed...  If select each of those checkboxes, pagesToPrint (a textbox) will be populated with 9-11, 15-40, 43 of the PDF (I made up the page numbers).  If I unselect one of those checkboxes, I need the value to be removed from pagesToPrint.  So pagesToPrint should read something like 9-11, 15-40.
    The code I'm posting below WORKS, except that I have an issue having the text to remove itself from pagesToPrint when the input is just a single number AND when it's the first item in the box... Example: "43" won't remove from pagesToPrint when I unselect the textbox txt1; but if I changed it to "43 " (added space at the end), "43-44" or "43a" all would work.  So if the box read 43, 9-11, 15-40 (the integer only being first) then the 43 wouldn't remove if the corresponding checkbox were unselected.... If it were populated with 9-11, 15-40, 43 (the range being first) then the 43 would remove if the corresponding checkbox were unselected
    Why is that??
    // script start - Trying to debug a removal issue on txt1 when integer lacks a space, symbol, or letter
    //get the button
    var btn = this.getField("txt1");
    //app.alert("value = "+btn.value);
    // this variable would change for each check box to the pages you want printed.
    var pagesToPrint = "43";
    //check value of checkbox
    if(btn.value=="Yes") {
      var action = "add";
    else
      var action = "";
    updatepagesToPrint(pagesToPrint, action);
    function updatepagesToPrint(pagesToPrint, action) {
      //app.alert(pagesToPrint + " :: " + action);
      // get the text field
      var printField = this.getField("pagesToPrint");
      if(action=="add")
      // check if the field is empty
      if ( printField.value == "" || printField.value == " ")
          printField.value = pagesToPrint;
      else
          // as printField has a value, add the new pages to the end of the value
          printField.value = printField.value + ", " + pagesToPrint;
      else
      printField.value = printField.value.replace(pagesToPrint+", ", "");
      printField.value = printField.value.replace(pagesToPrint, "");
      printField.value = printField.value.replace(/^,|^, |, $|,$/, "");
    // script end

    http://s000.tinyupload.com/?file_id=07374325820103346475
    Try to check and uncheck DI change request FIRST.... It stays, when it should delete... Any other order it works.  It must be "89a" or "89-110" or "89 " to work.
    If you check the boxes in any other order, it works perfectly.

  • Simulating animation by iterating - JLabel icon. ONLY  Working first time!

    I am "simualting" animation by changing the icon attribute of a JLabel. If I call the method from main, this works. It also seems to work (ie. the JLabel image changes on the screen as the icon attribute is changed in the program.) if I call it first from another or its own class one time, but not after that. What happens on subsequent calls is: The thread.sleep() is working (time passes), and the icon attribute of the JLabel is chaging (lblCaveActive.getIcon() for the JLabel returns the correct changed *.gif, but the images do not show up on the screen, until the last image, whatever I set it to be. I am pulling my air out over this little problem, which is the last lingering problem I am having with this project....I was wondering if you have seen this or have any ideas? I have tried lots of different things, including repainting and such. If you have a clue concerning this, please please please advise, o wise one.
    * simulates animation: ex. Wumpus approaching to eat the
    * player, bat appraoching to transport player
    * @param: int numPics - number of pictures to loop through
    * @param: String picNamePreface - filenames must be "*0.gif" through
    * picNamePreface + numPics + ".gif".
    * Send the "*" portion into this arg
    * @param: int milliSecSleep - seconds for the thread to sleep between
    * pictures
    private void animateMeetHazard(int numPics, String picNamePreface,
    int milliSecSleep)
    try
    for (int i = 0; i <= numPics; i++)
    caveCurrentIcon = new ImageIcon(picNamePreface + i + ".gif");
    lblCaveActive.setIcon(caveCurrentIcon);
    Thread.sleep(milliSecSleep);
    catch (InterruptedException e){}
    --A very tired girl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Something like
    private void animateMeetHazard(int numPics, String picNamePreface,
    int milliSecSleep)
    try
    SwingWorker workHard = new SwingWorker()
    public Object construct()
    for (int i = 0; i <= numPics; i++)
    caveCurrentIcon = new ImageIcon(picNamePreface + i + ".gif");
    lblCaveActive.setIcon(caveCurrentIcon);
    Thread.sleep(milliSecSleep);
    return null;
    public void finished()
    workHard.start();
    catch (InterruptedException e){}
    Not really sure if the Thread.sleep() will throw you out and give you the same problems .. but it mightn't ;)

Maybe you are looking for