PLeazzzzzzz help with scrolling application

Hello all,
Basically, I want a JFrame that allows the user to scroll down if the monitor size doesn't allow the user to see the entire contents of the JFrame. The problem is that the JPanel is larger than the JScrollPane. However, it doesn't allow me to scroll down and see the rest of the components on the panel?????????????????????????
thanks for your help!
import java.awt.*;
import javax.swing.*;
public class WindowFrames extends JFrame
private JScrollPane scrollPane;
private JPanel mainPanel;
private Container cp, scp;
private static final int WIDTH = 500, HEIGHT = 500;
public WindowFrames()
setTitle( "Scrolling Pane Application" );
setSize(WIDTH, HEIGHT );
setBackground( Color.gray );
setVisible(true);
// setResizable(false);
cp = getContentPane();
cp.setLayout(null);
mainPanel = new JPanel();
mainPanel.setBounds(0,0,2*WIDTH,2*HEIGHT);
mainPanel.setBackground(Color.red);
mainPanel.setLayout(null);
JTextArea a,b,c;
a = new JTextArea();
a.setVisible(true);
a.setBounds(0,0,200,200);
b = new JTextArea();
b.setVisible(true);
b.setBounds(0,400,200,200);
c = new JTextArea();
c.setVisible(true);
c.setBounds(0,700,200,200);
mainPanel.add(a);
mainPanel.add(b);
mainPanel.add(c);
scrollPane = new JScrollPane(mainPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
scrollPane.setBounds(0,0,WIDTH, HEIGHT);
cp.add(scrollPane);
repaint();

Since you are using a null layout manager, you have to manually set the
preferrred size of the mainPanel. JScrollPane use the perfered size of it children to determine how to display the scrool bar.
add this to your code and the scrool bar will show up.
mainPanel.setPreferredSize(new Dimension(200, 900));
in your code:
==================
mainPanel.add(a);
mainPanel.add(b);
mainPanel.add(c);
mainPanel.setPreferredSize(new Dimension(200, 900));

Similar Messages

  • Hi, I need help with scrolling

    Hello I am Kevin Jin, I am working a huge project acually not that big, but I need help with five things, i mihgt have more things in my mind but here it is
    1. I need help with scrolling like where you have buttons for example or press on a navigation bar tab, then it goes to that specific pace of the page, for a one page website, for example some sites you press on contacts and gose down to the bottom of the page where the contacts place is located, not opening a new link.
    2.Second also I need help with navigation bar, where it fallows the scroll as it gose down, like for example when it is html the object is fixed to the top, and when you scroll down it will fallow it it,
    3.I need Parallex scrolling where you can have the timeline or animations run while you scroll in the meantime and have animation running all the time, for example the infographic site where the bees are fluying but still have seperate animations while you scroll
    4.I am so sorry i have two more to go, i appreciate your help, I would also like to ask if like looping each animations sperately, not looping the whole timeline, can it be possible to loop an animation while you have all the interactivity witht he site like looping seperately all the time, without interfeering with all the other animation
    5.I also are wondering if you can create multiple pages on one animate project, like multiple pages with html
    I just moved on to edge animate from html, and html was also beirf learn for me and mostly i was doing design work, and i thought getting out of graphic river and moving on the theme forest would be a better idea for me, thank you guys so much of the help and add me on skype : kevin2019170 or add me on facebook ; [email protected] or graphicriver, www.graphicriver.net/user/phantomore I would appriciate if you just would like contact me through SNS since I have that in hany 24 hours long, but the thred will also do, thank you doo much foryour help,
    P.S, I want also all the five things to work on one aimate project not interfeering with other ideas liek all five questions i had should run on one site,
    THANK YOU SO MUCH FOR YOUR HELP AND I APPRICIATE YOUR HELP!

    1.
    write this code in your button Click
    $('html,body').animate({scrollTop: sym.$("Your Symbole Name Here").offset().top}, "slow"); // scroll to the top of that symbol name
    Or :
    $('html,body').animate({"scrollTop":"600px"}, 750); // Higher value means slower , scroll to top page
    1 and 2 see this post http://forums.adobe.com/message/5531344#5531344
    3 use edge commons plugin http://www.edgedocks.com/edgecommons
    4.just put the animations behind eachother so when 1 is done, start with the animating the other symbol/div
    5. i thin its best just to make for every page a new project or make the site in muse.

  • Help with Partner Application

    Hello,
         I am looking for some help with the �Administer Partner Application� page ( This can be reached from Portlet Repository : Administration : SSO/OID: SSO Server Administration: Administer Partner Applications).
         This page contains the list of partner applications authenticated through the SSO Server.
         I am looking for a way to add specific applications from this list (not all of them but only a few) to another page. Is there a way to do this either programmatically or through the GUI?
    Thanks in advance,
    Karthik Paliniappan.

    Hi
    can you be little more expalinatory with you sentance
    I am looking for a way to add specific applications from this list (not all of them but only a few) to another page. Is there a way to do this either programmatically or through the GUI?
    Regards
    Samir

  • Help with Partner Applications

    Hello,
    I am looking for some help with the �Administer Partner Application� page ( This can be reached from Portlet Repository : Administration : SSO/OID: SSO Server Administration: Administer Partner Applications).
    This page contains the list of partner applications authenticated through the SSO Server.
    I am looking for a way to add specific applications from this list (not all of them but only a few) to another page. Is there a way to do this either programmatically or through the GUI?
    Thanks in advance,
    Karthik Paliniappan.

    Hi,
    Please post this question on login server and sso forum.
    Thanks,
    Sharmila

  • Help With Scrolling Menu / Button Rollovers

    First thank you to anyone who can answer and help with this
    question.
    http://paragon.sortismarketing.com
    - at this link I have created a site with a simple scrolling menu.
    Now what I want to happen is when you rollOver the buttons on the
    scrolling menu they get larger and then smaller again after you
    roll off them.
    I know how to do this with tweening in a non moving
    environment, by making them a movie clip instead of button. But for
    some reason when I did this in this case it screwed the menu all up
    and made it go crazy. Is there a way to do this with action script
    that isn't going to screw up the underlying code for the
    scrolling?

    You can use the below code also. As your mouse pointer goes
    over the down, it will scroll down.
    on(rollOver){
    scrolltext.scroll -= 1;

  • Help with Scrolling Text Item.

    Hi , need help with making a text item scrollable.
    i.e. A field is 30 characters and i can only display 10
    characters, now what I would like is a scroll bar under the text
    item.
    Is this possible. I am using Forms 5.
    Thanx for any help.
    Pankaj Patel.
    null

    Petr Valouch (guest) wrote:
    : Pankaj Patel (guest) wrote:
    : : Hi , need help with making a text item scrollable.
    : : i.e. A field is 30 characters and i can only display 10
    : : characters, now what I would like is a scroll bar under the
    : text
    : : item.
    : : Is this possible. I am using Forms 5.
    : : Thanx for any help.
    : : Pankaj Patel.
    : Hi
    : You need that scrollbar under the item? You can set length
    of
    : text item and its size independently, so you can have text
    item
    : char(30) with size of 10 characters.
    An alternative is to declare the item as a multi-line text item
    with wrap set on. This would give you a vertical scroll bar on
    the item.
    Another option is to programmaticaly pop up an Editor, each time
    focus is moved to the item, or to actually change the width of
    the item when focus moves to it (and shrink it back when focus
    moves away.
    Simon Hedges
    Gloucester
    UK
    null

  • Need Help with Scrolling Problem

    I have a JTree displayed in scrollpane. Based on search criterial I select the nodes where the search criteria is found. If the match is located off the screen further down into the tree, the node is highlighted but the scrollpane doesn't automatically scroll down to show it. Any help with this problem is appreciated.

    Wow.. Thanks. I thought I would need some fancy code to handle this problem. scrollPathToVisible did it for me. Thanks.

  • Help with scrolling thumbnails photogallery

    i need some help with this photo gallery im working on. im pretty sure i have almost everything correct but for some reason i cant get the thumbnails when clicked to link up with the img. i want it to show.
    well i cant really upload the file here i just found out so i can email it to whoever leaves there email
    if someone could take a look at the file and tell me what im doing wrong that would be so helpful ive been working on it for the past 2 days trying to fig. out whats wrong searching everywhere and i just cant fig. it out.
    thanks for the help

    Please don't duplicate postings.

  • Please need Help with web application deployment in Jdeveloper 12c

    Hi,
    I am desperate for help guys. am trying to deploy a web application in weblogic server, but nothing works!!
    I created a project in jdeveloper and created a jsp page inside the project, all what i want is to run that page!
    I followed the instruction here: Deploying Fusion Web Applications , I don't really know if i did it right or wrong, the document is too detailed and not understood clearly.
    I am a newbie oracle user, and trying to build jsp web application connected to oracle database. application deployment fails it says: cannot run application error deploying IntegratedWeblogic..
    please could you tell me the steps of application deployment in Jdeveloper 12c?
    what deployment profiles I need to create (ear, war , mar)?
    what deployment descriptor I need for my app to work?
    please guys I am newbie to oracle, if you could give me simplified answers and straight instructions it will be appreciated .
    thank you

    hi Timo,
    I am building a local web application, meaning the server is internal and will not connect to the web, only to local pcs via network. the application will insert/select data from the database server. My company wants to embed oracle technology on the datatabse and that what am trying to. I am not that expert in java and oracle in general, my main knowledge are in php, html and mysql programming. through my long internet research a lot has recommended jsp with html to be a good choice.
    At beginning I played around with ADF faces, I found it annoying because I prefer coding than using drag and drop interfaces, which always create unwanted results.
    Also am not that professional java programmer, i started learning jsp and found it easier.
    What I am thinking of is to make a web based application that works in browsers (like php), this application has forms to insert data, and also has forms to output data for printing. that's all. I tried to make it in php, but through my little knowledge and internet researches it seems php does not work with oracle and java is the recommended choice (or it works with php but too complicated to make it)
    any recommendation will be much appreciated
    thank you

  • URGENT! Need help with scrolling on a JPanel!

    Hello Guys! I guess there has been many postings about this subject in the forum, but the postings I found there.... still couldn't solve my problem...
    So, straight to the problem:
    I am drawing some primitive graphic on a JPanel. This JPanel is then placed in a JScrollPane. When running the code, the scrollbars are showing and the graphic is painted nicely. But when I try to scroll to see the parts of the graphics not visible in the current scrollbarview, nothing else than some flickering is happening... No movement what so ever...
    What on earth must I do to activate the scroll functionality on my JPanel??? Please Help!
    And yes, I have tried implementing the 'Scrollable' interface... But it did not make any difference...
    Code snippets:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import java.util.*;
    public class FilterComp extends JPanel {//implements Scrollable {
      protected DefaultMutableTreeNode root;
      protected Image buffer;
      protected int lastW = 0;
      protected int origoX = 0;
      protected final StringBuffer sb = new StringBuffer();
    //  protected int maxUnitIncrement = 1;
      protected JScrollPane scrollpane = new JScrollPane();
       *  Constructor for the FilterComp object
       *@param  scrollpane  Description of the Parameter
      public FilterComp(JScrollPane scrollpane) {
        super();
    //    setPreferredSize(new Dimension(1000, 500));
        this.setBackground(Color.magenta);
    //    setOpaque(false);
        setLayout(
          new BorderLayout() {
            public Dimension preferredLayoutSize(Container cont) {
              return new Dimension(1000, 600);
        this.scrollpane = scrollpane;
        scrollpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollpane.setPreferredSize( new Dimension( 500, 500 ) );
        scrollpane.getViewport().add( this, null );
    //    scrollpane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
        repaint();
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        int w = getSize().width;
        if (w != lastW) {
          buffer = null;
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        if (root != null) {
          int h = getHeight(root);
          if (buffer == null) {
            buffer = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g3 = (Graphics2D) buffer.getGraphics();
            g3.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g3.setColor(Color.black);
            g3.setStroke(new BasicStroke(2));
            paint(g3, (w / 2) + origoX, 10, w / 2, root); 
          lastW = w;
          AffineTransform old = g2.getTransform();
          AffineTransform trans = new AffineTransform();
          trans.translate((w / 2) + origoX, (getHeight() - (h * 40)) / 2);
          g2.setTransform(trans);
          g2.drawImage(buffer, (-w / 2) + origoX, 0, null);
          g2.setTransform(old);
        updateUI();
       *  Description of the Method
       *@param  g  Description of the Parameter
      public void update(Graphics g) {
        // Call paint to reduce flickering
        paint(g);
       *  Description of the Method
       *@param  g2    Description of the Parameter
       *@param  x     Description of the Parameter
       *@param  y     Description of the Parameter
       *@param  w     Description of the Parameter
       *@param  node  Description of the Parameter
      private void paint(Graphics2D g2, int x, int y, int w, DefaultMutableTreeNode node) {
        if (node.getChildCount() == 2) {
          DefaultMutableTreeNode c1 = (DefaultMutableTreeNode) node.getChildAt(0);
          DefaultMutableTreeNode c2 = (DefaultMutableTreeNode) node.getChildAt(1);
          if (c1.getChildCount() == 0 && c2.getChildCount() == 0) {
            String s = c1.getUserObject().toString() + " " + node.getUserObject() + " " + c2.getUserObject();
            paint(g2, x, y, s);
          } else {
            g2.drawLine(x - (w / 2), y, x + (w / 2), y);
            Font f = g2.getFont();
            g2.setFont(new Font(f.getName(), Font.BOLD | Font.ITALIC, f.getSize() + 2));
            paint(g2, x, y, node.getUserObject().toString());
            g2.setFont(f);
            g2.drawLine(x - (w / 2), y, x - (w / 2), y + 40);
            g2.drawLine(x + (w / 2), y, x + (w / 2), y + 40);
            paint(g2, x - (w / 2), y + 40, w / 2, c1);
            paint(g2, x + (w / 2), y + 40, w / 2, c2);
        } else if (node.getChildCount() == 0) {
          paint(g2, x, y, node.getUserObject().toString());
       *  Description of the Method
       *@param  g2  Description of the Parameter
       *@param  x   Description of the Parameter
       *@param  y   Description of the Parameter
       *@param  s   Description of the Parameter
      private void paint(Graphics2D g2, int x, int y, String s) {
        y += 10;
        StringTokenizer st = new StringTokenizer(s, "\\", false);
        if (s.indexOf("'") != -1 && st.countTokens() > 1) {
          int sh = g2.getFontMetrics().getHeight();
          while (st.hasMoreTokens()) {
            String t = st.nextToken();
            if (st.hasMoreTokens()) {
              t += "/";
            int sw = g2.getFontMetrics().stringWidth(t);
            g2.drawString(t, x - (sw / 2), y);
            y += sh;
        } else {
          int sw = g2.getFontMetrics().stringWidth(s);
          g2.drawString(s, x - (sw / 2), y);
       *  Sets the root attribute of the FilterComp object
       *@param  root  The new root value
      public void setRoot(DefaultMutableTreeNode root) {
        this.root = root;
        buffer = null;
       *  Gets the root attribute of the FilterComp object
       *@return    The root value
      public DefaultMutableTreeNode getRoot() {
        return root;
       *  Gets the height attribute of the FilterComp object
       *@param  t  Description of the Parameter
       *@return    The height value
      private int getHeight(TreeNode t) {
        int h = 1;
        int c = t.getChildCount();
        if (c > 0) {
          if (c > 1) {
            h += Math.max(getHeight(t.getChildAt(0)), getHeight(t.getChildAt(1)));
          } else {
            h += getHeight(t.getChildAt(0));
        return h;
       *  Sets the x attribute of the FilterComp object
       *@param  x  The new x value
      public void setX(int x) {
        origoX = x;
       *  Gets the x attribute of the FilterComp object
       *@return    The x value
      public int getX() {
        return origoX;
       *  Gets the preferredScrollableViewportSize attribute of the FilterComp
       *  object
       *@return    The preferredScrollableViewportSize value
    //  public Dimension getPreferredScrollableViewportSize() {
    //    return getPreferredSize();
       *  Gets the scrollableBlockIncrement attribute of the FilterComp object
       *@param  r            Description of the Parameter
       *@param  orientation  Description of the Parameter
       *@param  direction    Description of the Parameter
       *@return              The scrollableBlockIncrement value
    //  public int getScrollableBlockIncrement(Rectangle r, int orientation, int direction) {
    //    return 10;
       *  Gets the scrollableTracksViewportHeight attribute of the FilterComp object
       *@return    The scrollableTracksViewportHeight value
    //  public boolean getScrollableTracksViewportHeight() {
    //    return false;
       *  Gets the scrollableTracksViewportWidth attribute of the FilterComp object
       *@return    The scrollableTracksViewportWidth value
    //  public boolean getScrollableTracksViewportWidth() {
    //    return false;
       *  Gets the scrollableUnitIncrement attribute of the FilterComp object
       *@param  r            Description of the Parameter
       *@param  orientation  Description of the Parameter
       *@param  direction    Description of the Parameter
       *@return              The scrollableUnitIncrement value
    //  public int getScrollableUnitIncrement(Rectangle r, int orientation, int direction) {
    //    return 10;
    }

    The Scrollable interface should be implemented by a JPanel set as the JScrollPane's viewport or scrolling may not function. Although it is said to be only necessary for tables, lists, and trees, without it I have never had success with images. Even the Java Swing Tutorial on scrolling images with JScrollPane uses the Scrollable interface.
    I donot know what you are doing wrong here, but I use JScrollPane with a JPanel implementing Scrollable interface and it works very well scrolling images drawn into the JPanel.
    You can scroll using other components, such as the JScrollBar or even by using a MouseListener/MouseMotionListener combination, but this is all done behind the scenes with the use of JScrollPane/Scrollable combination.
    You could try this approach using an ImageIcon within a JLabel:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Test extends JFrame {
         BufferedImage bi;
         Graphics2D g_bi;
         public Test() {
              super("Scroll Test");
              makeImage();
              Container contentPane = getContentPane();
              MyView view = new MyView(new ImageIcon(bi));
              JScrollPane sp = new JScrollPane(view);
              contentPane.add(sp);
              setSize(200, 200);
              setVisible(true);
         private void makeImage() {
              bi = new BufferedImage(320, 240, BufferedImage.TYPE_INT_ARGB);
              g_bi = bi.createGraphics();
              g_bi.setColor(Color.white);
              g_bi.fillRect(0,0,320,240);
              g_bi.setColor(Color.black);
              g_bi.drawLine(0,0,320,240);
         public static void main(String args[]) {
              Test test = new Test();
    class MyView extends JLabel {
         ImageIcon icon;
         public MyView(ImageIcon ii) {
              super(ii);
              icon = ii;
         public void paintComponent(Graphics g) {
              g.drawImage(icon.getImage(),0,0,this);
    }Robert Templeton

  • Help with scrolling photo gallery

    I'm using the code below to for a scrolling photo gallery. I got this from another forum on Adobe. My problem is that I can't get my images to upload. I uploaded this for an image but it's not working:
    <img src="images/baca_poster_small.jpg" data-cycle-title="image1">
    Can someone please help me with getting my pictures to work in this?
    Thanks!
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 document with Cycle2</title>
    <!--Latest jQuery Core Library-->
    <script src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    <!--Cycle2 Plugin Script-->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>
    <style>
    .cycle-slideshow, .cycle-slideshow * {
    -webkit-box-sizing:border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin:0 auto;
    width:45%; /**adjust width as required**/
    .cycle-slideshow img {width: 100%;}
    </style>
    </head>
    <body>
    <h1><a href="http://www.malsup.com/jquery/cycle2/">jQuery Cycle 2</a> Responsive Slideshow</h1>
    <!--begin slideshow-->
    <div class="cycle-slideshow"
        data-cycle-pause-on-hover="true"
        data-cycle-speed="700"
    >
    <!--your images go here-->
    <img src="http://malsup.github.com/images/beach1.jpg" data-cycle-title="beach1">
    <img src="http://malsup.github.com/images/beach2.jpg" data-cycle-title="beach2">
    <img src="http://malsup.github.com/images/beach3.jpg" data-cycle-title="beach3">
    <img src="http://malsup.github.com/images/beach4.jpg" data-cycle-title="beach4">
    <img src="http://malsup.github.com/images/beach9.jpg" data-cycle-title="beach9">
    <!--end slideshow-->
    </div>
    </body>
    </html>

    Is this supposed to be a WordPress site?  None of these images are found on the server.  Those folders don't exist either.
    <img class="first" src="mosspictures/DSCN0038.JPG" alt="">
       <img src="mosspictures/DSCN0040.JPG" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-3.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-4.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-5.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-6.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-1.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-2.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-3.jpg" alt="">
       <img src="wordpress/wp-content/themes/MarcMossTheme/image-4.jpg" alt="">
    Nancy O.

  • Help with scrolling screen

    I am writing a turn based strategy game in Java but I am unable to make a scrolling screen you can "move" your view of the game board around in.
    I can do every other aspect of the game myself, except for this.
    Examples of this on the internet are only for Applets(My program is a JFrame)
    Can anyone help?

    http://java.sun.com/javase/6/docs/api/javax/swing/JViewport.html
    Edit: Don't even start with the Swing fascist thing George ;-D
    Further edit: Here, i'll keep it neutral. http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.draw2d.doc.isv/reference/api/org/eclipse/draw2d/Viewport.html
    Message was edited by:
    jGardner

  • Help with Scrolling Text

    I am a big iMovie fan, but I have just had a problem while attempting to create a video game trailer. I have never experienced this before, and I do not know how to get by it.
    Ok. So I have 20 seconds of scrolling text, and about 28 lines of text. 247 characters with no spaces if you really want to know. I have 20 seconds of video behind it.
    Here's the problem: The last five lines of text are cut off. They are completely normal: Helvectia, Bold, 16 size, Left sided, white. There is no fancy text or images around it besides for the video behind it. (It played fine before with no video behind it).
    I've tried resizing the video, the text length, everything I can think of, and nothing works. Please help ASAP.
    I am running this on a MacBook, iMovie '08, the total time of video is 41 seconds. The video behind the scrolling text is a .mov file.
    Thanks!

    Note: The problem seems to have fixed itself. I do not know what the problem was, but I was messing around with the text and I noticed the missing lines were back. If anybody knows what the problem was, or wants to contribute to this post, please do so.
    Thanks!
    Contact: jomskylark [AT] gmail [DOT] com
    Message was edited by: sky_lark

  • Help with scrolling background

    i am following a tutorial and in it, when the Hero hits a
    wall he respawns somewhere on the screen. The problem with that
    was, that i didnt know where he would respawn. And In order to make
    the maze bigger i used a scrolling background and I couldnt figure
    out how to change the respawn location either. Here is the site
    that I am following the tutorial from
    http://www.emanueleferonato.com/2007/02/09/flash-game-creation-tutorial-part-51/
    Below is the code that I'm using
    onClipEvent (load) {
    yspeed = 0;
    xspeed = 0;
    wind = 0.00;
    power = 0.65;
    gravity = 0.1;
    upconstant = 0.75;
    friction = 0.99;
    onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
    xspeed = xspeed-power;
    if (Key.isDown(Key.RIGHT)) {
    xspeed = xspeed+power;
    if (Key.isDown(Key.UP)) {
    yspeed = yspeed-power*upconstant;
    if (Key.isDown(Key.DOWN)) {
    yspeed = yspeed+power*upconstant;
    xspeed = (xspeed+wind)*friction;
    yspeed = yspeed+gravity;
    _root.wall._y -=yspeed;
    _root.wall._x -=xspeed;
    _rotation = _rotation+xspeed;
    if (_root.wall.hitTest(_x, _y, true)) {
    xspeed = 0;
    yspeed = 0;
    _root.wall._x = 2500;
    _root.wall._y = 1681;
    Can anyone help me?

    there's no width property in a2.  use _width:
    animator = createEmptyMovieClip('animator',1);
    bg_1 = animator.attachMovie('bg_mc','bg_1',1);
    bg_2 = animator.attachMovie('bg_mc','bg_2',2);
    bg_1._x = -bg_1._width/2;
    bg_2._x = bg_2._width/2;
    speed = 1;
    cloudWidth = 380;
    animator.onEnterFrame = function () {
        bg_1._x -= speed;
        bg_2._x -= speed;
        if (bg_1._x <= -bg_1._width) bg_1._x = cloudWidth;
        if (bg_2._x <= -bg_2._width) bg_2._x = cloudWidth;

  • Need Help With An Application That Produces Live Images Within Tilelists

    At the moment I have an application which is meant to produce live thumbnail images of websites. Currently how it does this is a html component (myhtml) loads websites via it's location property changing from website to website and upon fully loading of each site a "snapshot" is taken of the html component and saved as a bitmap and applied as the source of an image corresponding to that particular site (abcnewsimage and bbcnewsimage). However I now need to insert these snapshots within the 'icon' properties of 2 array collections (myTilelistAArrayCollection and myTilelistBArrayCollection) which act as dataproviders to populate 2 tilelists (mtTilelistA and myTilelistB).
    Basically I need the same images to appear automatically within the tilelists the way they do in the 2 images as the snapshots are taken by applying the same bitmaps into the currently empty 'icon' properties of the 2 tilelists i.e. the icon of the ABC News Item of both array collections must be the same as the abcnewsimage and appear as it appears and the same for the BBC News Item icon being the same as the bbcnewsimage picture as that appears.
    It should look like the images are appearing in the tilelist at the same time as they are appearing in the regular images. What will I need to put into the icon properties to do this?
    I hope this makes sense and if anyone can help me out it would be much appreciated. :-)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="middle" backgroundColor="white" width="1024" height="768">
    <mx:Script>
    <![CDATA[
    import mx.graphics.ImageSnapshot;
    import mx.collections.*;
    private function takeSnapshot(event:Event) :void{
    var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(myhtml) ;
    switch(myhtml.location){
    case "http://abcnews.go.com/":abcnewsimage.source =
    new Bitmap(imageBitmapData);myhtml.location =
    "http://news.bbc.co.uk/";
    break;
    case "http://news.bbc.co.uk/":bbcnewsimage.source =
    new Bitmap(imageBitmapData);
    break;}
    private var myTilelistAArrayCollection:ArrayCollection = new ArrayCollection([{id:
    "ABC New Item", label:"ABCNews", icon:""},{id:
    "BBC News Item", label:"BBC News", icon:""}]);
    private var myTilelistBArrayCollection:ArrayCollection = new ArrayCollection([{id:
    "ABC News Item", label:"ABCNews", icon:""},{id:
    "BBC News Item", label:"BBC News", icon:""}]);
    ]]>
    </mx:Script>
    <mx:HBox x="10" y="10">
    <mx:Image id="abcnewsimage" width="100" height="100" scaleContent="true"/>
    <mx:Image id="bbcnewsimage" width="100" height="100" scaleContent="true"/>
    </mx:HBox>
    <mx:HTML id="myhtml" location="http://abcnews.com/" complete="takeSnapshot(event)" width="250" height="250" horizontalScrollPolicy="off" verticalScrollPolicy="off" x="10" y="118"/>
    <mx:TileList x="268" y="118" width="294" height="250" id="myTilelistA" dataProvider="{myTilelistAArrayCollection}" rowHeight="100" columnWidth="100"/>
    <mx:TileList x="570" y="118" width="294" height="250" id="myTilelistB" dataProvider="{myTilelistBArrayCollection}" rowHeight="100" columnWidth="100"/>
    </mx:WindowedApplication>

    Cheers Flex harUI. From what I can see superimage is mainly used to keep images at better quality. What I'm concerned with is having the images set within the 'icon' properties of the 2 tilelists AS they are set within their specific images. I've tried databinding by doing this for example:-
    {id:
    "ABC New Item", label:"ABCNews", icon:"{abcnewsimage.source}"},
    I hoped that would cause the icon field of the array collection to be populated by the source of the abcnewsimage so that as the abcnewsimage is populated by the snapshot that is taken of the abcnews website the icon field of the abc news item in the array collection would be too so that furthermore the tilelists would then be populated by these images. Basically as each snapshot appears in it's specfic image it needs to be loaded into the icon property of the array collection too. In the end the icons should look as if they are appearing within both the tilelists the same way as they are appearing within the images if that makes sense. The images should be loading within the tilelist one at a time as they are in the regular image components.

Maybe you are looking for

  • GL line item display FAGLL03 Offsetting Account Blank

    Dear All, In T-code FAGLL03 GL line item display offsetting account is coming Blank, how to get the offesetting account in GL line item display, what is the offsetting account Regards KSP

  • QuickTime Error 46 for Windows 7

    Can someone help me with the fix for QuickTime Error 46 for Windows 7???

  • A prgram called "my security shield keeps installing itself" i can't get rid of it

    I recently installed Homestead Website software. As soon as the software was installed a program called "my security shield" keeps giving pop-ups that say viruses are trying to affect email lists, and everything else. I clicked on the button that sai

  • Cound I change IPMP probing rate under solaris 10 u2 ?

    Hey, gurus! I have one question about IPMP. Because there are so many SPARC servers in the same LAN, So many ICMP packages were produced. But I want to reduce ICMP probe rate less than 2 seconds. In other word, I want to reduce ICMP network traffic o

  • Remodeling an InfoCube in BW 3.5

    Hallo experts! What is the best way to remodel dimensions of an productive InfoCube? What I know: - copy InfoCube A to InfoCube B - generate an exportDataSource on A - load data in B from A - delete data in A - remodel - generate an exportDataSource