PDA

View Full Version : XML menu, setMask ?



coop
August 11th, 2005, 10:51 AM
Hi,

Help.

I have list of movieclip/buttons that come from an XML file, which have been placed within a MC on the stage (holder_mc) using a loop, this is all fine, but I'm now trying to mask part of the holder_mc, this is'nt working, I can only select the buttons within the mask, which is what I wanted but I can see the rest of the holder_mc which I dont want. This works without the XML, is this the problem. Hope this make sense, here is the code and fla




my_xml = new XML ();
my_xml.ignoreWhite = true;
my_xml.onLoad = function (success) {
    if (success) {
        DisplayBands ();
    }
    else {
        trace ("XML not Loaded");
    }
};
var btn_spacing = 20;
my_xml.load ("bands.xml");
holder_mc.setMask (mask_mc);
function DisplayBands () {
    var start = my_xml.firstChild.childNodes;
    for (var i = 0; i < start.length; i++) {
        bands = start[i];
        holder_mc.attachMovie ("btn_mc", "btn_mc" + i, i + 1);
        holder_mc["btn_mc" + i]._x = btn_spacing;
        holder_mc["btn_mc" + i]._y = btn_spacing * i;
        holder_mc["btn_mc" + i].id = bands.attributes.name;
        holder_mc["btn_mc" + i].image = bands.attributes.image;
        holder_mc["btn_mc" + i].txt_txt.text = bands.attributes.name;
        holder_mc["btn_mc" + i].onRollOver = function () {
            this.txt_txt.textColor = 0xff0000;
        };
        holder_mc["btn_mc" + i].onRollOut = function () {
            this.txt_txt.textColor = 0x000000;
        };
        holder_mc["btn_mc" + i].onRelease = function () {
            image_mc.loadMovie (this.image);
            image_mc._alpha = 0;
            preloader_mc.bar_mc._alpha = 100;

coop
August 11th, 2005, 03:24 PM
Any takers ?

Flashmatazz
August 11th, 2005, 03:53 PM
Well, it seems to work for me. I just see the 5 items under the mask.
p.s. you might want to have a look at your xml, it contains a number of formatting errors. try opening it in firefox and you'll see.

coop
August 11th, 2005, 05:16 PM
Thanks for that Flashmatazz,
I fixed the problems in the XML file, but still carnt get it to work.
If it works for you, could you post back the file.

Flashmatazz
August 11th, 2005, 05:37 PM
sure, although I haven't changed anything in it.

but here it is:

coop
August 11th, 2005, 05:47 PM
I give up, still doesn't work. It should show 5 buttons as you described, but I can see all the buttons and only the buttons within the mask area have rollover actions, which indicates the mask is working in that it masks there use but not there visibility.

Any ideas

Flashmatazz
August 11th, 2005, 05:57 PM
Strange, I can just see 5 buttons (from Beck to Fatboy Slim)

sorry I can't help you

coop
August 11th, 2005, 06:04 PM
Thanks for help,
Gives me something to work on