# Image does not load

**URL:** <https://forum.kirupa.com/t/image-does-not-load/248786>\
**Category:** Uncategorized\
**Created:** [January 11, 2008, 3:42pm UTC](https://forum.kirupa.com/t/image-does-not-load/248786 "2008-01-11T15:42:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kagamushu](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kagamushu](https://forum.kirupa.com/u/kagamushu)\
**Post date:** [January 11, 2008, 3:42pm UTC](https://forum.kirupa.com/t/image-does-not-load/248786/1 "2008-01-11T15:42:12Z")

</div>

Hello,  
I have a scroll panel with thumbnails, when a thumbnail is clicked, the corresponding video is loaded in the player, and another image should appear beside it. I made a list in xml containing the thumbnails, videos, and the images.  
When i click on a thumbnail, the proper video loads but the image does not and i get this the following error:

(TypeError: Error #1034: Type Coercion failed: cannot convert “image” to flash.net.URLRequest.  
at imaktion12\_fla::MainTimeline/playOnClick()  
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()  
at flash.events::EventDispatcher/dispatchEvent()  
at com.afcomponents.common::ItemData/setEvent()  
at com.afcomponents.common::AfImage/com.afcomponents.common::dataEvent(),

Here is part of my xml code:  
\<content\>   
\<item\>  
\<description\>image\</description\>  
\<path\>thumbnail\</path\>  
\<data\>video\</data\>  
\<type\>\</type\>  
\</item\>

Here is my AS:

import fl.video.VideoEvent;  
import flash.events.MouseEvent;  
import com.afcomponents.scrollpanel.ScrollPanelEvent;

function loadComplete(event:ScrollPanelEvent){  
myScroll.addGenericItemEventListener(MouseEvent.CLICK, playOnClick);  
video1.source = myScroll.getSelectedItem().data;  
imageLoader.source = myScroll.getSelectedItem().description;  
}  
myScroll.addEventListener(ScrollPanelEvent.XML\_LOAD\_COMPLETE, loadComplete);

function playOnClick(event:MouseEvent) {  
video1.source = event.target.data;  
var imageLoader:Loader = new Loader();  
imageLoader.load(event.target.description);  
addChild(imageLoader);  
imageLoader.y = 160;  
imageLoader.x = 22;  
}

function nextMovie(event:VideoEvent) {  
myScroll.selectNextItem();  
video1.source = myScroll.getSelectedItem().data;  
}  
video1.addEventListener(VideoEvent.COMPLETE, nextMovie);

thanks
