Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default horizontal scroll

    I have a small flash movie that the user can control with their left / right
    arrow keys.

    I want to be able to stop the user scroll past the end of an image that I
    have in there. How do I limit it.

    The code i am using at the moment is as follows.

    onClipEvent(enterFrame) {

    if(Key.isDown(Key.LEFT)) {
    this._x--;
    }
    if (Key.isDown(Key.RIGHT)) {
    this._x++;
    }
    }



    nigel Guest

  2. Similar Questions and Discussions

    1. horizontal scroll Bar
      Hi, I'm new in using Flash Mx and I need somebody help me to create an horizontal scroll bar. I'm making a movie with slide pictures using a mask...
    2. Horizontal Scroll Bar in Layer
      Hi all I am adding content into a layer and want to have a vertical scrollbar, to enable the user to scroll the layer and view content which...
    3. Horizontal Scroll Issue with CSS
      I have an issue with a horizontal scroll at www.armissions.org/index2.php. My CSS document looks as follows: /* CSS Document */ #nav {...
    4. What Web Control Allows you to Scroll Virtical and Horizontal
      Hi all, Other than IFrame or Frames What control can scroll vertical and horizontal Thanks
    5. Horizontal scroll bar, with images?
      Try using Adobe Photoshop. There is a pluggin called Web Photo Gallery, it definatly makes life easy for a novice (that i am). Thanks, Chris...
  3. #2

    Default Re: horizontal scroll

    nigel wrote:
    > I have a small flash movie that the user can control with their left / right
    > arrow keys.
    >
    > I want to be able to stop the user scroll past the end of an image that I
    > have in there. How do I limit it.
    >
    > The code i am using at the moment is as follows.
    >
    > onClipEvent(enterFrame) {
    >
    > if(Key.isDown(Key.LEFT)) {
    > this._x--;
    > }
    > if (Key.isDown(Key.RIGHT)) {
    > this._x++;
    > }
    > }
    >
    >
    >

    Why not just use the built-in ScrollPane UI component? No code needed at
    all then.

    Benny Cemoli Guest

  4. #3

    Default Re: horizontal scroll

    I did the scroll on [url]www.emasavahl.com[/url] based on the mouse position relative
    to the screen, but it can easily be done with a KeyPress command. The
    limiting factor, as you put it, is the _x coordinate of the graphic on the
    screen. As long as object._x is less than 10, it can scroll right, and as
    long as object._x is greater than (-1*(object._width - stage._width)) it can
    scroll right. (I think the concept's correct -- not the code -- someone can
    correct me or I will march back with my tail between my legs and put the -1
    where it belongs.)

    basically, keep the left edge of the object within the screen (I use x =
    10), and keep the right edge of the object in the screen, by subtracting the
    screen width from the object width, and multiplying by -1. The code was
    pretty short.

    "nigel" <nigel@nigel.com> wrote in message
    news:bm3m78$fva$1$8300dec7@news.demon.co.uk...
    > I have a small flash movie that the user can control with their left /
    right
    > arrow keys.
    >
    > I want to be able to stop the user scroll past the end of an image that I
    > have in there. How do I limit it.
    >
    > The code i am using at the moment is as follows.
    >
    > onClipEvent(enterFrame) {
    >
    > if(Key.isDown(Key.LEFT)) {
    > this._x--;
    > }
    > if (Key.isDown(Key.RIGHT)) {
    > this._x++;
    > }
    > }
    >
    >
    >

    J-Dogg Guest

  5. #4

    Default OOPS: horizontal scroll

    correction: should read:
    > As long as object._x is less than 10, it can scroll right, and as
    > long as object._x is greater than (-1*(object._width - stage._width)) it
    can
    > scroll LEFT.
    "J-Dogg" <j-dogg@quitspammingme.net> wrote in message
    news:Wdehb.26453$Sn1.15597@bignews4.bellsouth.net. ..
    > I did the scroll on [url]www.emasavahl.com[/url] based on the mouse position relative
    > to the screen, but it can easily be done with a KeyPress command. The
    > limiting factor, as you put it, is the _x coordinate of the graphic on the
    > screen. As long as object._x is less than 10, it can scroll right, and as
    > long as object._x is greater than (-1*(object._width - stage._width)) it
    can
    > scroll LEFT. (I think the concept's correct -- not the code -- someone can
    > correct me or I will march back with my tail between my legs and put
    the -1
    > where it belongs.)
    >
    > basically, keep the left edge of the object within the screen (I use x =
    > 10), and keep the right edge of the object in the screen, by subtracting
    the
    > screen width from the object width, and multiplying by -1. The code was
    > pretty short.
    >
    > "nigel" <nigel@nigel.com> wrote in message
    > news:bm3m78$fva$1$8300dec7@news.demon.co.uk...
    > > I have a small flash movie that the user can control with their left /
    > right
    > > arrow keys.
    > >
    > > I want to be able to stop the user scroll past the end of an image that
    I
    > > have in there. How do I limit it.
    > >
    > > The code i am using at the moment is as follows.
    > >
    > > onClipEvent(enterFrame) {
    > >
    > > if(Key.isDown(Key.LEFT)) {
    > > this._x--;
    > > }
    > > if (Key.isDown(Key.RIGHT)) {
    > > this._x++;
    > > }
    > > }
    > >
    > >
    > >
    >
    >

    J-Dogg Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139