Tuesday 5 October 2010

Building my front end

The development work that I have covered during lesson:
This lesson I had to start building my actual front end. To do this, I had to open a blank document in Flash, I then had to create 4 layers, each layer designed for a different screen, IE scene selection or extras. I then had to create 4 basic square shapes each on the separate layers, this is because if I didn't create the shapes on separate layers if i try to move a shape it will move every shape on the screen. I then had to change the instance names of the forms so that i could then code these forms. Once I had made these shapes, I then had to import any images that I wanted to use in the front end in into the library, i then dragged each of the images that i wanted to use onto the correct layer. I then had to insert the buttons that I wanted to use on the screens, to do this I had to click on the window tool at the top of the page, and then scroll down to the common library section, I then clicked on 'buttons' this brought up several categories of buttons that were available for me to use. Once I had inserted the buttons onto the correct forms i then had to code these buttons, I did this so that I could then start to link up the buttons on each form so that I could load each form from another form such as 'scene selection' to 'options'. I then had to change the instance names of my buttons, this is because to start coding the buttons each button must have its own instance name, for example btnToScreen2.
The code shown below is the code that i had to enter into my code layer so that i could start to link buttons and screens together. Firstly, i had to make sure that all of the instance names of the buttons on screen 1 was correct, for example btnToScreen3 (screen3 is the 'Extras' screen). This line of code that is displayed below is the declaration. The line of code itself is telling the program that from screen 1, when the button is clicked, it will take the user to either screen 2,3 or 4.
frmScreen1.btnToScreen2.addEventListener(MouseEvent.CLICK, openScreen2From1);
funcion openScreen2from1(evt:Event)
{
if (frmScreen1.visible==true)
{
frmScreen1.visible = false;frmScreen2.visible=true
frmScreen2.x=1
frmScreen2.y=1
}
}
The piece of code above is the subroutine piece of code. This piece of code is asking the program to perform an action, the code is asking the program to load Screen 2 from Screen 1 when the button is pressed. The piece of code also tells the program what dimensions to load the screen at when the screen is loaded.
How this met the client brief:
This met the client brief because the client brief states that my front end must be interactive, by adding buttons to my screens the user can switch between the screens making the front end more interactive.
Skill Number:
14, 15, 16 and 17

No comments:

Post a Comment