Squeaky Clean

This assignment was both difficult and yet very eye-opening. I managed to try new coding combinations to get the sentences exactly how I wanted them. I have fallen in love with the “split()” and “join()” functions, and used them both to get exactly what I wanted. I have also become incredibly enchanted with the idea that one can write the name for the function, and then do a long list of things to that passage simply by adding “.” to the end of it. I ended up learning how clean these codes can look by having what would otherwise be lines and lines of messy code and is now simply one long line of code.

Flash Interface

This is my final for-loop code and the code above it to get the proper letter out based on the button pushed. I think it looks very clean. I like clean codes, they’re much easier to read.

The most difficult part was figuring out what needed and what didn’t need to be said in the code for the for loop. That took me a long time to figure out the syntax. I wish APIs were not done in such confusing language, but alas, I must learn how to speak like the reference guide. I’m excited though to start on the hangman game- I just hope I don’t get too caught up in design that I leave myself no time to actually work on the code!

I am trying to get the link to the public viewing of the final file, but unfortunately (It’s either my computer or Dropbox), Dropbox is being a little bit of a butt. There must be some system maintenance going on. I will link to my final letter madness flash creation once it starts working again or I can get on the computers in the communication lab.

 

Edit:

Here is the link to my final product.

Only Pushing Some Right Buttons

For this assignment we had to hook up seven different buttons, all that would do something different to the passage above. My final project is located here. I ran into a few problems with this assignment, and I’m not sure how to fix them and I couldn’t quite find a solution. Every time I tried to find one I would end up confused and the language of the text or websites that were offering help would be too high for me to quite understand at this point with all this technical jargon.

Flash Interface

This was the point where I decided to try and make it so the computer counted how many letters there were without spaces. “O” is the letter that was with spaces, “a” is the letter without spaces. I still don’t know how to make it change when the word “We” is replaced with “ponies”.

My first error that I couldn’t solve involves changing more than one instance of “we” into “ponies”. I was trying to think of the best and easiest way to do this, but I couldn’t think of it. I was contemplating a for-loop, but I still don’t quite understand the boundaries of a for-loop’s ability. The second error that I had, one that again I’m not completely sure if I’ve even diagnosed correctly, is the “find x Letter” command. I can get the correct letter to come out (if I remembered to change the number in the code back to 83 after trying my debugging tricks- if not I apologize!), minus the spaces. I turned it into an array, removed the spaces, then put it back into a string. I got the 83rd letter and then I realized it: That letter, nor does the character count change when changing “We” to “ponies”. 

I had to wonder for a bit what caused that problem. Is is the computer going back to the original passage and not acknowledging the previous changes? That’s what I thought, and still think, but I’m not sure how to fix that. How to make sure the computer knows to apply the changes to the new passage and not the original one. Any ideas on how to fix that?

A Speed Bump and a Wall

flash interface

This is when I was starting out the program. I had a little bit of code working and I was making sure that the word would come up at random along with the counter of how many letters it had.

This assignment wasn’t easy, but it wasn’t the most difficult thing I’ve done which I am very, very grateful for. My final project, by the way, is here. Now, let me delve into the nitty gritty details of why there were some points in which this project absolutely confounded me and made me wish that the computer would so kindly stab itself.

The first problem I found myself having (well, not the very first one but the first one that I couldn’t solve easily) was changing features of a particular instance of a symbol. I had eleven boxes (on hindsight, don’t know exactly why I did this since no word I used had eleven letters, but whatever) and I needed to change the number in each one. I pressed “ctrl” + the item and dragged a new copy onto the stage. However, when I went to change the number– naturally all the numbers on all of the instances changed. I couldn’t figure out how to make it so each one was a separate entity- even after giving them all different names. So I had to go back and just make eleven symbols by hand. That was fun.

Flash Intreface

This is where my problems began. I had to go through by hand and make ten copies of the one square, change the number in each one, and give it an instance name. In that I ended up making a few errors (that I caught easily) but it shows how flawed that system is.

