|
|
|
#1 |
|
Junior Member
Join Date: Jul 2007
Posts: 23
|
Masking problem
I tried posting this problem once before but got no reply so I thought I would try explaining it a little better.
I use the following code within a movieclip (made of multiple other movieclips and named "mcMap") to drop circles (instances of a circle movieclip with the linkage name of "CircleSymbol") each time the player clicks in a designated area defined by a named movieclip "mcMap": Code:
stop();
var i:Number = 0;
mcMap.onPress = function() {
i++;
_root.attachMovie("CircleSymbol", "mcCircle"+i, i, {_x:_root._xmouse, _y:_root._ymouse});
_root.clipName = "mcCircle"+i;
_root.xPos = _root._xmouse;
_root.yPos = _root._ymouse;
_root.scaleClip = true;
_root.allowClip = true;
_root["mcCircle" + i].setMask(mcMap);
};
mcMap.onRelease = function() {
_root.scaleClip = false;
};
mcMap.onReleaseOutside = function() {
_root.scaleClip = false;
};
Code:
stop();
_root.onEnterFrame = function() {
if (_root.scaleClip == true) {
xDist = _root._xmouse-_root.xPos;
yDist = _root._ymouse-_root.yPos;
if (_root[_root.clipName]._width + (_root.xDist + _root.yDist) > 10 && _root[_root.clipName]._height + (_root.xDist + _root.yDist) > 10) {
_root[_root.clipName]._width += _root.xDist + _root.yDist;
_root[_root.clipName]._height += _root.xDist + _root.yDist;
_root.xPos = _root._xmouse;
_root.yPos = _root._ymouse;
}
}
};
mcGotoMap.onRelease = function(){
_root.mcMapAppear.gotoAndPlay("start");
};
Code:
_root["mcCircle" + i].setMask(mcMap); Last edited by BrianDP1977; 07-27-2007 at 10:28 PM. |
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|