![]() |
|
||||||||||
|
|||||
|
[2.1 23.02.2006]
[1.4 23.02.2006] Регистрация: Feb 2006
Сообщений: 83
|
Цитата:
Так флэшевый же трэйс через браузер не будет выдаваться.. |
|
|||||
|
Флешевый трейс с компа.
|
|
|||||
|
[2.1 23.02.2006]
[1.4 23.02.2006] Регистрация: Feb 2006
Сообщений: 83
|
Цитата:
![]() |
|
|||||
|
Из проблемы вытекает проблема.
Возникла следующая проблема: 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);
}
?>
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);
}
}
};
|
|
|||||
|
Регистрация: Jun 2005
Сообщений: 367
|
попробуй сдесь
images_mc["cell_"+count].onPress = function(){ photo_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+this["amount"+count]+"&type=2", 1); } вместо this["amount"+count] files["amount"+count] ваще не знаю чужой код не понимаю, флэшем занимаюсь тока когда надо, поэтому тож плохо знаю ![]()
__________________
[MScoder] |
|
|||||
|
Ты прав!
Работает Но помимо того, что ты написал, нужно добавить цикл. domain = "www.spektr-company.ru";
target = "";
files = new LoadVars();
files.sendAndLoad("http://"+domain+target+"/Amount.php", files, "POST");
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);
for (i=0; i<5; i++) {
images_mc["cell_"+i].i = i;
images_mc["cell_"+i].onPress = function() {
photo_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+files["amount"+this.i]+"&type=2");
};
}
}
};
Последний раз редактировалось CREDO; 15.02.2006 в 21:14. |
|
|||||
|
Точно не уверен, но интуиция подсказывает мне, что код можно оптимизировать.
|
|
|||||
|
Мне интересно.
Этот код не лучше. В первом случае меня смущает цикл в цикле. domain = "www.spektr-company.ru";
target = "";
files = new LoadVars();
files.sendAndLoad("http://"+domain+target+"/Amount.php", files, "POST");
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);
}
for (i=0; i<this.n; i++) {
images_mc["cell_"+i].i = i;
images_mc["cell_"+i].onPress = function() {
photo_mc.loadMovie("http://"+domain+target+"/Resize.php?f="+files["amount"+this.i]+"&type=2");
};
}
};
|
![]() |
![]() |
Часовой пояс GMT +4, время: 21:45. |
|
|
« Предыдущая тема | Следующая тема » |
|
|