Object has no method 'scrollTo'

I’m implementing an image viewer using carousel view.
I’m not able to have scrollTo function working…keep on getting error message “Uncaught TypeError: Object # has no method ‘scrollTo’”.

function openCarousel(){
		dhx.ui({
			modal:true,
			view:\"window\",
                        id:\"mycarousel\",
                        width:(document.getElementById('groupBox')).clientWidth-2,
                        height:(document.getElementById('groupBox')).clientHeight-2,
			body:{
				view:\"carousel\",
				cols:[    
                                            ".createCarousel()."

                                        ],
                                panel:{align:\"bottom\"}
			},
                        head:{ view:\"toolbar\", type:\"SubBar\", elements:[

				{ view:\"button\", label:\"Close\", click:\"closeModal\", align:\"right\", inputWidth:80 }
			]},
			top:5, 
			left:5,
                        scroll: true
		});
 
		function img(obj){
			return '<div class=\"content\"><img src=\"'+obj.src+'\" border=\"0\" style=\"max-height:98%;max-width:98%;margin:8px 8px 15px 8px;\" ondragstart=\"return false\"/></div>'
		}
	}

Can you help???

ps: createCarousel function is a PHP script reading a list of images from a folder.

if you are calling scrollTo method for the window $$(“mycarousel”).scrollTo(…), you will be the error. Carousel in your example does not have any id. So, if there is only one carousel, it has id “carousel1”:

$$(“carousel1”).scrollTo(…);

However, it will be better to the show() method for views inside causel. In this case, the scroll position will be calculated automatically and active marker will be highlighted:

$$(“img_2”).show(); // “img_2” - id of the view inside carousel