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]