Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3870992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:46:51+00:00 2026-05-19T21:46:51+00:00

The project I’m working on has a massive background image (800px wide by 2585px

  • 0

The project I’m working on has a massive background image (800px wide by 2585px tall) that slowly scrolls upwards.

Before, I was using the code at: http://www.ilike2flash.com/2010/08/endless-scrolling-background-in-as3.html

I modified the code to scroll upwards, but in addition to having a weird intermittent bug that occasionally displays a pixel-tall blank line after the image and before looping the next, it really doesn’t seem to handle dynamic loading well (I’ve tried using several different preloader scripts and it breaks all of them), something that may not have been an issue with the initial implementation but is now that I’m using a monstrously huge image.

Thus, my question:

a. Is there another bit of free, Flash-based infinite scroll code floating around that has support for lazy-loading background objects (Say, the existing background chopped in 6)?

b. If not, any idea how I could modify the above link to do so?

Thanks! My AS3 is as follows:

stop();

//The speed of the scroll movement.
var scrollSpeed:uint = 2;

//This adds two instances of the movie clip onto the stage.
var s1:ScrollBg = new ScrollBg();
var s2:ScrollBg = new ScrollBg();
addChild(s1); 
addChild(s2);
setChildIndex(s1, 0);
setChildIndex(s2, 0);

//This positions the second movieclip next to the first one.
s1.y = 0;
s2.y = s1.height;

//Adds an event listener to the stage. 
stage.addEventListener(Event.ENTER_FRAME, moveScroll); 

//This function moves both the images to top. If the first and second 
//images goes past the top stage boundary then it gets moved to 
//the other side of the stage. 
function moveScroll(e:Event):void{
  s1.y -= scrollSpeed;  
  s2.y -= scrollSpeed;  

  if(s1.y <= -s1.height){
     s1.y = s1.height - scrollSpeed;
  }else if(s2.y <= -s2.height){
     s2.y = s2.height - scrollSpeed;
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:46:52+00:00Added an answer on May 19, 2026 at 9:46 pm

    howdy ændrew
    the link has about 15 lines of code.
    it creates two instances of the object, it then moves moves both 1px every frame and checks if the first clip is out of the view, at which point it moves the movieClip over to the edge of the other clip. There’s not a lot of room for error… but if I had to point it out out, I’d say it’s right here

    if(s1.x < -s1.width){
      s1.x = s1.width;
    }else if(s2.x < -s2.width){
      s2.x = s2.width;
    }
    

    should be: (notice the <= instead of <)

    if(s1.x <= -s1.width){
      s1.x = s1.width;
    }else if(s2.x <= -s2.width){
      s2.x = s2.width;
    }
    

    this removes the few pixels gap between the movieclips

    As far as dealing with loading a big asset goes, just add the scroll function once it has loaded. you can look for a sample at http://drawlogic.com/2007/09/20/howto-using-loaders-in-as3/ but there are bunch of others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Project: I am having a button that toggles the column length from 3 to
My project has some references. One of them has no path. I can't view
My project has multiple lists, such as People, Jobs, Ranks. For each list, I
My project is not running on xcode3.2 with ios SDK3.2 but working fine in
Project Description: I have to make an application in android which gets the Latitude
Project has_many :items Item belongs_to :project I'm trying to get the projects sorted by
Project Euler problem 14: The following iterative sequence is defined for the set of
Project name : pro Project location : /home/cha0s/pro/ Applications location : /home/cha0s/pro/apps/ , where
My project works troubleless in internet explorer but in firefox or other browsers it
Our project uses XJC to generate Java classes from an XSD. I'm using JAVA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.