# Problem with function scope

**URL:** <https://forum.kirupa.com/t/problem-with-function-scope/200180>\
**Category:** Uncategorized\
**Created:** [September 9, 2006, 4:26pm UTC](https://forum.kirupa.com/t/problem-with-function-scope/200180 "2006-09-09T16:26:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vedran1](https://avatars.discourse-cdn.com/v4/letter/v/e9c0ed/32.png) [@vedran1](https://forum.kirupa.com/u/vedran1)\
**Post date:** [September 9, 2006, 4:26pm UTC](https://forum.kirupa.com/t/problem-with-function-scope/200180/1 "2006-09-09T16:26:39Z")

</div>

[FONT=verdana, arial, helvetica][SIZE=2]hi!  
this is first time i came on this kind of a problem. i can not run the function inside of a movie that was attached (i want to run it after attaching). what did i do wrong??? i realy dont know what could be a problem… did someone had a similar problem?

newsPeice movie has a linkage and function that has to be run is on the main timeline of the newsPeice movieClip

here is the code:

item\_count = 0;  
function CreateNews() {  
for (var i = 0; i\<100; i++) {  
var newsPeice\_mc = newsContainer\_mc.attachMovie(“newsPeice”, “newsPeice\_”+item\_count, item\_count);  
newsPeice\_mc.runFunctionForLoadingPicture();  
}  
}[/SIZE][/FONT]
