# Probem in Scrolling dynamically created MC

**URL:** <https://forum.kirupa.com/t/probem-in-scrolling-dynamically-created-mc/252500>\
**Category:** flash\
**Created:** [February 20, 2008, 6:40pm UTC](https://forum.kirupa.com/t/probem-in-scrolling-dynamically-created-mc/252500 "2008-02-20T18:40:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BhavikShah](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@BhavikShah](https://forum.kirupa.com/u/BhavikShah)\
**Post date:** [February 20, 2008, 6:40pm UTC](https://forum.kirupa.com/t/probem-in-scrolling-dynamically-created-mc/252500/1 "2008-02-20T18:40:33Z")

</div>

Hi Friends,

I’ve made xml gallery which has simple slideshow in starting and after clicking on that its takes to the xml loaded scrolling mc which is not scrolling properly like the tuts here in Kirupa. I’ve following code for that

function ScrollingCollectionTimeLine(target:MovieClip, speed:Number, dir:Number) {  
var mousePercent:Number = page\_collections.\_xmouse/725;  
//trace(mousePercent);  
var mSpeed:Number;  
if (dir == 1) {  
mSpeed = 1-mousePercent;  
} else {  
mSpeed = mousePercevnt;  
}  
target.destX = Math.round(-((target.\_width-725)_mSpeed));  
target.onEnterFrame = function() {  
if (target.\_x == target.destX) {  
delete target.onEnterFrame;  
} else {  
target.\_x += Math.ceil((target.destX-target.\_x)_(speed/100));  
}  
};  
}

I am also attaching my [fla](http://www.r-interactive.net/jdj/jewel.zip) and swf file here. Any help will be highly appreciated and many thx in advance.

Regards