The other problem I had involved the counter that counted the clicks. I don’t know what I was doing wrong- and theoretically I feel the code should have worked. When I had help in writing a new code, I tried to plug in what worked from that code into the code I had written earlier and I still got the same message. I forgot the message but it’s the one when it’s claiming something is unnamed and it talks about sprites and flash.movie clips and other confusing things. In the end, I just went with the reworked code and commented out what I had been hoping to have work. Unfortunately, now I have a number in the upper left-hand corner and nothing to indicate what it means. It bothers me and I really wish it would have worked putting “Clicks: ” + clicks.

Captain Mal Would Have Fun With This MadLib (Hopefully)

The inside of the flash workspace

This is what my final mad lib looked like after the words were entered and the button was pressed. The current button is the reset button.

This weekend we had the assignment to create a mad lib program. A user would enter in at least four different types of words and then press a button that would generate it into the story and generate four words at random in different spots. I decided to have a little bit of fun with mine as I made it Firefly themed. The program itself wasn’t difficult, I learned long ago that the best way to code is to look at old codes that worked and reuse the same code but change what I need. Honestly, if I was asked to write down all the code by hand on a test I would probably fail. However, I have gotten relatively good at puzzling the pieces I know together to create something that works.

The color scheme was one that I felt matched the television show Firefly by Joss Whedon. It has a western feel to it, the buttons containing quotes from the characters of the show. The words were taken from a summary of Firefly from TV.com. I originally was going to make the title into dynamic text to give it an instance, but I couldn’t think of a good reason to do that. I didn’t need extra instances of the title, and so I didn’t create an instance for it and I didn’t call it. I guess I’m not really sure when calling something on start up of a flash program is better than just having it on the stage to begin with

Flash Interface

The early stages of the code. This was before the story was entered or anything else was entered really. It was setting up the button and getting things to work.

I didn’t have much difficulty with the code part. In fact, the most difficult part for me was figuring out the text and which words to remove. Remove the wrong word and the summary wouldn’t make sense with a word the user would enter. Another thing that confused me with arrays and strings was that when calling the number of the word and putting it in the summary, “.text” wasn’t needed for some reason. I guess I don’t quite understand that part either. Here is the link to my madlib.

Magic 8 Ball says: “You’re on your own.”

Code that results in an error message

I don’t really understand how to fix this bug. I was trying to use recursion, but I don’t think I did it correctly.

I enjoy assignments like the one I had today. Why? Because it gives me an opportunity to have a ton of fun with snippy comments, allowing the computer to be the one to blame. Our assignment was to create a magic 8 ball program that would answer a question with one of five different answers. We had a sample magic 8 ball Flash program to model after, and so I tried to model the best I could.

Then I fell into problems. Not too big, a few of them were difficult to solve but more of them were not. I had to remember how to define each var and how to call upon them. I became close with a lot of commands such as “.text”. I also became a fan of obnoxiously bright colors for buttons. However, some problems did take me longer than I would like to admit to figure out and I had to stop with still one issue unsolved.

Character section of Text

Took me so long to figure out how to fix this. Please don’t judge. Honestly, the alpha percentage was the last thing I thought that could be wrong.

So the biggest issue I think was caused by someone else using my work space. Okay, okay, so that’s a bit territorial seeing as these are computers that other students use, but when I opened Flash there were a few things I had done that had been changed. I noticed three different changes that were not that way on Monday. First thing I noticed was the “permit debugging” option in the publish settings was turned off. I know it had been turned on before since my Professor had helped me figure that out. Second, for some reason my preview of my magic 8 ball was opening in a Firefox window, rendering trace commands useless. Thankfully, I had a friend in the class help me figure out how to fix that. Third, something that took me much longer to figure out than I care to admit, someone turned the alpha on the text color down to 0%. It took me a good while to figure out why the text wasn’t showing up.  At the place I ended, I managed to get the program to generate a number as soon as the “ask” button was clicked. On that, the two bits of dialog would appear at the bottom and the random number would then go through a series of “if-else” statements to find the answer that matched the number. That response would be returned. I then had it where the “ask” button would vanish and a “restart” button would appear. While the person could go through and press the restart button and start again, for some reason after the second time I got an error message that I couldn’t debug. I’m not sure how to fix it. Any ideas?

