# Input text / embed problem

**URL:** <https://forum.kirupa.com/t/input-text-embed-problem/246795>\
**Category:** flash\
**Created:** [December 14, 2007, 4:50pm UTC](https://forum.kirupa.com/t/input-text-embed-problem/246795 "2007-12-14T16:50:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rusty27851](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@rusty27851](https://forum.kirupa.com/u/rusty27851)\
**Post date:** [December 14, 2007, 4:50pm UTC](https://forum.kirupa.com/t/input-text-embed-problem/246795/1 "2007-12-14T16:50:18Z")

</div>

I’m working on a flash file that is a video clip and beneath the video, there’s an input text field where a user can get the code to embed the video in their page (youtube code). The problem is that when I have plain text in the text field it works, but when I try to use html code, I get an actionscript error and it doesn’t show up. This is my actionscript (leaving out the full url):

this.onMouseUp = function() {  
if (Selection.getFocus() != “null”) {  
setTimeout(setSelect, 10);  
}  
function setSelect() {  
var firstChar:Number = Selection.getBeginIndex();  
var lastChar:Number = Selection.getEndIndex();  
if (firstChar == lastChar) {  
var txtFld:TextField = eval(Selection.getFocus());  
Selection.setSelection(0, txtFld.length);  
}  
}  
};

center\_txt.autoSize = “false”;  
center\_txt.text = “\<object width=“425” height=“355”\>\<param name=“movie” value=”“[http://www.etc](http://www.etc)…”;
