Here is my code:
createEmptyMovieClip(“pen_mc”, 5);
myColor = Math.round( Math.random()*0xFFFFFF );
pen_mc.lineStyle(4, myColor, 100);
if (_global.newData[_root._currentframe - 20].nodeName.toUpperCase() == ‘EVENT’) {
element = _global.newData[_root._currentframe-20].firstChild;
while (element.nodeName != null) {
if (element.nodeName.toUpperCase() == “LAT_ATTACKER”) {
lan_attacker = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == “LON_ATTACKER”) {
lon_attacker = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == “LAT_VICTIM”) {
lan_victim = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == “LON_VICTIM”) {
lon_victim = element.firstChild.nodeValue;
}
if (element.nodeName.toUpperCase() == “DETAILS”) {
details = element.firstChild.nodeValue;
}
element = element.nextSibling;
}
}
convert(lan_attacker, lon_attacker, 1200, 2400);
pen_mc.moveTo(x, y);
oldx = x;
oldy = y;
convert(lan_victim, lon_victim, 1200, 2400);
pen_mc.curveTo((x+oldx)/2, (y-oldy), x, y);
pen_mc.setMask(movie);
function convert(lat, lon, h, w) {
var long:Number = lon;
lati = ((lat)-1)+90;
long = (lon-1)+1+180;
x = Math.round(long*(w/360));
tmp = Math.round(lati*(h/180));
y = h-tmp;
}
I have many layers in the main stage. on frame 20, I have this code drawing a curve between two countries in “Lines” layer . I have another layer right above this layer called “mask” in which in frame 20, I make a rectangle and until frame thirty, I move the rectangle with tween. I right clicked on the mask layer and set mask. Hoping that by masking the layer below it, I can make the curve being draw real time. But it is not working.
Please help.
I think my mask is not going over the pen_mc movie clip. how can I do this.