# Dynamic Movie scope question

**URL:** https://forum.kirupa.com/t/dynamic-movie-scope-question/244880
**Category:** flash
**Created:** [November 23, 2007, 12:15am UTC](https://forum.kirupa.com/t/dynamic-movie-scope-question/244880 "2007-11-23T00:15:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hc3d](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@hc3d](https://forum.kirupa.com/u/hc3d)
#### Post date: [November 23, 2007, 12:15am UTC](https://forum.kirupa.com/t/dynamic-movie-scope-question/244880/1 "2007-11-23T00:15:43Z")

</div>

[FONT=Times New Roman][SIZE=3]Dynamic MovieClip scope question[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I reused the thumbnail tutorial code from this site and retooled it to work from PHP to MySQL rather than an XML file. Works great!!! Thanks [Kirupa.com](http://Kirupa.com)[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]Problem I’m having is when I load the .swf file into a movie the scrolling stops working…[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]The working file is this…….[/SIZE][/FONT]  
[[FONT=Times New Roman][SIZE=3][COLOR=#800080]http://www.hc3d.com/sales/get\_asset.html[/COLOR][/SIZE][/FONT]](http://www.hc3d.com/sales/get_asset.html)  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]but when loaded into the main .swf file ……[/SIZE][/FONT]  
[[FONT=Times New Roman][SIZE=3][COLOR=#800080]http://www.hc3d.com/sales/[/COLOR][/SIZE][/FONT]](http://www.hc3d.com/sales/)  
[FONT=Times New Roman][SIZE=3]the scrolling thumbs don’t scroll (any thought word be a great help)[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Times New Roman]here is the new code[/FONT][/SIZE]

////////////////////////////////////////////////////////////////////  
function GetThumbData() {  
image = [];  
thumbnails = [];  
total = _root.NewImageTotal;  
for (i=1; i\<=total; i++) {  
image\* = "Preview\_Files/Asset_" + _root.My\_ID\_text + “/” + “Asset\_preview”+i+".jpg";  
thumbnails\* = "Preview\_Files/Asset_" + \_root.My\_ID\_text + “/” + “Thumb\_preview”+i+".jpg";  
thumbnails\_fn(i);  
}  
firstImage();  
}  
GetThumbData();  
p = 1;  
this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};  
function nextImage() {  
if (p\<total) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
picture\_num();  
}  
}  
}  
function prevImage() {  
if (p\>0) {  
p–;  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
picture\_num();  
}  
}  
function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[\_root.NewPrimary], 1);  
picture\_num();  
}  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}  
function thumbNailScroller() {  
// thumbnail code!  
this.createEmptyMovieClip(“tscroller”, 1000);  
scroll\_speed = 20;  
tscroller.onEnterFrame = function() {  
if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {  
if ((\_root.\_xmouse\>=(hit\_right.\_x-50)) && (thumbnail\_mc.hitTest(hit\_right))) {  
thumbnail\_mc.\_x -= scroll\_speed;  
} else if ((\_root.\_xmouse\<=(hit\_left.\_x+50)) && (thumbnail\_mc.hitTest(hit\_left))) {  
thumbnail\_mc.\_x += scroll\_speed;  
}  
} else {  
delete tscroller.onEnterFrame;  
}  
};  
}  
function thumbnails\_fn(k) {  
thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.\_x = hit\_left.\_x+(target\_mc.\_width+5)\*k;  
target\_mc.pictureValue = k;  
target\_mc.onRelease = function() {  
p = this.pictureValue-1;  
nextImage();  
};  
target\_mc.onRollOver = function() {  
this.\_alpha = 60;  
thumbNailScroller();  
};  
target\_mc.onRollOut = function() {  
this.\_alpha = 100;  
};  
};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(thumbnails[k], “thumbnail\_mc.t”+k);  
}  
stop();
