Archive

Tag Archives: Actionscript 3.0

This assignment was relatively short and quick to accomplish, however it introduced multiple new concepts of Action Script 3.0 functionality. The class was tasked with using more than one Action Script file to get the stars to appear on the stage and act independently from other actions on the main Action Script file. I could see how this can be an incredibly powerful tool to use for our final game project at the end of the semester.

I understand that every Movie Clip in a library can have its own Action Script class that can be utilized in a separate Action Script file altogether. However, I do not understand how the interaction works between the main Action Script file (in this case, Framecounter) and the Action Script file that controlled the Star Movie Clip (in this case, Star). For example, I had problems getting the star to have a random size, alpha, and placement on the stage. I later found out that, to accomplish this, I had to put the descriptions of the var W, X and Y on the Framecounter AS file rather than the Star AS file. Additionally, I had to include the letters W,X,Y inside the function for star on the Framecounter AS file rather than on the Star AS file. This was not intuitive to me when I first approached this assignment, and I wonder what other interaction between MovieClip class AS files and their Main AS files will be in the future. Below is a screenshot of my Framecounter AS file for clarification of what I mean. Additionally, to observe what my code accomplishes, check out the SWF here.

This is the Framecounter AS file I worked with. The portion of the code I am having trouble conceptually understanding starts from the onAddStar function to the end of the code.

 

This assignment showed me how little I have really remembered from loops. Often I find myself looking back to previous assignments code to remember how to accomplish certain things I know I had done before. Unfortunately, that only works up to a certain point with these assignments because there will always be something new to learn from Flash. At that point, I usually have to go to outside resources, however I found with this with this assignment I just had to think a little outside of the box to learn how to make the code do what I want it to do. Still, I quickly realized that I become truly helpless when I do not know what to search in Google when I want to accomplish something.

Although I relent at looking outside for help to accomplish something because it is so rewarding to realize you accomplished something by yourself (my pride can sometimes keep me from seeking help), it also shows what I am lacking in my coding skills, and I can internalize more things when I make these mistakes.

This is the code I used for my assignment. It ended up being a lot more simple than I expected, as usual.

 

https://dl-web.dropbox.com/get/Coders/Harjot/LetterMadness/letterMadness.swf?w=84dd9517

 

This assignment illustrated how far I have really gotten with learning how to code using Action Script 3.0 on Adobe Flash Professional CS6. At this point I have a lot of the code memorized that I need to start with. I also almost mechanically know how to start a new project efficiently so that I will not have to go back to the project later to change anything. I found that all of the things I did from memory were things that I directly learned from past mistakes. I make mistakes with every project I attempt, however I have been able to synthesize the information I learn from the mistakes I make well into making other projects work. That is probably the reason I finished this assignment relatively quickly – it took about an hour for me to complete.

This is the code I used. It surprisingly worked almost flawlessly!

The mistake I made with this code is the mistake of making the class name of the button the same as the instance name of the button. Once I changed the class name of the button to something different, the error went away. I found this to be my error by doing a Google Search of the error code number. Overall, I was very satisfied with this assignment.

Here is the end result: https://dl.dropbox.com/u/110092052/Harjot/MadLibs.swf

This assignment once again showed the importance of keeping your peers close while attempting to conquer ActionScript 3.0. This assignment took around two hours to complete, but the most important part was that I actually completed it! I started out like I usually do – by going back to the Rex chapters and reviewing the code we need to accomplish our goals. I feel like I may be using Rex as a crutch, but hopefully some things will become natural to me as I continue to code and I will not have to use Rex for code advice anymore. I do wish I took out the time to find a more condensed version of coding reference tools, however midterms did not let me explore this possibility as much as I should have.

The problems I encountered while tackling this assignment include trying to figure out how to get the if and else functionality to work. For whatever reason, my code was not recognizing the word self, which continued to be a pain in the neck. In the end, as per the advice from a peer, I solved the problem by jumping ahead and using an array to generate responses based on a random number generator. This was much easier to manage and made my code much shorter and succinct than I thought. The code I ended up with is shown below. The array is at the bottom of the screen.

This is my end product code. I was glad to have finally got it to function correctly!

This assignment was definitely one of the more frustrating assignments, and it probably would have taken a much longer time to complete if Kauveh, Josh, and Matt hadn’t been there to share what they found out about Rex and his faulty instructions. Thanks for the help guys!

I am only a little excited that I made my first game, because this game is probably the most boring game ever. But applying concepts is always the best way to learn things for me, so I can’t complain.

This is the .fla file I used. Because this course involved new information, I was not able to focus on the GUI as much as I would have liked to. 

This is a picture of some of my code. I love that the code tries to be as visual as can be by including colors and keeping spatial relations between strings and methods.

This assignment took me about 2 hours to complete. I had difficulty with how Rex explained things, and often he left out to do important things for our file that I only found out we had to do because my peers advised me to. For example, I found that embedding the font is necessary to make the text show up properly. Rex only noted those things as an aside. I do not like how many functionalities Rex mentions for the sake of it. I feel like if he were to include it in his chapter, we should put it into direct use. Otherwise I will not actually not know what to do with that information. But then again, it could have been my brain being fried by midterm week.

I definitely hope Rex will make more sense in the coming chapters.

This assignment proved to be a bit of a letdown. I incorrectly assumed that we would be making a bit more headway with ActionScript 3.0 with Rex Ver Der Spuy in Chapter 2 of his book Foundation Game Design With Flash. I felt as if much of what he taught in this chapter excerpt included things I had learned before previously via Lynda.com videos and the textbook. Granted, I did not finish the entire chapter due to time restraints, and I am sure that as we move along with Rex Van Der Spuy, I will learn as much as I expected to in this assignment. I suppose that I got excited when the chapter began by saving the file in a different way and by changing the workspace to the Developer mode. 

I had a hard time figuring out exactly what making symbols that were pages meant. Once again, this may be because I did not finish the chapter, but I became frustrated at the end when the text instructed to make two new pages, rather than specifying why we were calling these symbols pages in the first place. I suppose I wish i had a more theoretical understanding of why I was instructed to do all of this in the first place rather than just blindly follow what the text was instructing me what to do mechanically. Regardless of these frustrations, I completed the assignment in about an hour. It helped to already have a working knowledge on shape manipulation and symbol design. This probably is what speeded up the process as much as it did.

This is the workspace I used while completing this assignment. I used the Developer workspace this time, and I enjoyed how easily I could re-integrate myself into the different workspace.

I was completely annoyed with the naming conventions that Rex used to name his layers, symbols, files, etc., and I refused to use them out of a weird sense of morality and loyalty to what Dr. Delwiche instructed the class regarding usual naming conventions. Contrary to what I was taught, Rex consistently capitalized the first letters of each word. I suppose it should not be so unconventional to me; after all, he was consistent with how he named everything. I just assumed that every game designer/programmer follows the same naming conventions as what I was taught.

When Rex calls something an instance of a symbol, I assumed he meant every time a symbol is used in the file as a whole. I thought of it as having one distinct symbol that is simply used multiple times in multiple places, and the best, most concise way of depicting that in words is just to simply call it an instance. At least, that is how I automatically interpreted his use of the phrase.