Project 1 - Media Player
Hoo boy. And I thought Mini-Project 2 was bad.
The media player wasn't too hard, actually, but it was very time-consuming because Flash does not give good feedback error messages like Java does. Half the time my problem was with illegal scope or mistyped variable names, and Flash just didn't tell me.
I had a hard time with the arrays and finally gave up on trying for 2D arrays. I don't see any reason WHY a 2D array is necessary, but Flash did not include a structure of any sort that I could see that would have made my life a lot easier. Sure, it meant a little more codework, but in the end, I really do not care, because the end result justifies the means, in my opinion.
Having everything programmed on one frame was nerve-wracking - I couldn't see more than ten lines of code at once, and I like a lot of whitespace in my code. It's too bad I can't separate code into classes like in Java, which would have made for a much more structured code layout because, as you can see, I have functions at random places that make no sense. If I had the ability to class them, all the button functions would be in one class, the onLoad would be in another, etc etc.
This project still has a couple problems:
- The slider does not work in conjuction with the movie. It moves, yes, but it doesn't actually DO anything.
- I have the original code for the "Time elapsed" commented out because I originally intended to put the time elapsed in hh:mm:ss format, but every time the song went over one minute, the display would show 00:01:00 and stay there.
- The professor wanted 2D arrays, but I just have two 1D arrays.
- The text files do not have the height, width, or total duration of the video.
All in all, I decided to cut my losses and program what I could. The only thing that is really obvious is the slider does not work, but overall, the media player functions pretty efficiently.
If you wanted to change the location of the sound or video files, you would only need to edit either or both of these two files:
| songs.txt | movies.txt |
The syntax for both files is TITLE OF SONG/MOVIE#URL (relative or absolute)|next entry. The final entry will not have the pipe after it.