I’m trying to apply a mask while loading my xml file but I can’t make the mask working from right to left side.
Does anyone know how to apply a mask?
Here’s my code:
var lexml = new XML();
var chemin = “…/xml/”;
var tab_images = new Array();
lexml.ignoreWhite = true;
lexml.onLoad = loaderXML;
lexml.load(chemin+“company2.xml”);
// Permet de loader le fichier xml
function loaderXML(loaded) {
var racine = this.firstChild;
var nb_elements = racine.childNodes.length;
if (loaded) {
for(i=0;i<nb_elements;i++) {
var company_name = racine.childNodes*.attributes;
var item = _root.attachMovie("company", "item"+i, i);
item.nom_txt.text = company_name.id;
item.nom_txt.autoSize = "center";
// Positionning space
var cote_gauche = _root["item"+(i-1)].nom_txt._x;
var profondeur_mc = _root["item"+(i-1)].nom_txt._width;
//trace("Item "+left_space+ " Width " +mc_width);
item.nom_txt._x = 0;
item.nom_txt._x = cote_gauche + profondeur_mc + 20;
item.nom_txt._y = 20;
//trace(item);
item.setMask(affecter_mask());
}
} else {
text_area.text = "Can NOT load the images request. Please make sure you have right path...";
}
}
function affecter_mask() {
var mask = _root.attachMovie(“mask_area_mc”,“mask”, this.getNextHighestDepth());
mask.onEnterFrame = function() {
this._x += 20;
};
}