Autor Zpráva
zbystr
Profil *
Zdarvim .... mohli by jsti mi poradit, proc se nespusti funkce CreateListItem()??
pokud bych to pouzil normalne .... tedy pri nepouziti v class tak by to melo jet bez problemu .....

class imglist extends MovieClip {
var XML, onPress;
var imgArray:Array;
var posY:Number = 20;
function imglist(xml:XML, file:String) {
xml.load(file);
xml.ignoreWhite = true;
xml.onLoad = function(success) {
if (success) {
for (var aNode:XMLNode = xml.firstChild.childNodes[0]; aNode != null; aNode = aNode.nextSibling) {
this.CreateListItem(aNode.attributes.src);
}
}
};
}
function CreatePreview() {
this.createEmptyMovieClip("preview_mc", 50);
}
public function CreateListItem(src:String) {
var nextItem:Number = imgArray.length + 1;
var itemname:String = "img_item_" + nextItem + "_mc";
imgArray[nextItem] = itemname;
this.createEmptyMovieClip(itemname, nextItem);
this[itemname]._y = posY * nextItem;
this[itemname].createTextField("label_txt", 1, 0, 0, 50, 15);
this[itemname].label_txt.text = src;
this[itemname].label_txt.type = "dynamic";
this[itemname].onPress = function() {
trace(this);
};
}
}

Diky ZbySTr
FlashManiac
Profil
ta funkce jede uplne normálně,ale asi je tam neco špatně co se týká těch polí..
zbystr
Profil *
pokud udelas toto:
function CreateListItem(src:String) {
trace (src);
}

tak se nic nedeje .... takze chyba nebude v poli ....
zbystr
Profil *
vyreseno
Toto téma je uzamčeno. Odpověď nelze zaslat.

0