How to make a infinite SMOOTH scrolling background?

This is what I have done:
var BGround1:Background=new Background();
var BGround2:Background= Background();
stage.addChild(BGround1);
stage.addChild(BGround2);
addEventListener(Event.ENTER_FRAME, moveScroll, false, 0, true);
function moveScroll(e:Event): void
                              BGround1.x -= scrollSpeed; 
                               BGround2.x -= scrollSpeed; 
                        if(BGround1.x <= -BGround1.width)
                            BGround1.x =BGround2.x + BGround2.width;
                              else if(BGround2.x <= -BGround2.width)
                            BGround2.x = BGround1.x + BGround1.width;
However, If I set scrollSpeed too high, the movement is not smooth. Is there any way to make a smooth animation?
Thanks in advance.
PS: I dont know how to put the code into code tag.

you can increase the framerate or decrease the scrollSpeed.  that's it.
but you'll achieve better performance by enabling the cacheAsBitmap property of BGround1 and BGround2:
var BGround1:Background=new Background();
var BGround2:Background= Background();
BGround1.cacheAsBitmap=true;
BGround2.cacheAsBitmap=true;
stage.addChild(BGround1);
stage.addChild(BGround2);
addEventListener(Event.ENTER_FRAME, moveScroll, false, 0, true);
function moveScroll(e:Event): void
                              BGround1.x -= scrollSpeed; 
                               BGround2.x -= scrollSpeed; 
                        if(BGround1.x <= -BGround1.width)
                            BGround1.x =BGround2.x + BGround2.width;
                              else if(BGround2.x <= -BGround2.width)
                            BGround2.x = BGround1.x + BGround1.width;

