# Screen wrapping problem

**URL:** <https://forum.kirupa.com/t/screen-wrapping-problem/204458>\
**Category:** Uncategorized\
**Created:** [October 19, 2006, 10:12pm UTC](https://forum.kirupa.com/t/screen-wrapping-problem/204458 "2006-10-19T22:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mischa](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Mischa](https://forum.kirupa.com/u/Mischa)\
**Post date:** [October 19, 2006, 10:12pm UTC](https://forum.kirupa.com/t/screen-wrapping-problem/204458/1 "2006-10-19T22:12:00Z")

</div>

Hi there!

I’m realy stuck with the following problem :

I’ve created a emptyMovieclip as the “holder” of a variabel amount of movies.  
The xposition of the holdermovie responds to the \_xmouse.

Now i want to let the movie “wrap” arround the screen

So when a nested movie moves outside of the screen on the left side, i change the xposition of the that nested movie in the holder to the position of the last nested movie + the moviewidth of the nested movie.

This way the width of the holder stays the same but the problem is that the Xposition of the holdermovie does not change.

I’m i thinking wrong or should the Xposition of the holder be deterimend by the first nested movie.

* * *

[COLOR=darkred]// creating and filling the holder[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]\_root.createEmptyMovieClip(“itemHolder1\_mc” , 0);[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]for(var i=0;i\<itemAmount;i++){[/COLOR]  
[COLOR=darkred]var name:String = “item” + i + “\_mc”;[/COLOR]  
[COLOR=darkred]\_root.itemHolder1\_mc.attachMovie(“item”, name, (i+2));[/COLOR]  
[COLOR=darkred]\_root.itemHolder1\_mc[name].\_x = XposStart;[/COLOR]  
[COLOR=darkred]\_root.itemHolder1\_mc[name].\_y = itemYpospics;[/COLOR]  
[COLOR=darkred]}[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]// chaning the xpos of the nested movie[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]if (\_root.itemHolder1\_mc.\_x \< -(itemDistance + itemWidth)) {[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]trace (\_root.itemHolder1\_mc.\_width) // returns 1041[/COLOR]  
[COLOR=darkred]trace (\_root.itemHolder1\_mc.\_x) // returns -151.4[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]\_root.itemHolder1\_mc[“item”+whoisLeft+"\_mc"].\_x = (\_root.itemHolder1\_mc[“item”+whoisRight+"\_mc"].\_x + (itemWidth + itemDistance));[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]trace (\_root.itemHolder1\_mc.\_width) // returns 1041[/COLOR]  
[COLOR=darkred]trace (\_root.itemHolder1\_mc.\_x) // returns -151.4 (and going down)[/COLOR]  
[COLOR=darkred][/COLOR]  
[COLOR=darkred]}[/COLOR]

* * *

any help is greatly **appreciated**!
