Из проблемы вытекает проблема.
Возникла следующая проблема:
Preview PHP - фаил для создания tumbs (preview картинок)

Код:
<?php
$list = array();
if ($dir = opendir('.'))
{
$i = 0;
$out = NULL;
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && preg_match("/.jpg/i", $file))
{
if(!empty($out))
$out .= '&';
$out .= 'amount' . $i . '=' .$file;
$i++;
}
}
if(!empty($out))
$out .= '&';
$out .= "n=$i";
echo $out;
closedir($dir);
}
?>
// Flash

Код:
domain = "www.spektr-company.ru";
target = "";
files = new LoadVars();
files.sendAndLoad("http://"+domain+target+"/Amount.php", files, "GET");
files.onLoad = function() {
for (count=0; count<this.n; count++) {
var position = images_mc.createEmptyMovieClip("cell_"+count, images_mc.getNextHighestDepth());
images_mc["cell_"+count].attachMovie("frame_mc", "frame_mc", 1);
position._x = position._width*count;
images_mc["cell_"+count].frame_mc.loaders_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+this["amount"+count]+"&type=0", 1);
}
};
Задача:
При нажатии на определённый клип, загружается соответствующая картинка только с другими параметрами разрешения:
Проблема в облости цепочки видимости переменных.

Код:
target = "";
files = new LoadVars();
files.sendAndLoad("http://"+domain+target+"/Amount.php", files, "GET");
files.onLoad = function() {
for (count=0; count<this.n; count++) {
var position = images_mc.createEmptyMovieClip("cell_"+count, images_mc.getNextHighestDepth());
images_mc["cell_"+count].attachMovie("frame_mc", "frame_mc", 1);
position._x = position._width*count;
images_mc["cell_"+count].frame_mc.loaders_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+this["amount"+count]+"&type=0", 1);
images_mc["cell_"+count].count = count;
images_mc["cell_"+count].onPress = function(){
photo_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+this["amount"+count]+"&type=2", 1);
}
}
};