PDA

Просмотр полной версии : почему не грузит


opex
01.10.2003, 23:13
кароче трабала втом что скрипт почемуто все время загружает image2 хотя стоит чтобы он грузил по рандому
может я парь подсожите

---------------------------------------------
_root.onLoad = function() {
var i = 0;
};
loadMovieNum("/image0.jpg", 1);
setInterval(_root.onEnterFrame=function () {
unloadMovie(["image"+i+".jpg"]);
i = random(10);
loadMovieNum(["/image"+i+".jpg"], 1);
}, 1000);
-----------------------------------------------------
Заранее благодарен

opex
02.10.2003, 00:20
помучался еще но серовно не грузит
вот новая версия скрипта
----------------------------------------------------
i = 0;
_root.onEnterFrame = function() {
d = i;
i = random(9);
if (d == i) {
i = i+1;
unloadMovieNum(1);
loadMovieNum(["image"+i+".jpg"], 1);
} else {
unloadMovieNum(1);
loadMovieNum(["image"+i+".jpg"], 1);
}
};

----------------------------------------------------

sergwizard
02.10.2003, 00:52
Попробуй:

function loadRandImg(){
i = random(10);
_root.loadMovie("image"+i+".jpg",1);
}
setInterval(loadRandImg,1000);

opex
02.10.2003, 01:06
грузит то грузит только мне надо чтобы каждые 10 - 20 секунд загружался новый image
но серовно спасиба

sergwizard
02.10.2003, 02:12
Ну, сделай интервал не 1000, а 10000 или 20000. В чем проблема?

opex
02.10.2003, 09:08
вот этот скрипт не работает
---------------------------------------
function load() {
i = random(10);
_root.loadMovie("image"+i+".jpg", i);
}
setInterval(load, 1000);
---------------------------------------
не листает серовно
да если даже листает он может загрузить два раза один и тодже image а должно быть условие ну как у меня во втором
сообшении

sergwizard
02.10.2003, 23:11
Как только начнешь писать по-русски грамотно и с большим уважением к языку, - все у тебя получится.
Рэндом - то есть "случайно" - это значит, что значение может быть "ЛЮБЫМ" из назначенных. И random(10) = 3 == random(10)=3 - это запросто может быть.
Хочешь исключений, - используй Arrray с исключением. Но, это - более заморочестей.

Diomas
04.10.2003, 04:38
2 sergwizard
А зачем ты в во второй параметр метода loadMovie суешь число, в чем фишка?

sergwizard
04.10.2003, 05:03
loadMovie
Availability
Flash Player 3.
Usage
loadMovie("url",level/target[, variables])
Parameters
url The absolute or relative URL of the SWF file or JPEG file to be loaded. A relative path
must be relative to the SWF file at level 0. The URL must be in the same subdomain as the URL
where the movie currently resides. For use in the Flash Player or for testing in test mode in the
Flash authoring application, all SWF files must be stored in the same folder, and the filenames
cannot include folder or disk drive specifications.
target A path to a target movie clip. The target movie clip will be replaced by the loaded
movie or image. When the Actions panel is in normal mode, you can specify either a target
movie clip or a level of a target movie; you can’t specify both.
level An integer specifying the level in the Flash Player into which the movie will be loaded.
The level parameter is vailable with the loadMovie action only when the Actions panel is in
normal mode. If you select a level of a target movie while in normal mode, Macromedia Flash
MX automatically changes the unloadMovie action to the unloadMovieNum action in the
Actions panel Script pane. When the Actions panel is in expert mode, you cannot specify a level
with unloadMovie. You must use unloadMovieNum instead.
variables An optional parameter specifying an HTTP method for sending variables. (In
expert mode, the variables parameter is identified as the method parameter.) The parameter
must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET
method appends the variables to the end of the URL, and is used for small numbers of variables.
The POST method sends the variables in a separate HTTP header and is used for long strings
of variables.

Diomas
06.10.2003, 03:41
Это, кажись, не метод называется (в тройке-то).
Когда ты испоьзуешь loadMovie через точку, там другие параметры:

MovieClip.loadMovie
Availability
Flash Player 5.
Usage
myMovieClip.loadMovie("url" [,variables])
Parameters
url An absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at _level0. The URL must be in the same subdomain as the URL where the movie currently resides. For use in the stand-alone Flash Player or for testing in test mode in the Flash authoring application, all SWF files must be stored in the same folder, and the filenames cannot include folder or disk drive specifications.
variables An optional parameter specifying an HTTP method for sending or loading variables. The parameter must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL, and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.

sergwizard
07.10.2003, 00:25
2 Diomas
Все было бы верно в твоих словах, если бы не...
Ты обратил внимание на то, что opex загружает не MovieClip.loadMovie, а в _root? А если грузишь в _root, - грузи или в таргет, или в левел.