Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

Gecombineerde Preloader voor meerdere MovieClips

Pagina: 1
Acties:

  • High Quality king
  • Registratie: Februari 2002
  • Laatst online: 28-11 12:40
Beste iedereen,

Het is weer vakantie en mijn website is aan een update toe. Ik wil een aantal thumbnails laden met MovieClipLoader (loadClip dus). Het probleem is echter het preloaden, als ik getProgress gebruik krijg ik de totalBytes() van de individuele thumbnail en ik wil een preloader maken voor alle thumbnails samen.

Kan iemand me een duwtje in de goede richting geven ?

Alvast bedankt


code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Variables
pageNr = 1;
totalPages = 1;
aantal = 0;
perPage = 15;
home = this;

var inF:Number = 1;

var x:XML = new XML();
var urls:Array = new Array();
var captions:Array = new Array();
var files:Array = new Array();

// Functions
function createObj(amount)
{
    amountLeft = amount;
    spacing = 10;
    //maxIcollumn = Math.round((800-300) / 110) ; // pageWidth - border divided by obj + spacing
    maxIcollumn = Math.round((Stage.width-300) / (100 + spacing) ) ; // 100 is obj width //300 is the border
    Xoffset = (Stage.width / 2 ) - ((100 + spacing)*maxIcollumn*0.5) - spacing;
    Yoffset = 40;
    maxI = 425; // bottom of image scope
    this.createEmptyMovieClip("nextPage1", this.getNextHighestDepth());
    nextPage._x = nextPage0._y = 0;

    if( amount < maxIcollumn )
        {
            Yoffset = (this._height / 2) + 40;
            Xoffset = (Stage.width / 2 ) - ((100 + spacing)*amount*0.5) - spacing;
        };
    
    
    for(i=1,a=0; i <= amount; i++,a++){
        page = this["nextPage"+totalPages];
        page.attachMovie("obj", "obj"+i, i,{_alpha:0});
        xmlFile = files[i-1];
                
        mkBtn(page["obj"+i],xmlFile);
                
        if ( a >= maxIcollumn ) 
        {
            a=0;
            Yoffset= page["obj"+(i-1)]._y + page["obj"+(i)]._height + spacing;
            if( amountLeft < maxIcollumn )
            {
            Xoffset = (Stage.width / 2 ) - ((100 + spacing)*amountLeft*0.5) - spacing;
            };
        };
                    
        page["obj"+i]._x = page["obj"+i]._x + (a * (page["obj"+i]._width + spacing)) + Xoffset;
        page["obj"+i]._y = page["obj"+i]._y + Yoffset;
        
        page["obj"+i].butText.text = captions[i-1];
        page["obj"+i].butText.embedFonts = true;
        page["obj"+i].butText.setTextFormat(harmonyFormat);
        
        my_mcl.loadClip(urls[i-1],page["obj"+i].holder);
        
        if( a == (maxIcollumn -1) & (page["obj"+i]._y + (2 * page["obj"+i]._height)) > maxI) 
        {
            totalPages++;
            this.createEmptyMovieClip("nextPage"+totalPages, this.getNextHighestDepth());
            page = this["nextPage"+totalPages];
            page._x = page._y = 0;
            page._visible = false;
            Yoffset = 40;
            a = -1;
        };
        
        amountLeft--;
    };
    
        
    pageText.text = "page " + pageNr + " / " + totalPages;
    pageText.embedFonts = true;
    pageText.butText.setTextFormat(harmonyFormat);
    
    if( totalPages > 1 ){ nextBtn._visible = prevBtn._visible = pageText._visible = true; }
    else{nextBtn._visible = prevBtn._visible = pageText._visible = false;} ;
};

Ik kwam, Ik ben, En ik zal er altijd zijn