A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Scrolling movieclip/background

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2006
    Posts
    93

    Scrolling movieclip/background

    Right well I've done a lot of searching and only found things like scrolling around an image, putting scroll bars in for websites, and things of that nature. I also found the spaceship tut where the ground scrolls (which is what I'm looking for), but thats dependant on the spaceship moving, and I couldnt manage to just always make it scroll

    Basically, I have a movieclip of clouds, away from the edge, and exactly the width of my scene. I want them to continuosly scroll/loop from left to right.

    Any ideas?

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    Just do what they do in the ship tutorial (assuming I am thinking of the one you're thinking of.) Make a cloud image, and then paste it around a bunch or w/e you want to do. Copy an entire screen width of it, and then paste it directly to the right of it, making sure that they blend and you can't see and screwed pixels or jumps or things out of ordinary. Then just have it move to the left however much you want at a time. When it's _x is <= -Stage.width, reset the _x to 0. Hope I explained it right.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    Or if you don't want to use actionscript, than you can always animate the clouds with a motion tween inside your cloud mc. Place the clouds to the right of the screen, and animate it to scroll to the left.Thats it, this animation will loop automatically unless you tell it otherwise (through actionscript).

    However I'm not sure if this will lower the games performance more than the actionscript method (mentioned by ImprisonedPride)
    Viza
    Last edited by Viza; 12-01-2006 at 04:28 AM.

  4. #4
    Member
    Join Date
    Nov 2006
    Posts
    93
    Thanks imprisoned but it wasnt working very well so I decided to make a few clouds with motion tweens...I see Viza has just posted that method.

    It seems to run okay, if my games performance is lower at the end of creating my background then I will stop them from animating, or go about it in a different way.

    Thanks guys.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center