Problem mit Preloader bei Cliploader und Listener [Flash 9]
| Beiträge: 5 Registriert: Mar 2010
| 03.12.2012, 20:01
Hallo, hab das blöde Problem, dass mir der Preloader nur "undefined" ausgibt und ich mit meinem Halbwissen keine Lösung mehr weiß.
Im Grunde sollen mehrere Bilder aus einer XML geladen werden. Klappt auch alles. Der Listener spuckt auch Werte aus(loadedBytes etc...) aber bei den Textfeldern harperts. Ich vermute, dass sie nicht richtig erstellt werden oder an der falschen Stelle...
Bitte schaut mal drüber.
Danke und Gruß
Carsten
PHP: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
|
//XML laden
var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("IMGxml/archi.xml");
myGalleryXML.onLoad = function() {
_root.gallery_width = myGalleryXML.firstChild.attributes.width;
_root.gallery_height = myGalleryXML.firstChild.attributes.height;
_root.gallery_y = myGalleryXML.firstChild.attributes.y;
_root.spacing = myGalleryXML.firstChild.attributes.vertical_spacing;
_root.bar_y = Number(_root.gallery_height)+Number(_root.spacing);
_root.bar_thickness = myGalleryXML.firstChild.attributes.bar_thickness;
_root.scroller_width = _root.bar_thickness*2;
_root.image_width = myGalleryXML.firstChild.attributes.image_width;
_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = _root.myImages.length;
createContainer();
callImages();
masking();
scrollbar();
scroller();
};
function createContainer() {
_root.myGallery_mc = _root.createEmptyMovieClip("myGallery_mc", _root.getNextHighestDepth());
_root.myGallery_mc._y = _root.gallery_y;
_root.myGallery_mc._x = (Stage.width-_root.gallery_width)/2;
}
function callImages() {
_root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_mc", _root.myGallery_mc.getNextHighestDepth());
var myMCL:MovieClipLoader = new MovieClipLoader();
var preloader = new Object();
myMCL.addListener(preloader);
for (i=0; i<_root.myImagesTotal; i++) {
preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100)+"%";
target.my_txt.textColor = 0x555555;
trace(target.my_txt.text);
target.my_txt.setNewTextFormat(my_fmt);
};
preloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth(),_root.myGallery_mc._x,_root.myGallery_mc._y);
this.my_txt.selectable = false;
this.my_txt.embedFonts = true;
this.my_txt.antiAliasType = "advanced";
};
imageURL = _root.myImages[i].attributes.url;
image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
image_mc._x = (i*350);
myMCL.loadClip(imageURL,image_mc);
preloader.onLoadComplete=function(target){
target.my_txt.removeTextField();
}
}
}
|
| |
| Ähnliche Beiträge zum Thema | 28.07.2022 - TateBauch |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|