![]() |
|
||||||||||
|
|
|
|||||
И сново я с новым вопросом ![]() У меня есть куча картинок которые загружаются в swf, все работает прекрасно, но единственный недостаток это то что нет загрузки к ним. Я пытался это долго сделать, но ни чего не получается. Подскажи как мне это сделать. Буду благодарен очень. //frame 1
x = 0;
images = x; // это числовой порядок картинок
y = 1; // это числовой порядок папок
//frame 2
next1.onRelease = function() {
images = ++x;
loadMovie("" add y add "/image" add images add ".jpg", "fotos");
}
back1.onRelease = function() {
images = --x;
loadMovie("" add y add "/image" add images add ".jpg", "fotos");
}
//frame 3
gotoAndPlay(2);
function start() {
_root.fotos.loadMovie("" add y add "/image" add images add ".jpg", "fotos");
initialSize = _root.fotos.getBytesTotal();
loadStarted = false;
loaded;
percent = 0;
cont();
}
function () {
if (_root.fotos.getBytesTotal()>0) {
percent = Math.round((_root.fotos.getBytesLoaded()/_root.fotos.getBytesTotal())*100);
_root.percentfield = percent+"%";
_root.indicator.bar._xscale = percent;
}
if (!loadStarted) {
if (percent<100 || _root.fotos.getBytesTotal()>initialSize) {
loadStarted = true;
}
}
};
next1.onRelease = function() {
images = ++x;
start();
};
back1.onRelease = function() {
images = --x;
start();
};
|
|
|||||
|
ваще чтоль не кто не знает ?
![]() |
|
|||||
|
"человек"
Регистрация: Nov 2002
Адрес: +-
Сообщений: 1,807
|
извени, думать лень
![]() може попозже ![]()
__________________
flash it |
|
|||||
|
Techmaker
Я думаю что не ты один тут проф. Flash'a ))Ну плиз подскажитете как ? |
|
|||||
|
1. создаём папку img в неё кидаем те jpg которые тебе нужны...
2. воздаём файл data.txt, в нём пишем Код: img0=flower&img1=liliya&img2=rouse&img3=tulpan&img4=vetochka причём flower, liliya это названия файлов без разширения. 3. создаём flash->file->new и впервом фрейве пишем System.useCodepage = 1;
var _url_ = "data.txt",
n = 5,
t,
image_path;
//ImageViewer = function (target,depth, x, y, w, h, borderThickness, borderColor) {
var img_ = new ImageViewer(this, 3, 60, 20, 150, 30, 2, 0x000000);
_root.createEmptyMovieClip('temp', 1);
with (_root.temp) {_x = 50;_y = 20;}
data_ = new LoadVars();
data_.load(_url_);
data_.onLoad = function(success) {
if (success) {
with (_root.data_) {
t = random(n);
image_path="img/"+eval("img"+t)+".jpg";
}
trace(image_path+"\r"+t);
img_.loadImage(image_path);
}
};
MovieClip.prototype.drawRect = function (x, y, w, h, RGB, alpha) {
this.moveTo(x, y);
this.beginFill(RGB, alpha);
this.lineTo(x+w, y);
this.lineTo(x+w, y+h);
this.lineTo(x, y+h);
this.lineTo(x, y);
this.endFill;
};
_global.ImageViewer = function (target, depth, x, y, w, h, borderThickness, borderColor){
this.borderThickness = borderThickness;
this.borderColor = borderColor;
this.target_mc = target;
var imgViewer = this;
this.target_mc.createEmptyMovieClip("container_mc" + depth, depth);
this.container = this.target_mc["container_mc" + depth];
with(this.container){
_x = x;
_y = y;
createEmptyMovieClip("imageHolder_mc", 0);
imageHolder_mc._visible = false;
createEmptyMovieClip("border_mc", 1);
border_mc.lineStyle(borderThickness, borderColor);
border_mc.drawRect(0, 0, w, h);
createEmptyMovieClip("mask_mc", 2);
mask_mc.drawRect(0, 0, w, h, 0x0000FF, 100);
mask_mc._visible = false;
}
}
_global.ImageViewer.prototype.loadImage = function (URL) {
if (typeof this.container.imageHolder_mc.image_mc != "movieclip") {
this.container.imageHolder_mc.image_mc.removeMovieClip();
}
this.container.imageHolder_mc.createEmptyMovieClip("image_mc", 1);
var imgViewer = this;
var image = this.container.imageHolder_mc.image_mc;
var loadCheckID;
image.loadMovie(URL);
loadCheckID = setInterval(preloadImage, 100, getTimer());
this.container.createTextField("loadStatus_txt", 3, 0, 0, 0, 0);
with(this.container.loadStatus_txt){
background = true;
border = true;
setNewTextFormat(new TextFormat("Arial, Helvetica, _sans", 10, imgViewer.borderColor, false, false, false, null, null, "right"));
autoSize = "left";
text = "LOADING";
_y = 3;
_x = 3;
}
function preloadImage (startLoadTime) {
var largestBorderDimension;
var imageScaleFactor;
if (image.getBytesTotal() > 4) {
imgViewer.container.loadStatus_txt.text = "LOADING: "
+ Math.floor(image.getBytesLoaded() / 1024)
+ "/" + Math.floor(image.getBytesTotal() / 1024) + " KB";
}
if (image.getBytesTotal() > 4 && image.getBytesLoaded() == image.getBytesTotal()) {
clearInterval(loadCheckID);
with(imgViewer.container){
loadStatus_txt.removeTextField();
border_mc.clear();
border_mc.lineStyle(imgViewer.borderThickness, imgViewer.borderColor);
border_mc.drawRect(0, 0, image._width, image._height);
mask_mc.drawRect(0, 0, image._width, image._height, 0xFFFFFF, 100);
imageHolder_mc.setMask(imgViewer.container.mask_mc);
imageHolder_mc._visible = true;
}
} else if ((image.getBytesTotal() < 4)
&& (getTimer() - startLoadTime > 7000)) {
imgViewer.container.loadStatus_txt.text = "ERROR LOADING IMAGE";
clearInterval(loadCheckID);
}
}
}
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
|
Салют любителям длинных скриптов!!!
![]() |
|
|||||
|
fiot
Я очень благодарен за хелп, но как нить то что я наисал это можно сделать ? Потому как я не очень понимаю что у тебя там написано ![]() Даже точнее я не знаю как мне применить в моему мувику ![]() Последний раз редактировалось rojok-online; 05.11.2003 в 02:16. |
|
|||||
|
fiot
чет не фурычит... |
![]() |
Часовой пояс GMT +4, время: 12:56. |
|
|
« Предыдущая тема | Следующая тема » |
|
|