Lots of code, Little problem....

Does anyone have how to get this program to run this line when the close box is pressed:
userClosed("Connection Closing.", isC);
This line sends that message to the other client program connected to it. I can get this line to run when the menu exit selection is called, but when the close box is pushed, nothin?
This was a possible fix and from what I can tell should have worked. I'm trying to add some lines that say:
          Runtime.getRuntime().addShutdownHook(new Thread()
               public void run()
                    userClosed("Connection Closing.", isC);
          });But for Some reason it doesn't seem to be working? I know the above code is valid, it works in other programs.
The other possible fix is:
When the Admin's default constructor is called, it is called from another program that MUST be kept running. When the Admin's client program shuts down I'm using a dispose() to protect the calling program from being shutdown. If someone can tell me how to shutdown this program without killing the calling program, that might work too.
Thanks!
/*  A simple Swing based client that talks to the Switch  */
import javax.swing.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class TrialClient extends JFrame implements GMReceiver    //-------------
     JTextField userText = new JTextField(40);
     JTextArea log = new JTextArea(24,40);
     JPanel outPanel = new JPanel();
     JScrollPane logScroll = new JScrollPane(log);
     JMenuBar menuBar = new JMenuBar();
     JMenuItem startItem = new JMenuItem("Start");
     JMenuItem hostItem = new JMenuItem("Host");
     JMenuItem aboutItem = new JMenuItem("About");
     JMenuItem exitItem = new JMenuItem("Exit");
     JMenu fileMenu = new JMenu("File");
     JMenu helpMenu = new JMenu("Help");
     Container cp;
     RemoteUser remote;
     String address="genesis.zedxinc.com";
     int port1=8000; int port2 = 8001; int port = 0;
     boolean running;
     int isC; Socket contin; int isApp;
     TrialClient()    //Client Default Constructor-------------------------------
          isC = 0;
          port = port1;
          String userName = JOptionPane.showInputDialog
                    (null, "Please Enter Your Name:", "ZedX Web Messenger", JOptionPane.QUESTION_MESSAGE);
          buildMenu();
          cp = getContentPane();
          log.setEditable(false);
          outPanel.add(new JLabel("Send: "));
          outPanel.add(userText);
          userText.addActionListener(new ActionListener()     {public void actionPerformed(ActionEvent evt){userTyped(evt);}});
          cp.setLayout(new BorderLayout());
          cp.add(outPanel,BorderLayout.NORTH);
          cp.add(logScroll,BorderLayout.CENTER);
          userName = "Client: " + userName;
          setTitle(userName);
          addWindowListener(new WindowAdapter()
               {public void windowClosing(WindowEvent evt){mnuExit();}});
          toLog("!! use start menu to start");
          toLog("!! host is "+address+":"+port1);
          pack();
     TrialClient(JApplet a)    //Web Client Default Constructor-------------------------------
          isC = 0;
          isApp = 1;
          port = port1;
          String userName = JOptionPane.showInputDialog
                    (null, "Please Enter Your Name:", "ZedX Web Messenger", JOptionPane.QUESTION_MESSAGE);
          buildMenu();
          cp = getContentPane();
          log.setEditable(false);
          outPanel.add(new JLabel("Send: "));
          outPanel.add(userText);
          userText.addActionListener(new ActionListener()     {public void actionPerformed(ActionEvent evt){userTyped(evt);}});
          cp.setLayout(new BorderLayout());
          cp.add(outPanel,BorderLayout.NORTH);
          cp.add(logScroll,BorderLayout.CENTER);
          userName = "Client: " + userName;
          setTitle(userName);
          addWindowListener(new WindowAdapter()
               {public void windowClosing(WindowEvent evt){mnuExit();}});
          toLog("!! use start menu to start");
          toLog("!! host is "+address+":"+port1);
          pack();
     TrialClient(String s, Socket myServer)    //Admin Default Constructor-------
          isC = 1;
          port = port2;
          String userName = s;
          contin = myServer;
          buildMenu();
          cp = getContentPane();
          log.setEditable(false);
          outPanel.add(new JLabel("Send: "));
          outPanel.add(userText);
          userText.addActionListener(new ActionListener()     {public void actionPerformed(ActionEvent evt){userTyped(evt);}});
          cp.setLayout(new BorderLayout());
          cp.add(outPanel,BorderLayout.NORTH);
          cp.add(logScroll,BorderLayout.CENTER);
          userName = "Admin: " + userName;
          setTitle(userName);
          addWindowListener(new WindowAdapter()
               {public void windowClosing(WindowEvent evt){mnuExit();}});
          toLog("!! use start menu to start");
          toLog("!! host is "+address);
          pack();
          mnuStart();
     void RunShutdown()
          Runtime.getRuntime().addShutdownHook(new Thread()
               public void run()
                    userClosed("Connection Closing.", isC);
     void userTyped(ActionEvent evt)    //----------------------------------------
          String txt = evt.getActionCommand();
          userText.setText("");
          toLog(txt, true);
          System.out.println("From user:"+txt);
          if(running)remote.postMessage(txt);
     void userClosed(String evt, int who)    //----------------------------------------
          String txt = evt;
          boolean istf = true;
          userText.setText("");
          toLog(txt, istf);
          System.out.println("From user:"+txt);
          if(running)remote.postMessage(txt);
     void toLog(String txt){toLog (txt,false);}    //-----------------------------
     void toLog(String txt, boolean user)    //-----------------------------------
          log.append((user?"> ":"< ")+txt+"\n");
          log.setCaretPosition(log.getDocument().getLength() );
     // build the standard menu bar
     void buildMenu()    //-------------------------------------------------------
          JMenuItem item;          // file menu
          startItem.addActionListener(new ActionListener()
               {public void actionPerformed(ActionEvent e){mnuStart();}});
          fileMenu.add(startItem);
          hostItem.addActionListener(new ActionListener()
               {public void actionPerformed(ActionEvent e){mnuHost();}});
          fileMenu.add(hostItem);
          exitItem.addActionListener(new ActionListener()
               {public void actionPerformed(ActionEvent e){mnuExit();}});
          fileMenu.add(exitItem);
          menuBar.add(fileMenu);
          helpMenu.add(aboutItem);
          aboutItem.addActionListener(new ActionListener()
               {public void actionPerformed(ActionEvent e){mnuAbout();}});
          menuBar.add(helpMenu);
          setJMenuBar(menuBar);
     void mnuStart()    //--------------------------------------------------------
          Runtime.getRuntime().addShutdownHook(new Thread()
               public void run()
                    userClosed("Connection Closing.", isC);
          if(!running)
               if (isC == 0)
                    remote = new RemoteUser(this, address, port);
               else
                    remote = new RemoteUser(this, contin, isC);
               if(remote.start())
                    startItem.setText("Stop");
                    running = true;
               else remote = null;
          else
               userClosed("Connection Closing.", isC);
               remote.stop();
               remote = null;
               running = false;
               startItem.setText("Start");
     void mnuHost()    //----------------------------------------------------------
          String txt = JOptionPane.showInputDialog("Enter host address and port");
          if (txt == null)return;
          int n = txt.indexOf(':');
          if(n == 0)
               address = "genesis.zedxinc.com";
               port = toInt(txt.substring(1),8000);
          else if(n < 0)
               address = txt;
               port = 8000;
          else
               address = txt.substring(0,n);
               port = toInt(txt.substring(n+1),8000);
          toLog("!! host set to "+address+":"+port);
     //     setTitle(userName);
     void mnuAbout()    //---------------------------------------------------------
          new AboutDialog(this).show();
          System.out.println("about called");
     void mnuExit()    //----------------------------------------------------------
          userClosed("Connection Closing.", isC);
//          toLog("!! use start menu to start");
          if (isC == 1){
               if(remote != null)remote.close();
               dispose();
//               System.exit(0);
          else if (isApp == 1)
               this.destroy();
               if(remote != null)remote.close();
               System.exit(0);
          else
               if(remote != null)remote.close();
               System.exit(0);
     public void dispose() {     //------------------------------------------------
       switch (this.getDefaultCloseOperation()) {
          case DISPOSE_ON_CLOSE:
            super.dispose();
            break;
     public void fromHost(String txt){postGMessage(new GUIMessage(this,txt));}    //---------
     public void runGMessage(GUIMessage gm){toLog((String)gm.dat);}    //--------------------
     public void postGMessage(GUIMessage gm){SwingUtilities.invokeLater(gm);}    //----------
     public static int toInt(String s, int er)    //----------------------
          int i;
          try{i = new Integer(s).intValue();}
          catch(NumberFormatException exc){i = er;}
          return i;
class AboutDialog extends JDialog    //-----------------------------------
     Container contentPane;
     JTextField text = new JTextField("Simple character client");
     AboutDialog(Frame f)
          super(f,"About TrialClient",true);
          contentPane = getContentPane();
          contentPane.add(text);
          pack();
class RemoteUser    //----------------------------------------------------
     Socket sock;
     BufferedReader in;
     BufferedWriter out;
     TrialClient parent;
     String name ="";
     int state = 0;
     Thread recvThread;
     Thread sendThread;
     LinkedList sendQ = new LinkedList();
     boolean signedOn = false;
     String address;     int port; int isc;
     RemoteUser(TrialClient c, String a, int p)    //----------------------
          parent = c;
          address = a;
          port = p;
     RemoteUser(TrialClient c, Socket s, int isC)    //---------------------
          parent = c;
          sock = s;
          isc = isC;
     boolean start()    //---------------------------------------------------
          try
               state = 1;
               if (isc == 0)
                    sock = new Socket(address,port);
               name = getAddress();
               in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
               out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
               recvThread = new Thread(new Runnable()
                    {public void run(){doRecv();}},"Recv");
               sendThread = new Thread(new Runnable()
                    {public void run(){doSend();}},"Send" );
               sendThread.start();
               recvThread.start();
               parent.fromHost ("!! Connected to = "+name);
               state = 2;
          catch(Exception e)
               parent.fromHost ("!! Connection failed to = "+name);
               e.printStackTrace();
               close();
          return state == 2;
     void stop(){close();}    //-----------------------------------------------
     void doSend()    //-------------------------------------------------------
          String msg;
          try
               while (null != (msg = popMessage()))
                    System.out.println("sending ("+msg+") to user="+name);
                    out.write(msg+"\r\n");
                    out.flush();
          catch(Exception e){e.printStackTrace();}
     synchronized String popMessage()    //---------------------------------------
          String msg = null;
          while (state > 0 && sendQ.size() == 0)
               try{this.wait();}
               catch(InterruptedException e){}
          if(state > 0)msg = (String)sendQ.remove(0);
          return msg;
     synchronized void postMessage(String msg)    //------------------------------
          sendQ.add(msg);
          this.notify();
     void doRecv()    //----------------------------------------------------------
          String inbuf;
          while (0 != state)
               try{inbuf = in.readLine();}
               catch(Exception e){inbuf = null;}
               if(inbuf == null)close();
               else
                    System.out.println("received ("+inbuf+") from user="+name);
                    parent.fromHost(inbuf);
     void close()    //----------------------------------------------------------
          int s = state;
          state = 0;
          if(sock != null)
               if (sendThread != null && sendThread.isAlive())sendThread.interrupt();
               if(s == 0)parent.fromHost("!! closed");
               else{ parent.fromHost("!! closing user "+name); }
               try{sock.close();}
               catch(Exception e){e.printStackTrace();}
     String getAddress(){return ""+sock.getInetAddress()+":"+sock.getPort();     }
interface GMReceiver    //----------------------------------------------------------
     public void runGMessage(GUIMessage gm);
     public void postGMessage(GUIMessage gm);
class GUIMessage implements Runnable    //------------------------------------------
     GMReceiver gui;
     Object dat;
     GUIMessage(GMReceiver gui, Object dat)
          this.dat = dat;
          this.gui = gui;
     public void run()
          gui.runGMessage(this);
}

How about interface java.awt.WindowListener???
Sure can help you out!
"windowOpened
public void windowOpened(WindowEvent e)
Invoked the first time a window is made visible.
windowClosing
public void windowClosing(WindowEvent e)
Invoked when the user attempts to close the window from the window's system menu. If the program does not explicitly hide or dispose the window while processing this event, the window close operation will be cancelled.
windowClosed
public void windowClosed(WindowEvent e)
Invoked when a window has been closed as the result of calling dispose on the window.
windowIconified
public void windowIconified(WindowEvent e)
Invoked when a window is changed from a normal to a minimized state. For many platforms, a minimized window is displayed as the icon specified in the window's iconImage property.
See Also:
Frame.setIconImage(java.awt.Image)
windowDeiconified
public void windowDeiconified(WindowEvent e)
Invoked when a window is changed from a minimized to a normal state.
windowActivated
public void windowActivated(WindowEvent e)
Invoked when the Window is set to be the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
windowDeactivated
public void windowDeactivated(WindowEvent e)
Invoked when a Window is no longer the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.
"

Similar Messages

  • Little problem with Strings.

              I have an little problem with Strings, i make one comparision like this.
              String nombre="Javier";
              if( nombre.equalsIgnoreCase(output.getStringValue("CN_NOMBRESf",null)) )
              Wich output.getStringValue("CN_NOMBRESf",null) is "Javier" too, because I display
              this before and are equals.
              What I do wrong?.
              

    You are actually making your users key in things like
    "\026"? Not very user-friendly, I would say. But
    assuming that is the best way for you to get your
    input, or if it's just you doing the input, the way to
    change that 4-character string into the single
    character that Java represents by '\026', you would
    use a bit of code like this:char encoded =
    (char)Integer.parseInt(substring(inputString, 1),
    16);
    DrClap has the right idea, except '\026' is octal, not hex. So change the radix from 16 to 8. Unicode is usually represented like '\u002A'. So it looks like you want:String s = "\\077";
    System.out.println((char)Integer.parseInt(s.substring(1), 8));Now all you have to do is parse through the String and replace them, which I think shouldn't be too hard for you now :)

  • Nds Insert statement little problem

    DB version XE 10g
    Hello
    I have little problem with my insert statement.
    In my code, are many examples, but plz focus on V2 and V3 part.
    As you can see V2 and V3 are not working
    I get following errors
    V2
    Error report:
    ORA-00984: column not allowed here
    ORA-06512: AT line 28
    00984. 00000 - "column not allowed here"
    V3
    Error report:
    ORA-00917: missing comma
    ORA-06512: AT line 33
    00917. 00000 - "missing comma"
    I really have no idea, why i'm getting these errors...
    DROP TABLE FILMYARNOLD;
    CREATE TABLE FILMYARNOLD
        FIL_ID VARCHAR2 (329),
        FIL_NAME VARCHAR2 (592),
        FIL_YEAR VARCHAR2 (294),
        FIL_ACTOR VARCHAR2 (392),
        FIL_TEXTT VARCHAR2 (2596)
    SET SERVEROUTPUT ON
    DECLARE
      TYPE FIL_TABLE IS TABLE OF VARCHAR2 (256);
      vfilmiczki FIL_TABLE := fil_table();
      statement VARCHAR2 (2048);
    BEGIN
    vfilmiczki.EXTEND;
    vfilmiczki(1) := '77804';
    vfilmiczki.EXTEND;
    vfilmiczki(2) := 'Predator';
    vfilmiczki.EXTEND;
    vfilmiczki(3) := '1984';
    vfilmiczki.EXTEND;
    vfilmiczki(4) := 'Arnold';
    vfilmiczki.EXTEND;
    vfilmiczki(5) := 'get to the choppa';
    /*statement := 'INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME, FIL_YEAR, FIL_ACTOR, FIL_TEXTT) VALUES ( ';
    statement := statement|| '''chlip'',''lol'',''lol'',''chlip''';--
    statement := statement||',''hmm'')';*/
    -------V1------------working-----------------
    --statement := 'INSERT INTO FILMYARNOLD (FIL_ID) VALUES ( ';
    --statement := statement||vfilmiczki(1)||' )';
    --EXECUTE IMMEDIATE statement;
    --------V2-------------------- not working -----------------------------------------
    --statement := 'INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME) VALUES ( ';
    --statement := statement||vfilmiczki(1)||','||vfilmiczki(2)||' )';
    --EXECUTE IMMEDIATE statement;
    ----V3------------ not working ------------
    statement := 'INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME, FIL_YEAR, FIL_ACTOR, FIL_TEXTT) VALUES ( ';
    statement := statement||vfilmiczki(1)||','||vfilmiczki(2)||','||vfilmiczki(3)||','||vfilmiczki(4)||','||vfilmiczki(5)||' )';
    EXECUTE IMMEDIATE statement;
    /* statement := 'INSERT INTO FILMYARNOLD VALUES (:jeden, :dwa, :trzy, :cztery, :piec)';
    EXECUTE IMMEDIATE statement
      USING vfilmiczki(1)
      ,     vfilmiczki(2)
      ,     vfilmiczki(3)
      ,     vfilmiczki(4)
      ,     vfilmiczki(5); */
      statement := 'INSERT INTO FILMYARNOLD VALUES ('; --(:jeden, :dwa, :trzy, :cztery, :piec)';
        FOR i IN 1..vfilmiczki.COUNT
        LOOP
            IF i = vfilmiczki.LAST THEN
                statement := statement||vfilmiczki(i)||' )';
            ELSE
            statement := statement||vfilmiczki(i)||', ';
          END IF;
            --DBMS_OUTPUT.PUT_LINE (vfilmiczki(i));
        END LOOP;
        EXECUTE IMMEDIATE statement;
        --INSERT INTO FILMYARNOLD
        --VALUES (vfilmiczki(vfilmiczki.FIRST),vfilmiczki(2),vfilmiczki(3),
                --vfilmiczki(4), vfilmiczki(5));
        --DBMS_OUTPUT.PUT_LINE ('*****************');
        --DBMS_OUTPUT.PUT_LINE (vfilmiczki((vfilmiczki.LAST)));
    END;
    /Im waiting for your replys
    greetings

    Hi,
    change V2 to:
    STATEMENT := 'INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME) VALUES ( ';
    STATEMENT := STATEMENT||VFILMICZKI(1)||','''||VFILMICZKI(2)||''' )';
    EXECUTE IMMEDIATE statement;and V3 to:
    ----V3------------ not working ------------
    STATEMENT := 'INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME, FIL_YEAR, FIL_ACTOR, FIL_TEXTT) VALUES ( ';
    STATEMENT := STATEMENT||VFILMICZKI(1)||','''||VFILMICZKI(2)||''','||VFILMICZKI(3)
                 ||','''||VFILMICZKI(4)||''','''||VFILMICZKI(5)||''' )';
    EXECUTE IMMEDIATE statement;EXECUTE IMMEDIATE statement;One general remark: INSERT can be used directly in PL/SQL, you don't need to bother with dynamic SQL,
    and the direct SQL will be probably more efficient than dynamic SQL.
    Try this:
    SET SERVEROUTPUT ON
    DECLARE
      TYPE FIL_TABLE IS TABLE OF VARCHAR2 (256);
      vfilmiczki FIL_TABLE := fil_table();
      statement VARCHAR2 (2048);
    BEGIN
    vfilmiczki.EXTEND;
    vfilmiczki(1) := '77804';
    vfilmiczki.EXTEND;
    vfilmiczki(2) := 'Predator';
    vfilmiczki.EXTEND;
    vfilmiczki(3) := '1984';
    vfilmiczki.EXTEND;
    vfilmiczki(4) := 'Arnold';
    vfilmiczki.EXTEND;
    vfilmiczki(5) := 'get to the choppa';
    -------V1------------working-----------------
    INSERT INTO  FILMYARNOLD (FIL_ID) VALUES ( VFILMICZKI(1) );
    --------V2-------------------- not working -----------------------------------------
    INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME) VALUES ( VFILMICZKI(1),VFILMICZKI(2));
    ----V3------------ not working ------------
    INSERT INTO FILMYARNOLD (FIL_ID, FIL_NAME, FIL_YEAR, FIL_ACTOR, FIL_TEXTT)
    VALUES ( VFILMICZKI(1), VFILMICZKI(2), VFILMICZKI(3), VFILMICZKI(4), VFILMICZKI(5));
    END;
    /

  • MOVED: [Athlon64] Annoying little problem! PLease help

    This topic has been moved to Operating Systems.
    [Athlon64] Annoying little problem! PLease help

    Hi Ben.
    Thank you very much vor your replay
    but I still can get it
    Here the code
    on testAlphaChannels sourceImage, cNewWidth, cNewHeight,
    pRects
    cSourceAlphaImage=sourceImage.extractAlpha()
    newImage = image(cNewWidth, cNewHeight, 32)
    newImage.useAlpha = FALSE
    newAlphaImage = image(cNewWidth, cNewHeight, 8)
    repeat with i=1 to pRects.count
    destRect=......
    newImage.copyPixels(sourceImage, destRect, pRects
    newAlphaImage.copyPixels(cSourceAlphaImage, destRect,
    pRects,
    [#ink:#darkest])
    end repeat
    newImage.useAlpha = TRUE
    newImage.setAlpha(newAlphaImage)
    textMember = new(#bitmap)
    textMember.image=newImage
    end
    But the result is not correct. O my example
    http://www.lvivmedia.com/fontPr/Fontproblems3.jpg
    image to the left is
    created on background image, and image to the right - with
    code above
    What is wrong in the code, I quoted above?
    Any help will be appreciated
    Jorg
    "duckets" <[email protected]> wrote in
    message
    news:ekhekq$c6g$[email protected]..
    > I think this is what you'll have to do:
    >
    >
    >
    > Do the copypixels command as per your 2nd result example
    (where "no
    background
    > image is used") using destImage.useAlpha = false.
    >
    > Create a new image as a blank alpha channel image (8
    bit, #greyscale)
    >
    > Repeat the same copypixels commands for each number, but
    this time the
    source
    > image is 'sourceAlphaImage', and the dest Image is this
    new alpha image.
    And
    > the crucial part, use: [#ink:#darkest] for these
    operations. This is
    because
    > you are merging greyscale images which represent the
    alpha channels of
    each
    > letter. The darker parts are more opaque, and the
    lighter parts are more
    > transparent, so you always want to keep the darkest
    pixels with each
    copypixels
    > command.
    >
    > hope this helps!
    >
    > - Ben
    >
    >
    >
    >

  • Little problems at start

    I own a zen micro 5gB 3 months, and was satisfied of it, but now it begins to...disapoint me a little...Sometimes it just froze on startup screen, or when the "zen micro" logo was displayed, so the only thing to do was to remove the battery then reboot...Until one day, when this funny message appeared : "Hardware problem" ..... I sent the player back to support, and got another one, 2 weeks ago... But it still freeze sometimes! Not EVERYtimes, but VERY often...When i try a remove battery/reboot, it displays "rebuilding library" and sometimes freeze after completing, and again and again even after removing the battery... It did it several times since i've acquired the player... The only thing to do then is a clean up through recovery mode... Despite that, when it's on, i don't have any problems playing music...
    -Is it due to the few left disk space? I splitted the disk: 3GB for the library, 2 for datas, and filled up the library (only mB left)
    -The version of the firmware is ..0, i think it's the last one?
    I think that's all, please tell me if you need additional informations...
    Thanks a lot
    PS: Yes admins, i've searched the faqs and other helps, but they always say the same thing: Remove the battery then reboot...Message Edited by AmShagar on 2-02-2005 02:29 AM

    I had this problem for weeks despite reloading firmware, formatting player etc the answer to your little problem is to hit pause before turning the player off. If the cd/tracks you were listening to have finished you can just turn your player off.
    I had problems of zen logo splitting in half, re-building library problems, fuzz, buzz and squeal noise etc. I have not had these problems since pausing the track before turning the player off.
    Cheers
    PS. SSR - None of my files are from P2P sites.
    Message Edited by fizz on 2-03-2005 :4 PM

  • 3D product rotation images sequence little problem

    Hi!
    I made a sequence of images and make the code the rotate around it but I have a little problem with the loop ( from frame 100 to 1 || 1 to 100 ).
    You can take a look to the link here : http://sebastienouellette.com/productview/test.html
    How can I avoid the little stick problem. I know what's the problem but I dont know how to solve it. It's with the frame tweening. Anyway, here's the code :
    import flash.events.Event;
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.events.MouseEvent;
    var direct:String = "forward";
    var objTotFrames:int = 490;
    var ease:int = 5;
    var targX:int = mouseX;
    var drag:Boolean = false;
    var ptX:int = 1;
    var frame:int = 1;
    var mousePos:int;
    stage.addEventListener(Event.ENTER_FRAME, dragHandler, false, 0, true);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, downHandler, false, 0, true)
    stage.addEventListener(MouseEvent.MOUSE_UP, upHandler, false, 0, true)
    function dragHandler(e:Event):void
    mousePos = -mouseX * 100 / objTotFrames;
    if ( frame < 1 ) {
    loopForward();
    }else
    if ( frame > 101 ) {
    loopBackward();
    }else
      if (drag)
            initAnim();
    function initAnim():void {
    targX = mousePos+ptX;
    frame += (targX-frame);
    TweenMax.to(mc, .3, {frame:frame});
    //mc.gotoAndStop(frame);
    function loopForward():void {
    //TweenMax.killTweensOf(mc);
    frame = 101;
    ptX = frame - mousePos;
    mc.gotoAndStop(101);
    trace("off 1");
    function loopBackward():void {
    //TweenMax.killTweensOf(mc);
    frame = 1;
    ptX = frame - mousePos;
    mc.gotoAndStop(1);
    trace("over 1");
    trace(frame);
    function upHandler(event:MouseEvent):void
        drag = false;
    function downHandler(e:MouseEvent):void
          ptX = frame - mousePos;
          drag = true;
    Thanks for your help!

    It doesnt work but I think think this is the problem because if you take a look to this example :
    http://sebastienouellette.com/productview/test2.html
    It works pretty well without the "easing" effect and the only think I change in the code is that I removed the line : TweenMax.to(mc, .3, {frame:frame}); and change it to a basic mc.gotoAndStop(frame);

  • A stupid little problem with FORTE

    Hi to everyone,
    I'm using FORTE on windows 2000 but I've a little problem: I can't put the characters {} in the source editor.
    I've tried with the ASCII code (ALT + 123) and with ALTGR+7 but they don't work. How ca I do?
    Thanks

    You can copy the them from where you are able to type them, and then paste them in the editor with ctrl+v. To copy, you can use ctrl+c.

  • Hot Code Replace Problem...

    Hi Everyone,
    I am using WebLogic 10 with Eclipse. Whenever i start the server in debug mode and make two three changes in the code... WHAM.... I get the Hot Code Replace error. Is there any way so that the server can keep up with the code changes. Publishing the app again takes approx 40 mins!

    Almost always this is a limitation of the JRE/JDK you are using and really
    nothing to do with Eclipse.
    Try a different VM and see if you have better luck
    HTH
    Darins
    "bobz" <[email protected]> wrote in message
    news:75257188f239cb376da31e19b214d2d9$[email protected]..
    > hi buddies,
    >
    > i am getting "hot code replace" problem whenever i change my
    > java code and build the project and access the website without re-starting
    > the server. so, finally i endup with re-starting the server whenever i
    > change the code. this consumes a lot of time. is there any possibility to
    > work without re-starting the server even after the code change.
    >
    > regards,
    > satish.

  • Little problem in Logic Express 9

    Hello all,
    I'm having a little problem there..
    I bought recently an akai LPD8 controller, i set it up in controller assignment and it works fine.
    Now, if i quit Logic, and re-open it, the controller assignment still there. great.
    If logic crash or quit for some reason, the assignment are deleted, and this is normal.
    The problem starts here, i read that the preferneces file of logic : com.apple.logic.cs and .plist should be present in :  myHD/library/prefernces/
    There i find all my .cs and .plist file, but not the logic one!
    The strange fact is that logic actually save my prefernces, like controller assignment, or arrange window color and go on..
    I need to know were to find the controller assigments save file for keep a copy in my mac, for when logic crash, and not reassign everything to the controller.
    Thanks a lot,
    Ales

    Hi
    ALES.ambient wrote:
    Hello all,
    The problem starts here, i read that the preferneces file of logic : com.apple.logic.cs and .plist should be present in :  myHD/library/prefernces/
    There i find all my .cs and .plist file, but not the logic one!
    You are looking in the wrong "Library".
    Logic preferences are saved in the <User> Library:
    My HD:Users:YOU:Library:Preferences
    Note that the User Library is hidden by default in Lion and M Lion. One easy way to get there is to use the Finder:Go menu whilst holding down Option (the User Library will appear in the menu).
    CCT

  • Code inspector problem

    Hi all,
    I'm checking the syntax before to release my order requests and I have several errors in code inspector.
    Ok, I've fixed these errors. The problem is if I execute the code inspector again the errors are displayed again... but the code is ok, there are no errors.
    It happened to me a lot of times, with several object types, may be the next day if I pass the code inspector the errors dissapears or may be not.
    It's very strange. I've tried with other users, doing log off and login again... but nothing...
    Do you know if exits some transaction code for "refresh" the code inspector? the buffer or something?
    Thanks in advance.

    Hi,
    I've worked with code inspector quite a lot and I've never spoted this kind of problem. I would suspect that this is not code inspector problem but rather something is wrong with your repository objects.
    If I were you I would try to debug code inspector. There is somewhere inside SCAN ABAP-SOURCE command used. Check what input is being used.
    BR
    Marcin Cholewczuk

  • Seeing all these little problems, I think I might just return my new MacBook...

    I'm a heavy PC user switching over to Mac because of all the hype and positive comments I've heard from others, but seeing all these little problems everyone is having doesn't motivate me to continue.
    Few days after I got my MacBook (somewhere else) I took it with me to a Mac Store in the mall. I was excited until I was basically told I wasn't worthy because I got it somewhere else. That made me feel really good. I think I'd rather my PC; I'm just not seeing the real benefits to sinking two grand down on something I could easily get for a fifth of that.
    Anyone want to help with my baptism into the world of Mac?

    I am being careful not to stub my toes since this is only my sixth day with my newly-entered Mac experience. I like the MacBook so far. I suppose most of my issues are geared towards being a new Mac user, but I am sure functional issues are yet to arise and surprise. I haven't seen many, if any, functional problems yet, probably because I don't know what to look for and Mac is new to me.
    I have everything up and running, i.e. emails, internet, etc. I upgraded to Lion (was told I wouldn't have to pay for the upgrade, but I did because I couldn't find the way around the payment button).
    I have been through many a PC over the past 15 years and know what I know in terms of programs and their tools, at least the ones I use. Familiar story, perhaps? With Mac it seems I have to relearn everything, as I will explain a little more below. I like having a number pad and both delete and backspace keys. Many of the programs, applications, downloads and software I run on my PC are either not compatible with Mac (and a wheel-less mouse) or they are just not the same in terms of set up and use. For instance, in PC, Firefox allows me to close the program and reopen all my tabs when I come back. Not so in Firefox with Mac, or at least I didn't find that option.
    The most improtant factors for my dicision to Mac-Up were primarily
    1. The security
    2. The speed
    3. Creative aid programs
    Example- With the PC programs I have used, I was able to simply play and learn. Not so thus far with some of the I-stuff. The tools I know and use everyday with PC programs are there, I just don't know where to look to find them or what they are called.
    Example- How do I shutdown a program that doesn't want to shutdown? Searching help to "force shutdown" doesn't produce any solid results.  
    I went to the store where I purchased my MacBook. While there, another customer was asking about features. I rested my attention over the Mac instructor's shoulder to listen and learn (and a lot I did learn), but I realized that of all the things I was doing with my PC programs, despite having the ability to do the same with Mac programs, they were all called something different and/or used a little bit differently. For example, in MS Pub, its a Transparency tool; in Pages its an alpha tool. Stuff like that. For me, little stuff like that can really eat up a lot of time. It would be different if I was just starting my computer journey, but such is not the case.

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    How much space is used by your Other? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
     Cheers, Tom

  • Hii i m frm BGD. I m using iphone 5. My carrier BGD ROBI AXIATA. When it was ios 6 it works better . But i recently upgrade to ios 7 and i facing the little problem. One of the ussd call. Plz help or suggest ir doing better about itz as soon as possible.

    Hii i m frm BGD. I m using iphone 5. My carrier BGD ROBI AXIATA. When it was ios 6 it works better . But i recently upgrade to ios 7 and i facing the little problem. One of the ussd call. Plz help or suggest ir doing better about itz as soon as possible.

    I'm not trying to minimize your issues, but I have an iPhone 5S and find that I have not had these types of problems on AT&T. I'm wonding if something has gotten stuck in a loop that is continually trying to use data. If you make a good backup of your phone, try restoring it as new, and do not add anything to the phone right away. Let the device run like this for a little while and see what kind of usage you have. You report you phone is showing usage of 21GB. Did you rese this setting on the phone to begin at your billing period? The reason I ask this is some people believe this setting resets on its own with your billing period, it does not. This has to be manually reset by the user, so it might not be that accurate depending on the last time that you reset it.
    If the phone seems to not use so much extra data during the period the device does not have extra apps on it, then try restoring from your backup and see what happens. If this increases your data usage quite fast again, then there is probably something corrupt in the backup that is causing this issue.

  • Little problem with Photoshop ....

    Hi. I have a little problem with photoshop CS 4. I use a color replacement tool to change a color in some details... but when i set new color, on pictures entries only or grey or black colors and nothing other... i dont known why.... please help . Thanks. Sorry for bad english

    Usually the Color mode is the one you want for the color replacement tool, you
    might have it set to luminosity or your trying replace black or white colors.
    MTSTUNER

Maybe you are looking for

  • Generate Report From Template (Excel).vi & don't understand to fill the cells

    I am trying to use the Generate Report From Template (Excel).vi to build my own template, and then fill it with some of my datas. I am trying to replace the "temperature" or "pressure" labels by others, and then fill them with my vi. I don't understa

  • Artwork will not display in iTunes 5 ?

    compared to many this is a minor complaint, but is there anyway to get iTunes 5 to recognize or display album artwork? I had 4.9 on two different ibooks and the artwork displayed as expected. On both notebooks immediately after the update to iTunes 5

  • Mobility groups and MAC filtering

    We have a 4402 controller and we are doing MAC filtering. We have reached the default number of MAC addresses, 512. It has been recommended that we add an additional controller instead of increasing this past the default. Three questions: 1. Is there

  • Test Database creation error oracle not available

    I have installed Oracle 9i on AIX 5.2, after running the instance_test.sql file for the test databse i get the error ora-01034: oracle not available.

  • Form executable hot deployment

    Hi, When user had an open instance of the form, and the executable is re-deployed, then user is getting FRM-92101 while attempting any action on the form (including exit_form(no_validate). In the past we tried this kind of hot deployment several time