# Textfield url

**URL:** <https://forum.kirupa.com/t/textfield-url/330702>\
**Category:** Uncategorized\
**Created:** [March 2, 2013, 6:45pm UTC](https://forum.kirupa.com/t/textfield-url/330702 "2013-03-02T18:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonassus](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bonassus](https://forum.kirupa.com/u/bonassus)\
**Post date:** [March 2, 2013, 6:45pm UTC](https://forum.kirupa.com/t/textfield-url/330702/1 "2013-03-02T18:45:52Z")

</div>

I have a textfield that i want to pass the name of a swf file to be loaded. Its working when i put the name of the file in the URLRequest(“walk.swf”).  
but when i try and pass it like this:

```auto

trace(textf.input.text); // walk.swf
var theUrl:String = textf.input.text;
var mRequest:URLRequest = new URLRequest(theUrl);

```

i get :  
[COLOR=#ff0000]Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.  
[/COLOR]i cast it as a string. what am i missing here?

```auto
        function displayKey(keyEvent:KeyboardEvent) {
            if(keyEvent.charCode == 13){
               loader2 = new Loader();
                loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                trace(textf.input.text); // walk.swf
                var theUrl:String = textf.input.text;
                var mRequest:URLRequest = new URLRequest(theUrl);
                loader2.load(mRequest); 
            }
        }

function onCompleteHandler(loadEvent:Event){
var mc2 = loadEvent.currentTarget.content.getChildAt(0);
            addChild(mc2);
        }

```

help much appreciated.

B
