12 Replies Latest reply on Feb 5, 2013 4:56 AM by ♥Schrene

# Tiling/repeating images

I could not find another topic on this, nor could I find it via search engine or YouTube.  Sorry if there is already a solution that I've missed.

I have an image moving across the stage and I would like to know how to have it continuously repeat horizontally.  It's meant to be part of a moving landscape.  Thank you in advance for any insight anyone might have to offer.

• ###### 2. Re: Tiling/repeating images

Thank you for the suggestion.  What I actually mean by repeating horizontally, though, is tiling continuously left/right?  That way, if I have a moving landscape, say the land mass in the distance would be tiled and can move continuously without breaking.  Thanks again.

• ###### 3. Re: Tiling/repeating images

Yes my earth image goes from right to left horizontally... it is continuously moving landscape..

Perhaps I am not understanding what you are referring to as a tiled image..??

Here is another sample of a continuously moving landscape:

This one moves from left to right and is more simple.

• ###### 4. Re: Tiling/repeating images

Thank you very much.  Perhaps I didn't understand.  I meant that I wanted it to travel across the entire width of the stage, more like this second example you've shown me.  Perhaps, though, the first one works the same way but you defined the area as smaller than the stage?  Sorry if I misunderstood.

The new one looks just like what I need, but can I have multiple overlapping images moving independently and repeated horizontally like this one?

Thanks again.

• ###### 6. Re: Tiling/repeating images

Yes, that's much more like it.  Thank you.  Can only the background be tiled as such or could you, say, make the water a separate image and tile that to move independently and continuously, too?  Thanks.

• ###### 7. Re: Tiling/repeating images

Yes you could make the water move separately and continuously you would just need to make a separate image of the water..

• ###### 8. Re: Tiling/repeating images

Thank you very much for all of your help.  I'm going to try to get it to work.

• ###### 9. Re: Tiling/repeating images

Thanks,

♥Schrene

• ###### 10. Re: Tiling/repeating images

Thank you again.  Forgive me, but I'm having some trouble differentiating what parts of the code apply to what.  If I replace the background image with my own which is much smaller, it will no longer work seamlessly.  I tried messing around with the variables, but I wasn't sure what all of them did and everything I touched ruined it.  If I have a stage of 750px x 400px and a background image I want to slide seamlessly with dimensions of 512px x 512px, how should I edit the code to work the same as yours does?  Thank you.

• ###### 11. Re: Tiling/repeating images

Your background image (the scenery) needs to be the height of Stage and at least twice as wide as the Stage.

If you want to replace my image with yours you would need to look at the dimensions of that image and use an image with the same dimensions.

Message was edited by: ♥Schrene

• ###### 12. Re: Tiling/repeating images

If your image is not twice as wide as the Stage you can combine two or more of them together in a Symbol or by grouping the elements in a div just like I did in this sample:

The grass is two images combined in a div... and the water is two images combined in a Symbol.