I feel like my current implementation should work, but have had no success in the simulator. Hopefully someone can help me with this or suggest a more efficient way of doing so.
The problem is, I want to display a lot of text, and want to enable the user to be able to scroll down to read through it all. I'm trying to accomplish this by adjust my 'Y' variable in View from my up/down keys in the delegate.
I can successfully get it to print, but for some reason it can't find the variable 'Y'
Thanks in advanced!
class seeWorkoutView extends Ui.View { var scroll; function initialize() { View.initialize(); scroll = 0; return true; } function onUpdate(dc) { clearScreen(dc); drawPlan(dc); } function drawPlan(dc) { var y = 5 + scroll; var x = $.screenWidth / 2; var font = Gfx.FONT_MEDIUM; var justification = Gfx.TEXT_JUSTIFY_CENTER; for (var i = 0; i < trainingPlan.steps; i++) { var text = trainingPlan.getDisplayArray(i); dc.drawText(x, y, font, text, justification); y += 35; } } function up() { System.println("scroll"); //THIS WORKS scroll += 5; //THIS DOES NOT WORK //>> I GET A 'SCROLL' CAN'T // BE FOUND ERROR } } class seeWorkoutDelegate extends Ui.BehaviorDelegate { function initialize() { BehaviorDelegate.initialize(); } function onSelect() { Ui.switchToView( new SummitPairingView(), new SummitPairingDelegate(), Ui.SLIDE_IMMEDIATE ); } function onNextPage() { seeWorkoutView.up(); //HERE IS WHERE I'M TRYING //TO ADD TO 'Y' } function onPreviousPage() { } function onBack() { } }