Moving to top of a scrolling TextArea

After updating a textarea where I'm displaying some information I call revalidate() on its scrollPane to check again if it needs to add scrollbars. Problem is it does this fine but it then scrolls to the end of the textArea. How can I move it back to the top of the textArea? I've searched all over the class libraries (to my best ability) and the Java tutorial also to no avail. Anybody got any suggestions?

This might help..
When you create your textArea add the scrollpane to it, but use AS_NEEDED, so they only appear when needed. But still as lots of text gets added it will scroll to the bottom. But now you dont need to call revalidate()
  JScrollPane scroll = new JScrollPane(text_area);
                    scroll.setVerticalScrollBarPolicy(
               JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED );I would be interested to find out how to set the viewpoint to the beginning too.

Similar Messages

  • How can I have a browser image that scrolls with images on top of it scrolling in tandem -

    How can I have a browser image that scrolls with images on top of it scrolling in tandem - so the background is a hexagon pattern with small images inside some hexagons and I want them all to be scrollable as a user uses the browser scroll bars. At the moment the background image jumps when I preview so the small hexagons all become out of alignment. Any tips appreciated. I have browser image set to tile - pinned at the middle and set to scrolling - the small images are not pinned -

    Thanks for your answer - The images on the top layer are also links and change to show they're links on rollover - so I wanted to keep them as separate graphics - and it works to a point but when I preview the page in a browser the tiled browser image always moves no matter how I pin it and then everything becomes unaligned. Any further suggestions appreciated.

  • My apps have all moved on top of each other in the top left corner if I drag them back every time I change page then change back they go back to the corner .what have I done

    My apps have all moved on top of each other in the top left hand corner of the page.every time I drag them back to where they are ghosting on the page ,then change page and back again they r back in the corner again help what have I done

    Try a Reset... press the home and sleep/lock buttons until you see the Apple logo, ignoring the slider. Takes about 5-15 secs of button holding and you won't lose any data or settings.

  • Is anyone else's icloud calendar scrolling up to the top, despite me scrolling down?!  It's very annoying!...Am using Google Chrome on a PC (at work) and a mouse with a roller for scrolling.

    Is anyone else's icloud calendar scrolling up to the top, despite me scrolling down?!  It's very annoying!...Am using Google Chrome on a PC (at work) and a mouse with a roller for scrolling.

    I FOUND THE SOLUTION....well, thanks to your link ELLEN!!!!
    https://discussions.apple.com/thread/4581925?start=0&tstart=0
    With Chrome open to iCloud calendar, hold down the Ctrl button and press the 0 (zero) button.  This will fix your problem.  Did mine!
    With thanks to wetintcars.com and husainfrommumbai!!!

  • Submenus are moving to top of screen in IE8? All other browsers show correctly

    First off, I am new to web design and Dreamweaver, but a fast learner. So please - presume I know very little.
    I am using a mac, and created a horizontal nav bar using the spry widget (DMCS3; Spry 1.6.1). Everything is ok, except for the submenus in my nav bar. I've confirmed that it looks correct (for the PC) in Chrome and Firefox and (for the mac) Safari and Firefox. But in Internet Explorer 8, the submenus are moving all the way to the top of the screen. The only way I have been able to fix it, is if I type 132 px for the "top" "margin" in the "box" category in my ul.MenuBarHorizontal ul rule. However, by doing that it makes all the other browsers view it incorrectly ( the submenu is down towards the bottom of the page).
    I have seen where people have been putting "conditional comments" in their CSS file, for IE...and if this what I need to do, what do I need to write, and where do I need to put it in order to all IE8 users to conform to the 132 px top margin, while all other users conform to the original 2 px top margin.
    Lastly, a few people have commented that the submenu buttons are "sticking" (loading/disappearing slowly) as they scroll through the buttons, is there a way for me to fix that?
    Here's the link to the site, and my CSS file is attached - thanks in advance:
    http://www.newarkfop.com/test/home.html
    P.S. Getting it fixed would be great, but Im also interested to know why IE is even doing what its doing?

    Thanks, this is what I have, and it works for IE8
    <!--[if IE8]>
    <style type="text/css">
    ul.MenuBarHorizontal ul
    margin-top:134px;
    </style>
    <![endif]-->
    Then when I tried to add another comment for IE7, I put this - and then it did not work for either comment, can you tell me if you see something wrong?
    <!--[if IE8]>
    <style type="text/css">
    ul.MenuBarHorizontal ul
    margin-top:134px;
    </style>
    <![endif]-->
    <!--[if IE7]>
    <style type="text/css">
    ul.MenuBarHorizontal ul
    margin-top:134px;
    margin-left:20px;
    </style>
    <![endif]-->

  • Moving around in a  j scroll pane.

    I have a JTextArea inside a JScrollPane and I'm trying to get the scroll pane to goto a certain line number that I want by using:
    TA.setCaretPosition(10*linenumber);the linenumber is the line number the user enters and then the 10 is just the pixel it will go down because the interval I counted between each line is about 10. But it doesn't seem to move at all, what am I doing wrong?

    I guess it doesn't work like that.
    What you are doing is moving the caret to a certain position in the document. The setCaretPosition method expects the CHARACTER position in the document to which to move, and has nothing to do with pixels...
    But this won't be moving the scroll pane at all. I think what you are looking for is the TA.scrollRectToVisible(Rectangle) method. You pass a Rectangle on the textarea that you want to be made visible, and the call is repassed to the parents until a JViewPort is found, which is then scrolled.
    To calculate this rectangle you could use TA.getRows() and TA.getSize().height, for example, to determine how much space each row is really occupying.
    Best regards,
    Marcos.

  • My Index and contact page has moved my top nav up

    I only changed my contact styles on my Index page and now my top nav has gone to the top. On my contact page I added two images so I understand I need to add some code to do with that but not sure how to get it back correct.
    When I veiw my contact page through my wamp server though it all looks fine that's why I uploaded it onto the live server.  Does anyone know why that should be?
    www.bristolequestrianservices.co.uk.  Can someone help please?
    Thanks
    </head>
    <body>
    <div id="outer">
    <div id="wrapper">
                        <div id="logo">
                      <img src="images/banner1.jpg" />
              </div>
              <div id="social-media-icons">
                      <ul>
                          <li><a href="https://www.facebook.com/groups/150449201771804/"><img src="images/icons/facebook.jpg" /></a></li>
                  <li><a href="£"><img src="images/icons/rss.jpg" /></a></li>
                  <li><a href="http://www.twitter.com"><img src="images/icons/twitter.jpg" /></a></li>
                  <li><img src="images/icons/youtube.jpg" /></li>
                </ul>
                        </div>
             <div id="contact">
         <p><span class="big-blue">Bristol Equestrian Service</span><br>
         Tel: 0117 9190060 / 07900538697<br>
         Email: [email protected]<br>
          [email protected]</p>    
         </div             
            ><div id="topnav">
                      <ul>
                          <li><a href="index.html">Home</a></li>
                    <li><a href="stablesandfieldshelters.html">Stable and Field Shelters</a></li>
                    <li><a href="pricelist.html">Price List</a></li>
                    <li><a href="gallery.html">Gallery</a></li>
                    <li><a href="contactus.html">Contact Us</a></li>
                </ul>
                        </div>
                        <div id="banner">
                      <img src="images/newbanner.jpg" />
                        </div>
    /* Containers */
    #outer                                         {  width:960px; margin:0 auto; background:#FFF; }
    #wrapper                               {  width:900px; margin:0 auto; background:#FFF; }
    #logo                                         {  margin: 30px 0; float:left; }
    #social-media-icons                              {  float:right; }
    #social-media-icons ul li          {display:inline; }
    #social-media-icons ul                    {margin-top:40px; }
    #social-media-icons2                    {  float:left; }
    #social-media-icons2 ul li          {display:inline; }
    #social-media-icons2 ul                    {margin-top:10px; }
    #topnav                               { clear:both;  }
    #topnav          ul                              { border-top:1px #000 solid; border-bottom:1px #000 solid;
                                                                margin:20px 0; padding:10px 0;           }
    #topnav ul li                    { display:inline; }
    #topnav ul li a                    { padding:0 15px; }
    #topnav a:link                              { color: #000;  }
    #topnav a:visited                    { color: #000;  }
    #topnav a:active                    { color: #000;  }
    #topnav a:focus                              { color: #666;  }
    #topnav a:hover               { color: #f90;  }
    #banner                                        { margin-bottom:30px;  }
    #rightside                               { width:200px; float:right   }
    #content                               { width:650px; float:left;  }
    #content-fullwidth          {width:100%; }
    #footer                               { clear:both; margin-top:20px 0; border-top:1px #ccc solid;

    /* Color Legend */
    /* Reset */
    Oops sorry copied it all!
    html, body { margin: 0; padding: 0; border: 0; 
                                            background: transparent; font-size:10px; }
    div, span, article, aside, footer, header, hgroup, nav, section,
    h1, h2, h3, h4, h5, h6, p, blockquote, a, ol, ul, li,
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0;
              padding: 0;
              border: 0;
              vertical-align: baseline;
              background: transparent;
    img           { margin:0; padding:0; border:0; }
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0; padding: 0; border: 0;
              vertical-align: baseline;
              background: transparent;
    table { border-collapse: collapse; border-spacing: 0; }
    input, select, textarea, form, fieldset {
              margin: 0; padding: 0; border: 0;
    article, aside, dialog, figure, footer, header, hgroup, nav, section {
              display:block; }
    h1, h2, h3, h4, h5, h6, p, li, blockquote, td, th, a, caption, em, strong, strike {
              font-family: Arial, Helvetica, sans-serif;
              font-size:100%;
              font-weight: normal;
              font-style: normal;
              line-height: 100%;
              text-indent: 0;
              text-decoration: none;
              text-align: left;
              color: #000;
    ol, ul { list-style: none; }
    /* Global */
    html           {          }
    body          { background: #960          }
    /* Headings */
    h1, h2, h3, h4, h5, h6 { font-weight: bold; }
    h1 { font-size:24px; color:#BB5E00;
              padding-bottom:15px; border-bottom:1px #ccc solid; margin-bottom:15px; }
    h2 { font-size:20px; color:#666 }
    h3 { font-size:16px; }
    h4 { font-size:20px; color: #666}
    h5 { font-size:14px; }
    h6 { font-size:14px; }
    h1 img, h2 img, h3 img, h4 img, h5 img, h6 img { margin: 0; }
    /* Text Elements */
    p                     { color:#000; font-size:12px; line-height:150%; 
                                             margin:15px; 0; }
    p .left                              { margin: 1.5em 1.5em 1.5em 0; padding: 0; }
    p .right                     { margin: 1.5em 0 1.5em 1.5em; padding: 0; }
    a                     {   }
    a:link                              { color: #00f;  }
    a:visited                    { color: #0f0;  }
    a:active                    { color: #000;  }
    a:focus                              { color: #666;  }
    a:hover               { color: #f00;  }
    blockquote            { color:#000; font-size:12px; }
    strong                { font-weight: bold; }
    em                                    { font-style: italic; }
    /* Images */
    /* Lists */
    ul                    {  }
    ol                    { list-style-type:decimal; }
    ul li                        { color:#000; font-size:12px; }
    ol li                         { color:#000; font-size:12px; }
    dl                    {            }
    dt                           {            }
    dd                    {           }
    /* Tables */
    table                 { width:100%; }
    tr                                        {          }
    .odd                              { background-color:#eee; }
    .even                              { background-color:#fff; }
    th                    { font-weight: bold; }
    thead, th              { background: #ccc; }
    tbody                              {   }
    th,td,caption           {           }
    caption                     {           }
    tfoot                 {          }
    .tfooter                    { background-color:#ccc; text-align:center; font-style:italic; }
    caption               { background: #efefef; }
    /* Miscellaneous */
    sup, sub              { line-height: 0; }
    abbr, acronym   { border-bottom: 1px dotted #666; }
    address               {            }
    del                   { background:#FFCECE; color:#f00; }
    code, pre                    { background-color:#FF9; padding:2px 0px; margin:4px 25px;
                                                      font-family:"Courier New", Courier, monospace; font-size:12px; font-weight:normal; line-height:150%;          }
    /* Containers */
    #outer                                         {  width:960px; margin:0 auto; background:#FFF; }
    #wrapper                               {  width:900px; margin:0 auto; background:#FFF; }
    #logo                                         {  margin: 30px 0; float:left; }
    #social-media-icons                              {  float:right; }
    #social-media-icons ul li          {display:inline; }
    #social-media-icons ul                    {margin-top:40px; }
    #social-media-icons2                    {  float:left; }
    #social-media-icons2 ul li          {display:inline; }
    #social-media-icons2 ul                    {margin-top:10px; }
    #topnav                               { clear:both;  }
    #topnav          ul                              { border-top:1px #000 solid; border-bottom:1px #000 solid;
                                                                margin:20px 0; padding:10px 0;           }
    #topnav ul li                    { display:inline; }
    #topnav ul li a                    { padding:0 15px; }
    #topnav a:link                              { color: #000;  }
    #topnav a:visited                    { color: #000;  }
    #topnav a:active                    { color: #000;  }
    #topnav a:focus                              { color: #666;  }
    #topnav a:hover               { color: #f90;  }
    #banner                                        { margin-bottom:30px; }
    #rightside h2 {
    font-size: 24px;
        color: #999;
        font-weight: normal;
        margin: 0 0 0 0;
        padding: 0 0 10px 0; /*top-right-bottom-left*/
    #rightside p {
        margin: 0 0 0 0;
        padding: 0 0 10px 0; /*top-right-bottom-left*/
    #rightside a {
        text-decoration: none;
        color: #7A7D42;
        font-size: 14px;
        padding: 0 0 15px 0; /*top-right-bottom-left*/
    #rightside a:hover {
    color:#BB5E00
    #rightside p {
        margin: 0 0 0 0;
        padding: 10px 0 10px 0; /*top-right-bottom-left*/
        border-bottom: 1px solid #ccc;
    #content                               { width:650px; float:left;  }
    #content-fullwidth          {width:100%; }
    #footer                               { clear:both; margin-top:20px 0; border-top:1px #ccc solid;
                                                       padding-bottom:20px; }
    .rowWrapper {
        overflow: hidden;
        margin: 0 0 15px 0;
    .details {
    width:286px;
    float:left;
    margin: 0 0 0 20px;
    padding: 15px 0 0 0;
    border-top: 2px solid #000;
    .details p {
    margin: 0;
    padding: 0 20px;
    #box1 {   }
    #box2 {  }
    #box3 {  }
    #box4 {  }
    #box5 {   }
    #box6 {   }
    #box7 {   }
    #box6 {  }
    #box9 {   }
    #box10 {   }
    /* Layout Extra */
    /* Navigation Extra */
    /* Forms */
    /* Forms */
    form ol { list-style-type:none; }
    form           { text-align:left; margin:20px;          }
    label           {
                        float: left; width: 150px; margin-top:5px;
                        text-align:right; display:block; background:none; font-weight:bold;
    submit          { background:none;           }
    input           {
                        width: 280px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    input:focus, textarea:focus          { background-color:#CCC; }
    textarea {
                        width: 280px; height: 150px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    select { margin-bottom:20px;          }
    .month { margin-left:155px;          }
    .submit {
                        width:90px; height:25px;
                        margin-left:160px;
                        font-size:12px;
    br                    { clear: left;           }
    .clear          { clear:both; }
    /* Miscellaneous  */
    .copyright-text          { font-size:80%; font-style:italic; color:#333; }
    .footer-text          { font-size:100%; font-style:normal; color:#000; text-align:center; }
    .title                              { font-size:18px; font-weight:bold; color:#333;  }
    .subtitle                    { font-size:14px; font-style:italic; color:#333;  }
    .artist                              { font-size:16px; font-weight:bold; color:#333;  }
    .author                              { font-size:14px font-weight:bold; color:#555;  }
    .editor                              { font-size:14px font-style:italic; color:#555;  }
    .pub-date                    { font-size:10px font-style:italic; color:#555; }
    .article-date          { font-size:10px font-style:italic; color:#555;  }
    .location                    { font-size:10px font-style:italic; color:#555;  }
    .float-right          { float:right; }
    .float-left                    { float:left; }
    .clear                              { clear:both; }
    .hide                              { display:none; }
    .block                              { display:block; }
    .inline                              { display:inline; }
    .first                              { font-weight:bold; }
    .last                              { font-weight:bold; }
    .left                              { font-weight:bold; text-align:left; }
    .right                              { font-weight:bold; text-align:right; }
    .added                { background:#D7D7FF; }
    .removed              { background:#FFCECE; color:#f00; }
    .changed                    { background:#FFB; }
    /* Success, info, notice and error/alert boxes - from Blueprint CSS Framework */
    .error, .alert, .notice, .success, .info {
              padding: 0.8em; margin-bottom: 1em; border: 2px solid #ddd; }
    .error, .alert           { background: #fbe3e4; color: #8a1f11; border-color: #fbc2c4; }
    .notice                              { background: #fff6bf; color: #514721; border-color: #ffd324; }
    .success                       { background: #e6efc2; color: #264409; border-color: #c6d880; }
    .info                               { background: #d5edf8; color: #205791; border-color: #92cae4; }
    .error a           { color: #8a1f11; }
    .alert a           { color: #8a1f11; }
    .notice a   { color: #514721; }
    .success a  { color: #264409; }
    .info a                    { color: #205791; }
    #contact {
              float: right;
              clear: both;
    .big-blue {
         font-size:32px;
         color:#000;
               font-family:Monotype Corsiva;

  • Objects and text cannot be moved from top left

    I just merged my website from some other drag and drop editor to DW.
    I am determined to learn how to work everything (Or at least enough to get by).
    But I have hit a snag along my learning path, and am hoping it is something simple.
    I am trying to add text, and graphics. And it would seem I cannot simply drag it around the page like in other designers? Because it defaults to the top left of my page, and cannot be moved by dragging. On the images, when I edit the tag, I was able to change the virtical and horizontal attributes and place the image where I wanted it. but text I add has no such option.
    I would post you the code, but I don't know which piece to post.
    Forgive me, I am very novice, having no experience with html, and less than a week experience with DW.
    But I learn quickly, and with your patience, even quicker.
    Thank you so much!

    You need to get a grasp of the basics. Dragging and dropping into DW will not place things where you want.  I just noticed that ZaBeth posted this in another post, start here, then find some other beginner CSS and HTML tutorials.
    Have a look at David Powers's CSS book. It is very accessible and easy to get into: http://gettingstartedwithcss.com/ (palgerized from ZaBeth69)
    And keep reading this board, there are alot of new comers that post very basic questions, so you get some good information here.
    Gary

  • Applications moving to top left losing controls

    When returning from a display sleep mode I find applications whose windows have moved to the top left of the screen and no longer have their controls or menu bar accessible. If I go to the desktop controls for the application and close the application and reopen it it opens normally and in the midlle of the screen. This works for most applications except for finder which Cannot be closed in this manner and I have to shutdown my Mac and restart. I have tried a few different things but have been unable to resolve the issue.
    I have a MacBook Air and am running OS X 10.9. I use only the laptops screen and have no attached monitor.

    When returning from a display sleep mode I find applications whose windows have moved to the top left of the screen and no longer have their controls or menu bar accessible. If I go to the desktop controls for the application and close the application and reopen it it opens normally and in the midlle of the screen. This works for most applications except for finder which Cannot be closed in this manner and I have to shutdown my Mac and restart. I have tried a few different things but have been unable to resolve the issue.
    I have a MacBook Air and am running OS X 10.9. I use only the laptops screen and have no attached monitor.

  • My Canvas is on Top of My Scroller

    Hi, I've been trying to right the code for a function grapher in netBeans.
    I have the grapher class which extends java.awt.Canvas and draws a coordinate plane using its paint method. This grapher class is placed inside a scrollerPane with the following code:
    graphScroller = new javax.swing.JScrollPane();
    graph = new Grapher(width, height);
    graphScroller.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    graphScroller.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    graphScroller.setViewportView(graph);
    org.jdesktop.layout.GroupLayout graphPanelLayout = new org.jdesktop.layout.GroupLayout(graphPanel);
    graphPanel.setLayout(graphPanelLayout);
    graphPanelLayout.setHorizontalGroup(
            graphPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(graphScroller, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE)
    graphPanelLayout.setVerticalGroup(
            graphPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(graphScroller, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
    );Whenever the size of the grapher is less than the scroller everything works fine, but when, for instance, the width is greater than the width of the scroller, the grapher extends past and covers up anything else in the program. It does, however, move back and forth whenever the scrollbar is moved. Is there some way to set like a z-index or something so that it is behind all the other elements? Thanks.

    I don't know about GroupLayout, but with normal layout managers, you
    either override getPreferredSize (and perhaps getMinimumSize and getMaximumSize) or call the corresponding get* methods. I never call setSize, because that is called by proper layout managers on you behalf:
    import java.awt.*;
    import javax.swing.*;
    public class ComponentExample extends JComponent implements Runnable {
        public void run() {
            JComponent comp = new ComponentExample();
            comp.setPreferredSize(new Dimension(600,400));
            JFrame f = new JFrame();
            f.getContentPane().add(new JScrollPane(comp));
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(400, 300);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            g.setColor(Color.WHITE);
            g.fillRect(0, 0, w, h);
            g.setColor(Color.GREEN);
            g.drawLine(0, 0, w, h);
            g.drawLine(0, h, w, 0);
        public static void main(String[] args) {
            EventQueue.invokeLater(new ComponentExample());
    }

  • Text becomes overset when moved on top of another object

    I'm trying to figure out why everytime I move a text box on top of another object the text suddenly becomes overset and disappears.  If I move it off the object or out of the spread entirely, the text comes back and appears normal.  I've tried placing the file, copy and pasting the file, copy and pasting the selected text, moving the text box into a separate layer, checking the ordering to ensure the text box is on top, but nothing seems to work.  Any thoughts on why this is happening?

    OGC Management wrote:
    ... if I checked the invert box it corrected the problem! 
    your going to chase your tail with that "solution".
    Select all (ctrl+a)(cmd+a) and set Text Wrap to none as shown.
    The item could be on a master page or a locked layer, but  you indicate you were able to modify the wrap attributes...

  • Footer has moved to top of page

    The Footer has moved to the top of the page. Any idea why?
    Longstaff Longstaff

    You could add the following to the .footer class css...
    position:fixed;
    bottom:0px;
    That would force it to sit on the bottom of the browser view port, no matter how large the viewer opens their screen.

  • Help with scrolling textarea or div

    I want to have a div with fixed height that scrolls the
    content inside vertically - the scrolling is not automatic - I want
    to have an up arrow and a down arrow that you click or hover to
    scroll.
    How can I do this?
    All I have found is how to customize the scrollbars using CSS
    but that doesn't work on all browsers, so I want to make my own up
    and down arrows.
    Thanks

    Take a look at this one from Project VII - it works in all
    browsers.
    www.projectseven.com/products/tools/vscroller/index.htm
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "scullen81" <[email protected]> wrote in
    message
    news:fcrlpo$lq9$[email protected]..
    > I want to have a div with fixed height that scrolls the
    content inside
    > vertically - the scrolling is not automatic - I want to
    have an up arrow
    and a
    > down arrow that you click or hover to scroll.
    >
    > How can I do this?
    >
    > All I have found is how to customize the scrollbars
    using CSS but that
    doesn't
    > work on all browsers, so I want to make my own up and
    down arrows.
    >
    > Thanks
    >

  • Buttons moving on top of panorama

    Hi,
    I have a panorama which I've coded to move back and forth horizontally when I press the arrow keys. I'm trying to get some buttons to sit at designated points across the panorama. I'm having trouble getting them to stick at the right places, though, instead of roaming around. Right now, I'm focusing on Norris_btn (although Annenberg_btn doesn't work right now either), which starts out in the right position (all the way at the far left of the panorama, which is 10061 px wide). However, if I scroll all the way to the right and then try and go back to the left, Norris_btn appears in the wrong place. Here is my code:
    const PANWIDTH:Number=10061
    const STAGEWIDTH:Number=650
    const KEYWIDTH:Number=40
    //positions objects on the stage
    panorama_mc.x = 0;
    Norris1_btn.x=-5030.5;
    Norris1_btn.y=0;
    Annenberg_btn.x=-1145;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    stop();
    function keyPressed (event:KeyboardEvent):void {
                switch (event.keyCode) {
            case  Keyboard.LEFT :
               if (panorama_mc.x + KEYWIDTH<=(PANWIDTH / 2) - (STAGEWIDTH / 2)) panorama_mc.x +=KEYWIDTH;
               if (Norris1_btn.x + KEYWIDTH <=-(STAGEWIDTH/ 2)) Norris1_btn.x += KEYWIDTH;
                                  if (Annenberg_btn.x<=(PANWIDTH / 2) + KEYWIDTH) Annenberg_btn.x += KEYWIDTH;
               break;
            case  Keyboard.RIGHT :
               if (panorama_mc.x - KEYWIDTH>=-(PANWIDTH / 2) + STAGEWIDTH) panorama_mc.x -= KEYWIDTH;
                                  if (Norris1_btn.x - KEYWIDTH >=-(PANWIDTH / 2) + STAGEWIDTH) Norris1_btn.x -= KEYWIDTH;
               if (Annenberg_btn.x>=(-PANWIDTH / 2) + KEYWIDTH + STAGEWIDTH) Annenberg_btn.x -= KEYWIDTH;
    Any suggestions? Thanks!

    I had tried to do that, but after a lot of searching around and trying out different things I'm still a little bit unsure of how to make it so AS can talk to the button when it's a part of the movie clip.
    RIght now I have this in the main timeline:
    panorama_mc.Norris1_btn.addEventListener(MouseEvent.CLICK, showNorris);
    function showNorris (event:MouseEvent):void
              gotoAndStop(2);
    and this in the movie clip timeline:
    Norris1_btn.addEventListener(MouseEvent.CLICK, showNorris);
    function showNorris(event:MouseEvent):void
              gotoAndStop(2);
    But I get an error 1009 for a null object reference and the panorama won't move. What am I doing wrong?

  • Mouse randomly moving to top corner!

    My mouse is giving me trouble... it always wants to be up in the top left corner of my screen. It started randomly with my Magic Mouse, so I switched to a corded USB mouse and the problem still persists. I've never had any problems with either my Mac or my mouse, but now this. If I sleep the machine via the button on the back (I have an Intel-based desktop iMac running 10.5.8) the problems is temporarily fixed, but then comes back a few minutes later.
    I usually have great luck finding the solution to my problem on these forums, but can't seem to find a similar issue. Any ideas?
    Thank you!

    After that many months the original poster will no longer get an e-mail notification.
    Try using Disk Utility to do a Disk Repair, as shown in this link, while booted up on your install disk.
    You could have some directory corruption. Let us know what errors Disk Utility reports and if DU was able to repair them. Disk Utility's Disk Repair is not perfect and may not find or repair all directory issues. A stronger utility may be required to finish the job.
    After that Repair Permissions.
    No need to report Permissions errors....we all get them.
      DALE

Maybe you are looking for

  • Uploading in Lightroom

    I have been uploading some web galleries with lightroom for a horse show.  The first gallery I uploaded, went just fine.  However, the others I have uploaded, I have noticed  I get an error of  "An error occurred sending the file: a response was not

  • Noisy CD/DVD drive

    I have a 2009 MacPro, running the latest system etc. For quite some time my CD/DVD drive is really noisy when reading discs. I called Apple Support, but they wouldn't send me a new drive, since it still reads. I'm some 90 miles and a ferry ride from

  • Income Posting

    Dear All While making an entry for Income i.e. Interest Received, When I assign a Profit Center and press enter, I get a Yellow message from the system. The message is as follows: Enter a true account assignment object with revenues Message no. KI166

  • After Effects CC (12.2) and CS6 (11.0.4) updates are available

    After Effects CC (12.2) and CS6 (11.0.4) updates are available: http://adobe.ly/AE_Dec_2013_updates There are lots of bug fixes and new and changed features in the After Effects CC (12.2) update, and a couple of targeted bug fixes in the After Effect

  • Interfaces: Optional Operations

    Sometimes, reading interfaces' API's, I see "optional operations" next to some methods. Does that mean that one can actually not implement such a method and yet it would compile, or only that the implemented method can do whatever the programmer want