Similar Messages

  • How can I turn off smooth scrolling in Lion?

    I can't not turn off smooth scrolling.
    Actually, I don't want to use smooth scrolling in Lion OS.
    How can I turn off smooth scrolling in Lion?
    In case of Leopard, there is option on  "System Preferences, Appearance".
    Please help me.

    Apple > System Preferences > General > Use smooth scrolling: http://docs.info.apple.com/article.html?path=Mac/10.7/en/mchlp2472.html

  • How to make a chart/table a background object?

    How do I make that grid into a background objective so that I can draw lines and similar things on top of it without it moving? Intending to use it as a coordinate system/grid/plane (or whatever it is called in English, but the thing refuses to stay still whatever I do to it. :/
    Also, sorry for my bad English.
    Thanks!

    click on table > Inspector > Wrap (3rd tab) > Object Placement > Floating
    Menu > Format > Advanced > Move Object to Section Master
    Peter

  • How to make floating image with dim background

    hi guys, i would like to know how to make a floating image and the background will dim? like for example when you click a thumbnail, the bigger version of that image will pop up on the same page and will have a dim background? can someone point me to a tutorial? any help would be appreciated, thanks in advance!

    Hi,
    If you look at the tutorials in fireworks such as changing images/rolover images you will start to get an understanding.
    Cheers

  • How to make image stay still in background while content object scrolls over and change the background image?

    I'm fairly new to muse, so i bet it is a simple explanation to this. And don't know how to explain it in a good way. But i want the same effect as on this site http://themeforest.net/item/astlavista-multipurpose-muse-template/full_screen_preview/6459 513?ref=designrazzi . The photos stand still and changes while the blue/green content box slides over. Help anyone?

    I know how I scale the image to fill the browser. The effect I'm looking for is the transition from one image to another, as in http://themeforest.net/item/astlavista-multipurpose-muse-template/full_screen_preview/6459 513?ref=designrazzi. When the green/blue box with "services" scrolls over the screen, the image change from the one with the plane, to the one with the bike.

  • How can I add a smooth scrolling progress bar? Or make one?

    Hey,
    If you have seen the QuickLook Progress Bar, it moves ever slowly and smoothly, with the little circle showing progress. I know this is called a Scrobble Bar, but I would really like a Link/Code to implement that same one, or one like Windows Media Player 11 (the 2px high, smooth one) **ahhhp, Windows :-(** If anyone can help me.....I would appreciate it.

    Hi,
    I would have thrown a prompt to the user in the renderasJpeg
    function and removed it in last line of convertToImage function.
    Isn't this what you want?
    Hope this helps.

  • How to make animation loop smoothly

    http://dietzclublambs.com/
    The Flash on this site shows scrolling pictures on the home
    page. When it comes to the end, you'll see it stops abruptly and
    restarts at the beginning.
    Any suggestions for a way to make it look like a seamless
    transition from the end back to the beginning and keep the images
    continuously scrolling?

    You need to create a duplicate of the row of images and on
    the last frame, position the images as they are in the first frame.
    You may need to nudge the duplicate slightly to get a smooth
    transition but the general idea is to utilize 2 sets of images so
    that the last and first image seem to be back to back. Hope this
    makes sense.

  • Palm tx: how to make five way button scroll down a page at a time

    i knew how to do this once, but have forgotten:  on my palm tx, how do i make the five way button scroll down a page at a time?
    thank you,
    kj
    Post relates to: Palm TX

    Yes, you'll simply need to open up your docs-to-go program and once you've accessed the program, select the document your needing to view. After selecting the document using the stylus tap in the upper left corner of the screen and you'll see a drop down menu populate (from the File option), Next select preferences and lastly, place a check mark next to the page scroll on Five-Way device.
    Post relates to: Treo 800w (Sprint)

  • How to make audio (within a video) background music?

    Hi: I have Adobe Premiere Elements 7.0. I have video of a guy singing that is three minutes long that I would like to use as the background music for a video montage. The video montage itself is about 3 minutes as well. I would like to start the video montage with the guy singing, then make the rest of the montage have just the background music of the guy singing (without the video of him). How can I do this? Thanks.

    That's how I'd do it, too.
    Another option might be to just plop the montage on Track 2 at the appropriate starting point and not do anything with Track 1 (the guy singing). The video from Track 2 would be used instead of the Track 1.
    Not sure what would happen with the sound though - don't remember if Track 2 audio overlays Track 1 or if they get mixed
    Also not sure what the OP wants... is the guy singing supposed to be "background" as in you can still hear the montage audio with the singing as light background, or whether the guy singing is the *only* audio.

  • How To make a custom ScrollPane/scroller Help.

    I want to make a MC that holds various Data such as textfields images maybe a video, ect just basic content, so i want to put that into a MC and be able to scroll it. But i cant figure out how to do this, no tutorials on the internet. And i dont want to use the UIScroller and Scrollpane components as they are highly unnatractive.. It is for a touch enabled device so maybe a gesture could be used? But im sure a Mouse Event would work, Can some one help me out or point me in the right direction?
    Thanks in advance.

    Your best bet for finding tutorials is Google.  Here's one result for a search using "AS3 movieclip scroller" that shows the basics.
    http://tutorials.flashmymind.com/2009/02/movieclip-scroller/

  • Help on how to make an infinite loop with the same space on all images

    HI:
    I made a movie clip with infinite  loop in which there are images that move from right to left something simple like a marquee, and each image has a blank space between  them, but between last and first image there is a more space, how I can do to  make all images have an equal space between each one and that the motion never stops.

    Thanks for your time and answers my friend, but I'm still not be able to achieve what I want, I forgot to tell that I'm doing this by layers, let's say, I have 5 images, (in fact I have like 50 images converted to movie clip symbols) each image has it's own layer, layer 1, layer 2, layer 3, layer 4, layer 5, then I put a 200 frame motion tween on all layers at 30 fps, then I arranged layer 1 on the first frame to the frame 200, the second layer from frame 50 to frame 250, third layer from frame 100 to frame 300, fourth layer from frame 150 to frame 350, and fifth layer from frame 200 to frame 400, by this I mean I put a 50 frame of space on each image but if you can see, the last image has a duration from frame 200 to frame 400, and there's nothing on frame 250 where it is supposed to be another image to match the same blank space of all the others, the movie clip restarts on the frame 400, and there's a 150 frames of blank space between the last image and the first image, I put the gotoandplay on the frame 250, but it abruptly restarts the movie.
    Is there another way to do this ?
    Am I doing something wrong ?
    Please I really really need help on this.
    Thanks

  • How to make animations float with transparent background

    I am taking a graduate course in adv. web design for an ed
    tech program at a university. Neither my instructor nor anyone else
    in my class knows how to get Flash animations to have a transparent
    background, or even if this is possible. On behalf of us all, I am
    wondering if it is possible to create a Flash animation without a
    background--or with a transparent background, and then superimpose
    it onto a web page so that the web page's background shows through
    all but the animated part. We are using Flash 8. If it is possible,
    can someone please tell us how to do it? I have seen web pages
    where the animations float over the web page. Are these animations
    made with Flash or with another program? Thank you!

    Yes, it's easy, but haven't done it for a while, and not
    since all the new ActiveX stuff on MS IE requires Java Script to
    make the dotted outline go away.
    To do it well takes a combination of Flash with the
    publish-settings HTML Window Mode set to Transparent Windowless,
    and tightly-designed CSS with your animation positioned in a div
    that lies or overlays the exact place on the HTML page where you
    want it. You can even have it scale to the entire visible window,
    which can be quite cool. I did one for the holidays with snow
    falling over an HTML page. It can block lnks from working, though,
    so you can have the div (and animation) disappear when the
    animation is done.

  • How to make website links out of background jpeg (co-ordinate tracked clicks)

    I am an illustrator working on my website that i have drawn out by hand and scanned in to a jpeg.  it is set to fit the whole screen, and i have drawn out where i want the navigation links.  how do i get dreamweaver to use co-ordinate clicking to link my webpages together?
    any help would be much appreciated!

    First just so you know, images are a very clumsy way of creating site navigation.  Each time you add new pages to your site, you must re-craft your menus in your graphics editor which gets old in a hurry.
    Second, you can't link background images to anything as they do not exist in the HTML markup.  You would need to slice up your menu items and insert them as regular images into your HTML page.  But as I said above, image-based menus are not efficient.  You would do well to use Text links and style them with CSS.  This allows for quick editing of menus directly from DW and is web friendly for search engines, translators and screen readers.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to make Spry menu and submenu backgrounds different

    Hi all. I have a horizontal spry menu bar, and i'm using a gradient image for the background of the main menu, but I want the submenu to just be a solid color. I figure i should just be able to use css for this solid BG, but I can create an image no problem if need be. I just think it looks unprofessional to have multiple segments of a horizontal gradient stacked vertically. I know this is possible, the second to last example on this link demonstrates but doesn't explain:
    http://labs.adobe.com/technologies/spry/samples/menubar/MenuBarSample.html
    I would greatly appreciate any available help on this subject!  Thanks again!

    Thanks for asking, no that is not my complete css file. Those are only *additional* lines to place adjacent to existing styles in your "SpryMenuBarHorizontal.css", but in each case as the next style, in the location I have indicated. Here, I'll put my complete file here for you:
    @charset "UTF-8";
    /* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    LAYOUT INFORMATION: describes box model, positioning, z-order
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
         margin: 0;
         padding: 0;
         list-style-type: none;
         font-size: 100%;
         cursor: default;
         width: auto;
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
         z-index: 1000;
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
         margin: 0;
         padding: 0;
         list-style-type: none;
         font-size: 100%;
         position: relative;
         text-align: left;
         cursor: pointer;
         width: 8em;
         float: left;
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
         margin: 0;
         padding: 0;
         list-style-type: none;
         font-size: 100%;
         z-index: 1020;
         cursor: default;
         width: 8.2em;
         position: absolute;
         left: -1000em;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
         left: auto;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
         width: 8.2em;
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
         position: absolute;
         margin: -5% 0 0 95%;
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
         left: auto;
         top: 0;
    DESIGN INFORMATION: describes color scheme, borders, fonts
    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
         border: 1px solid #CCC;
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
         display: block;
         cursor: pointer;
         background-color: #EEE;
         padding: 0.5em 0.75em;
         color: #333;
         text-decoration: none;
    ul.MenuBarHorizontal ul a {
         background-color: yellow;
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
         background-color: #33C;
         color: #FFF;
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
         background-color: #33C;
         color: #FFF;
    ul.MenuBarHorizontal ul a.MenuBarItemHover, ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal ul a.MenuBarSubmenuVisible {
         background-color: green;
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenu
         background-image: url(SpryMenuBarDown.gif);
         background-repeat: no-repeat;
         background-position: 95% 50%;
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
         background-image: url(SpryMenuBarRight.gif);
         background-repeat: no-repeat;
         background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
         background-image: url(SpryMenuBarDownHover.gif);
         background-repeat: no-repeat;
         background-position: 95% 50%;
    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
         background-image: url(SpryMenuBarRightHover.gif);
         background-repeat: no-repeat;
         background-position: 95% 50%;
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
         position: absolute;
         z-index: 1010;
         filter:alpha(opacity:0.1);
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
         ul.MenuBarHorizontal li.MenuBarItemIE
              display: inline;
              f\loat: left;
              background: #FFF;
    .fleft {
         clear: none;
         float: left;
    The idea with putting the new styles *after* the original styles is that they are logically similar to but 'sub' styles to existing styles. In fact, you could probably put them way at the bottom, but if you wanted to edit them you might not find them again easily. I was trying to keep similar style rules together.
    Z

  • How to make a program run in background?

    Is there any ways to make an invisible program with java? a program that is running in background but the user cannot see it and it's not in the Start bar and the user cannot close it.

    There are also 3rd party software that lets you install a java program as a service in winnt/2k/xp so that you can start/stop it from the service manager, doesnt even matter if the java program is gui based or not, as there are options (in win2k at least) in the service manager that allows the program to interact (think show gui) or not...one software called JNT comes to mind..
    Anyway, if you're using win98/me equivalent, then just use javaw.exe like suggested by previous posters.

Maybe you are looking for

  • Why can't I see my android app on google play on phone?

    I've built a native android app which works fine on a tablet, but I can't see it on a phone App Store, any idea why?

  • Is there a way to remember directory on Final Cut export?

    Every time I go to export a clip, it starts at the root directory.  I have to navigate down to the folder where I'm exporting.  Is there a way for it to remember where I'm saving the clips?

  • Oracle Test Manager - Import of Manual Tests - Fails with ORA-12520:

    Hi, This issue occurs when we are trying to import manual tests into the Oracle Test Manager. The import fails when we try to import more than 300 records. The error message in the log is as shown below: Driver's SQLSetConnectAttr failed ORA-12520: T

  • How do I set the 4k resolution?

    I have a MacPro with dual D700 and 6xDP and HDMI1.4. The latter is limited to 4k30 (UHD24-30 and C4K24) by the standard. I have connected this port to a Samsung 40HU6950 4k TV that supports all four HDMI 4k modes. The MP is defaulting to C4K and thus

  • My Safari won't load any page.

    Hi. I'm amsuherdi1111.     Recently my safari won't load any page/website. My safari can start loading a website after I restart my mabook pro. And then after a day, the safari won't load any website again. What might cause this to happen? Another ap