# I'm not sure what to call this...unintentional moving mask?

**URL:** <https://forum.kirupa.com/t/im-not-sure-what-to-call-this-unintentional-moving-mask/198960>\
**Category:** flash\
**Created:** [August 30, 2006, 1:49am UTC](https://forum.kirupa.com/t/im-not-sure-what-to-call-this-unintentional-moving-mask/198960 "2006-08-30T01:49:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dayglowdave](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dayglowdave](https://forum.kirupa.com/u/dayglowdave)\
**Post date:** [August 30, 2006, 1:49am UTC](https://forum.kirupa.com/t/im-not-sure-what-to-call-this-unintentional-moving-mask/198960/1 "2006-08-30T01:49:46Z")

</div>

alright here is the set up. I have a masked dynamic text field suitable for continuous scrolling. I used bits of an older code that a kind hearted Kirupaean posted about a year ago the last time I dared to tackle this problem ( yes it has been that long…yes it is pathetic…yes I may be mentally retarded) moving on. The code compares the textfield’s height and Y position to that of the mask’s and does it’s thing. Scroll up seems to do fine but scroll down scrolls the entire mask…the example that I posted in an earlier thread today is what I based this on. Theirs works, mine does not and I am perplexed. Any suggestions would be helpful.

Here is the code:

[AS]

news\_mc.setMask(mask\_mc);

////////////////////////////////  
//LOAD THAT EXTERNAL TEXT FILE//  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*//  
//Remember that because this //  
//is masked DYNAMIC text you //  
//need to embed the font in //  
//the text field. //  
////////////////////////////////

newsLoad = new LoadVars();

newsLoad.load(“myNewsText.txt”);

newsLoad.onLoad = function(){  
news\_mc.news\_mc2.htmlText = this.myNews;  
};

//////////////////////////////////////////////////////  
//TIME TO DEFINE SCROLL UP AND SCROLL DOWN FUNCTIONS//  
//\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*//  
//////////////////////////////////////////////////////

var scrollSpeed:Number = 5;

function scrollUp() {  
news\_mc.onEnterFrame = function() {  
if (news\_mc.\_y\>mask\_mc.\_y) {  
delete news\_mc.onEnterFrame;  
} else {  
news\_mc.\_y += scrollSpeed;  
}  
};  
}

function scrollDown() {  
news\_mc.onEnterFrame = function() {  
if ((news\_mc.news\_mc2.\_y+(news\_mc.\_height))\<(mask\_mc.\_y+mask\_mc.\_height)) {  
delete news\_mc.onEnterFrame;  
} else {  
news\_mc.\_y -= scrollSpeed;  
}  
}  
}

upBtn.onPress = function() {  
scrollUp();  
};  
downBtn.onPress = function() {  
scrollDown();  
};  
upBtn.onRelease = upBtn.onReleaseOutside=upBtn.onDragOut=function () {  
delete news\_mc.onEnterFrame;  
};  
downBtn.onRelease = downBtn.onReleaseOutside=downBtn.onDragOut=function () {  
delete news\_mc.onEnterFrame;  
};

[/AS]