Maybe it’s Aliens, Maybe it’s Actionscript 3.0

Actionscript Code

This is the code that I had after page 23 of Spuy’s tutorial.

The assignment for the weekend was to go through chapter 5 of Rex Van Der Spuy’s Foundation Game Design With FlashI was concerned about how long this would take. After a computer science course, seeing “GUI” meant headaches and planning to length locations for boxes and pixel creations. Frustrating days of importing things that were later deemed useless and whiteboards being wiped clean of their marks. Long nights in the Computer Science building needing help from the tutors and the TAs.

I was concerned- thinking there was no way I could do the list that was requested. Our professor had requested that we start as early as possible. Unfortunately, that wasn’t possible for me. As of 2:20 on Friday I had left for Tulane in Louisiana for an Equestrian competition. I got back Sunday night and started on Monday as soon as my classes were over. Thankfully, the tutorial helped greatly. It was easy to understand and I managed to get done in roughly an hour and a half.

Screenshot of the Flash Interface

This is my final product with the strange numbers at the bottom. What do they mean?

The tutorial wasn’t hard to follow and I didn’t have many problems. One of the main issues I had wasn’t really an issue, but there was a solution to it in the tutorial. Every time I entered a number into the field I would automatically press Enter. Unfortunately that lead to issues with even the correct number being registered as correct. Once I made the computer listen to the enter key, that problem was solved. However, a mystery appeared. The mystery was in the other numbers that appeared in the output section at the bottom. I’m not sure what they do and I know they aren’t the numbers I entered. What are they indicating? They only appeared after I hooked up the enter key command.

One Button, Two Buttons, Yellow Button, Gradient-Fill Button

Flash interface showing code

Here is some of the code that was basically spoon-fed to us. Not that I’m complaining.

This weekend’s homework involved working through the rest of chapter 2 and all of chapter 3 of Rex Van Der Spuy’s Foundation Game Design With Flash. I very much enjoy working through these tutorials by Spuy, as I find he’s writing in as simple terms as possible and the errors I make are errors made on my side versus lack of clarity on his side. The homework went much smoother than I thought it would. I was able to finish in roughly two hours without getting too stressed out. Thankfully, I had a friend help me out when I did get stuck. I found out the hard way that Flash is particularly picky when it comes to naming conventions of course, having taken classes in programming this isn’t a surprise but that makes it no less frustrating.

Flash window open in front of the Flash workspace

And the end of the tutorial this is what I had. Not too shabby if I do say so myself!

There were a few times when I would get an error message and I would have no idea how to fix it- so I would ask Don how he fixed it. It was a simple error in naming the files without capitalizing the “m” in “Main” as was written in the code. I guess this goes into what I learned on my first day of Principles of Programming with Dr. Lewis: Computers are ultimately incredibly stupid. They can only do what you tell them to do- exactly what you tell them to do. In this case, I was telling Flash to connect the file “interactiveStorybook” with the file “Main” but the only file that existed was “main” and so the computer said “Sorry. Can’t find it.” Another small issue I had that I can’t seem to solve is when I press the “back to start” button to go back to the start page, the two buttons going to the hill and the pond are stuck in the yellow color they are when the mouse hovers over them. Any idea how to solve it?

Though I have had experience with programming before, I am a little bit nervous still about programming in the future- especially in a new language. I’m a little worried about spending hours on hours trying to figure out how to work with arrays and lists (both I absolutely despise) in order to get a game working right. It’ll be fun though.