Sunday, April 21, 2013

Play/Pause/FFWD Buttons

Today I got to work on the main control buttons that will be at the top of the main frame.

First I spent a couple hours just designing/drawing the buttons using Photoshop. I made three images for each button: (1) button DOWN, (2) button UP, and (3) button HOVER (for when the mouse is hovering over the button)


Then I worked in Adobe Flash Builder to make a sprite/class for each button with all of the controls to: (a) switch button images when required by the mouse, (b) signal a "click" sound when the button is pressed, and (c) dispatch the specific button press event (ex: dispatchEvent(new Event("buttonPausePress", true)) so that whatever has to happen because of the specific button press can happen (which, I have not as of yet programmed, of course! Today I am just "sending up the flags"!)

Here is what the first scene looks like after the student "DENNIS1" logs in.

In this example the student did not enter the correct two-letter code to match his log in name so he only has Level One access to the program. Therefore the "Fast Forward" button is dimmed out and useless to this student. After the student completes this tutorial he will be given one of the two letters to unlock the fast forward button(s).

Note: In the example above I am currently pressing down on the "Rewind" button but you can not see my mouse cursor (hand pointer) because "prt sc" doesn't capture the mouse pointer. (But at least you can see what the button looks like when it is being pressed.)

SAVING LOTS OF MEMORY: Today I discovered that I was using a LOT more memory in my programs than I needed to. According to the Game Design book that I am using my images had to be saved as"web ready" .png format files, or, at best, .gif files. So I had been using .png for ALL of my images, including the large blue frame image (600 kb) and the background chalkboard image (300 kb). However, I was able to turn the blackboard image into a .jpg, and the blue frame image into a .gif (the center is transparent, of course, so jpg wont work). Now my TOTAL .swf file size is UNDER 200kb at the moment (when it USED to be almost 1MB!)  You want your .swf file to be user-friendly so keeping it a manageable size helps.

Time: 6 hours

No comments:

Post a Comment