# String to Object

**URL:** <https://forum.kirupa.com/t/string-to-object/226906>\
**Category:** flash\
**Created:** [May 25, 2007, 12:05am UTC](https://forum.kirupa.com/t/string-to-object/226906 "2007-05-25T00:05:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corvus](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Corvus](https://forum.kirupa.com/u/Corvus)\
**Post date:** [May 25, 2007, 12:05am UTC](https://forum.kirupa.com/t/string-to-object/226906/1 "2007-05-25T00:05:19Z")

</div>

I have this function that receives a string which has the name of the movieClip I am attaching:

function contentsFadesin\*\*(movieFadesin:String)\*\*:Void {  
attachMovie(movieFadesin, movieFadesin,1);  
lastSelectedMovie.\_visible =false;  
**movieFadesin**.\_x = 369;  
movieFadesIn.\_y = 54;  
movieFadesIn.\_visible = true;  
movieFadesIn.\_alpha = 2;  
movieFadesIn.onEnterFrame = function() {  
if (movieFadesIn.\_alpha\<=100) {  
movieFadesIn.\_alpha += movieFadesIn.\_alpha\*1;  
} else {  
delete this.onEnterFrame;  
lastSelectedMovie = movieFadesIn;  
}  
};  
}

The movieClip is attached just fine, but then the rest of the function should fade the movie in. The problem is: the variable “\*\*movieFadesin” \*\*is passed as a string (so I can use attachMovie), but the rest of the function only accepts and “Object” variable in order to work properly.

My questions is how can I change the string value of \*\*movieFadesin \*\*into a object?
