# Loading a video using the URL method

**URL:** <https://forum.kirupa.com/t/loading-a-video-using-the-url-method/309122>\
**Category:** Uncategorized\
**Created:** [May 7, 2010, 1:59pm UTC](https://forum.kirupa.com/t/loading-a-video-using-the-url-method/309122 "2010-05-07T13:59:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navarone](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Navarone](https://forum.kirupa.com/u/Navarone)\
**Post date:** [May 7, 2010, 1:59pm UTC](https://forum.kirupa.com/t/loading-a-video-using-the-url-method/309122/1 "2010-05-07T13:59:10Z")

</div>

I am trying to load a video using a URL, and I keep getting this error:

```auto

VideoError: 1005: Invalid xml: URL: "http://pegasus.dev.webriverinteractive.com/API/Resource.ashx?ResourceID=16&FLVPlaybackVersion=2.1" No root node found; if url is for an flv it must have .flv extension and take no parameters
    at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

```

My flash code is below. I made sure that the swf is in the same directory folder to avoid the sandbox security issues. But I am not sure how to correct this error. Is there something else in the string that I need to add?

```auto

trace(FLVPlayback.VERSION);//2.1.0.14

import flash.display.MovieClip;
import fl.video.*;

var fv:String=root.loaderInfo.parameters.vars;
output.appendText(fv + " : " + root.loaderInfo.parameters.vars + "
");//working

var myVideo:FLVPlayback;
myVideo = new FLVPlayback();
myVideo.x=0;
myVideo.y=0;
myVideo.width = 640;
myVideo.height = 360;

//myVideo.source = "videos/Webriver_Video.mp4";
myVideo.source = "http://pegasus.dev.webriverinteractive.com/API/Resource.ashx?ResourceID=16"
myVideo.skin = "SkinOverPlaySeekMute.swf";
myVideo.skinBackgroundColor = 0x666666;
myVideo.skinBackgroundAlpha = 0.85;
myVideo.skinAutoHide = true;
addChildAt(myVideo,0);

myVideo.addEventListener(VideoEvent.COMPLETE, completePlay);

//use this function to jump to a new frame or loop
function completePlay(event:VideoEvent):void {
    //myVideo.alpha=0.2;
    //myVideo.play();
}

```
