Tuesday, April 23, 2013

"Page Numbers" and Better Scene-Tracking

I worked on a few things today: (a) embedding a font that looks like chalk-writing, (b) Page Numbers, and (c) Better Scene-Tracking.

EMBEDDING FONT - I tried this about a month ago and it seemed to work on a limited bases but it was lost somehow. Back then I did not really understand how Adobe Flash Builder worked, which caused me to do some things to create bugs and, well, the embedded font just disappeared. I like the font so much, since it looks like chalkboard writing, that I am trying it again. This time I embedded the font in the main running "application class" and then was able to call it within SceneOne and SceneTwo. Here you can see it in both the "User NameTag" at the top of the screen, and in the words "This is Scene Two"


PAGE NUMBERING - Something else you might notice in the upper/left corner is the text "[ 2/ 2]" which acts as a page number. It stands for "page 2 of 2 total pages." It will serve as a page count to tell the student how far into the assignment they have progressed. But the page numbering is merely a side-effect of improved scene tracking.

BETTER SCENE-TRACKING - I realized that I would need to be able to keep track of HOW FAR a student progressed within a lesson incase he/she decided to go BACK several scenes/pages. Why? Because they should be allowed to hit "fast forward" to jump ahead TO THE POINT WHERE THEY LEFT OFF, even if they don't yet have full access to the entire lesson. Now I have three variables: sceneOnStage (which is the scene/page that is currently shown on the stage), sceneTotal (which is the total number of scenes/pages in the particular lesson), and sceneMax (which is the maximum page number the student is allowed to fast forward to.) Not only does this make it easy to display page numbers and total number of pages, but it makes it easy to determine when the "fast forward" button is dimmed/disabled.


The code above is from SceneTwo, but it is identical in SceneOne. It checks to see if the current scene on stage is equal to the maximum number of scenes that the student has reached. If that condition is TRUE then it (1) disables the Forward button, and (2) sets its alpha to 0.2 which dims it. This works nicely to automatically disable the Forward button on the very last page of whatever lesson I make because all I have to do is set the sceneMax to the total number of available pages.

Time: 2 hours

No comments:

Post a Comment