These are the currently uploaded final projects for GRC33 Spring 2012 semester. If you have uploaded your project folder but do not see it listed here or if it is here but does not work please see me BEFORE the presentations begin. The final must be working and submitted before the presentations begin in order to receive full credit.

aguilar_k_final
bailey_d_Final
bourdase_j_final
christensen_w_final
cooksey_j_final
edwards_h_final
ferrer_i_final
guevara_m_final_project
hernandez_f_final
muhammad_k_final
parra_v_final
salas_r_final
singkhoumkhong_a_final

Here is the lecture of Part 1, First Flash Web Site…(edited)
First Web Site, lecture part 1

First Web Site, lecture part 2

These are the currently uploaded final projects for GRC33 Fall 2010 semester. If you have uploaded your project folder but do not see it listed here or if it is here but does not work please see me BEFORE the presentations begin. The final must be working and submitted before the presentations begin in order to receive full credit.

20_dreamweaver_upload_site
grc33_spring2011_conway_d_final_project
grc33_spring2011_cosca_n_final_project
grc33_spring2011_domingo_f_final_project
grc33_spring2011_egan_c_final_project
grc33_spring2011_honhongva_r_final_project
grc33_spring2011_loyd_j_final_project
grc33_spring2011_mccoy_p_final_project
grc33_spring2011_monis_b_final_project
grc33_spring2011_palomo_r_final_project
grc33_spring2011_rivera_j_final_project
grc33_spring2011_rodriguez_a_final_project
grc33_spring2011_schwabenland_m_final_project
grc33_spring2011_velasquez_j_final_project
grc33_sring2011_ricardo_a_final_project

This project will show you how to dynamically load external text from a text file into a TextArea component inside flash. There are some new concepts we will touch upon that will be explained more fully in future classes.

The UILoader component has a source attribute that, when set (e.g. uiloader.source = "bob.jpg" ), begins the loading process to load an external asset like a jpg or swf file. Once the loading is complete the file is displayed inside the UILoader box.

The TextArea component, however, does not contain this built-in functionality. We must create a loading process to load the text file. Then, once the file is loaded, we set the TextArea’s text attribute to the loaded content. At this point the TextArea component will then display the text and add scrollbars if the text goes outside of it’s set bounds.

Setup

  1. Create 3 layers named “AS”, “navigation” and “content”

Create Navigation

  1. On the navigation layer drag 3 buttons from the component window (Window -> Components + User Interface -> Button)
  2. Give each an instance name of “pica”, “picb” and “picc”
  3. Select the first button and in the properties panel choose the “Component Inspector”(three little colored boxes icon)
  4. In the component inspector change the value for the Label field to “Pic A”
  5. With the component inspector still open select the second button on the stage and give it a title of “Pic B” – do the same for the third button, “Pic C”
  6. Now drag-select all three buttons and hit the F8 key to create a new symbol with the selected objects
  7. Give the symbol a library name of navigation – make sure the drop-down is set to “movieclip” – click OK
  8. Click on “Scene 1″ up in the breadcrumb trail to make sure you are back in the main timeline
  9. Select the new navigation symbol on the stage (one click) and give it an instance name of “nav”

Create TextArea

  1. Select the “content” layer and from the components window drag the TextArea component onto the stage.
  2. Give it an instance name of “the_text”
  3. Set it’s width to 350, height to 200, x to 150 and y to 100

Create ActionScript

  1. Select the “AS” layer
  2. Open the Actions panel to type your actionscript
  3. Enter the following AS:

  4. Now create 3 text files (use lipsum.com and a text editor, Notepad on the PC and TextEdit on the Mac). Save the files into the same folder as your fla file and name them “pica.txt”, “picb.txt” and “picc.txt”

You are finished! Test should load the text file when you click a button.

You can combine Class 13 and Class 15′s projects by simply adding the UILoader onto the content layer, giving it an instance name of the_loader and adding the following line to your doStuff function:

In this project we will use the prebuilt Button and UILoader component to load an external image into Flash.

Setup

  1. Create 3 layers named “AS”, “navigation” and “content”

Create Navigation

  1. On the navigation layer drag 3 buttons from the component window (Window -> Components + User Interface -> Button)
  2. Give each an instance name of “pica”, “picb” and “picc”
  3. Select the first button and in the properties panel choose the “Component Inspector”(three little colored boxes icon)
  4. In the component inspector change the value for the Label field to “Pic A”
  5. With the component inspector still open select the second button on the stage and give it a title of “Pic B” – do the same for the third button, “Pic C”
  6. Now drag-select all three buttons and hit the F8 key to create a new symbol with the selected objects
  7. Give the symbol a library name of navigation – make sure the drop-down is set to “movieclip” – click OK
  8. Click on “Scene 1″ up in the breadcrumb trail to make sure you are back in the main timeline
  9. Select the new navigation symbol on the stage (one click) and give it an instance name of “nav”

Create Loader

  1. Select the “content” layer and from the components window drag the UILoader onto the stage.
  2. Give it an instance name of “the_loader”
  3. Set it’s width to 550, height to 400, x to 0 and y to 0

Create ActionScript

  1. Select the “AS” layer
  2. Open the Actions panel to type your actionscript
  3. Enter the following AS:
  4. Now create 3 jpg files sized at 550×400 (use morguefile.com and Class 12 image calculator). Save the files into the same folder as your fla file and name them “pica.jpg”, “picb.jpg” and “picc.jpg”

You are finished! Test should load an image when you click a button.

Combining Multiple Images Into One Layered Photoshop File Using Bridge

  1. Open Adobe Bridge
  2. Navigate to the folder that contains the images you would like to combine
  3. Select all the images you wish to combine by holding the SHIFT key and clicking once on each image until all the images you want to combine are selected. Let go of the SHIFT key :)
  4. From the menu in Bridge choose Tools -> Photoshop -> Load Files Into Photshop Layers
  5. Bridge will open Photoshop and assemble all your images so that they stack one on top of the other as individual layers
  6. Save your new PSD

From this point you may now try different layer transforms and adjustments to create a composite image.


Calculate Original Crop for Correct Final Scale Size

This will require a little math and some trial and error to get it right. The point of cropping before scaling is so we can use “Save for Web”‘s superior compression instead of Photoshops “Resize” to scale the original image into a predetermined size that is of different proportions.

Let’s say you have space on your design for a 500px wide x 250px high image. However your original image is 1000px x 1000px. If we “Save for Web” and set the width of the final image to 500px wide the height will scale proportionately to 500 also (1:1 proportion on the original). But we need our final image to be 500px x 250px, not 500px x 500px.

In order to accomplish this using “Save for Web” we must first crop the original so that it’s proportion (width vs height) matches our final size proportions. Then when the image is scaled it’s dimensions will fit the final image size requirement.

Let’s say we have an original image that is 350px wide x 250px high (written as 350/250) and our final image needs to be 250px(w)/150px(h).

First off calculate your proportion value (PV) by dividing the height by the width of your final image. ( 150(h) / 250(w) = .6)

The proportion value helps us to decide which side of our original image to apply the proportion value. If the PV is less than one then you apply the width formula. If it is greater than 1 then you apply the height formula.

The width formula is W*PV=H
The height formula is H/PV=W

So, in our example .6 is less than 1 so we will use the width formula.

350px(w) * .6 = 210(h)

This means we will need to crop the height of our original image to 210px making our original cropped image 350px(w) x 210(h)

One exception to these rules is when the width/height difference (determination value, DV) of the original image is greater than a factor of 2 (width / height = factor). If we had an original that was 550px(w) x 250px(h) then 550/250 = 2.2, which is a DV greater than 2 and would mean our formula choices would be reversed.

So If the PV is less than 1 and your DV is greater than 2 then you apply the HEIGHT formula. If the PV is greater than 1 and your DV is 2 or less then you apply the WIDTH formula.

This would mean our 550/250 source image would use the HEIGHT formula if the scaled destination image is 250/150.

To crop an image in Photoshop choose Image->Canvas Size.

Then choose file->save for web to create your final scaled image.

Flash is not so great at animating stuff. But unless your Web site is just a continuous animation you’re going to have to provide some kind of control to your site user. And, if you provide control to your site user, you’re going to need to use ActionScript to accomplish that.

ActionScript 3 is the preferred version of ActionScript for Flash-based Web sites because it fully takes advantage of the functionality of Flash Player 10. You can still do stuff in AS2 or AS1, but why? You wouldn’t make a new car that only went 55 miles an hour. Make it go 100!! No on will ever use that much speed (legally) but it means that the mid range of speed where the rest of the world drives is fully optimized and not overworking the engine.

OK, Speed Racer© examples aside, here is a rudimentary introduction to ActionScript. We will reference this often.

Statements
A statement is a complete directive that is evaluated in one line. It ends with a semicolon.

A directive is like a command. “Billy, get me the remote.” or “Sally, paint my house.” are directives. It is an order to do something and it’s directed at/with/to someone/something – hence the term directive.

This will evaluate to 11. The PLUS sign is the action and the 5 and 6 are the values to act upon. This is a single directive in a single statement.

A statement will contain a directive (or multiple nested directives) to do something or change something or set something …etc

This will evaluate to 11. However, there are two directives(actions) here. The 5+6 and the trace() command. Flash will evaluate 5+6 as 11 and then send that value to the trace() command. The trace command will, in turn, output the value it receives to the output window when we test this (CTRL+ENTER).

You could split these two directives into two complete statements:

In this case we set the value of the 5+6 directive into a variable (which we’ll cover later) named elEven. We get the same value in the “output” window as above:

Flash will evaluate a statement at run-time, do as it’s told and then move on.

Functions
A Function is a collection of statements. You can place one or many statements inside a function body.

A statement is evaluated immediately at runtime. A function must be called by it’s function name in order for it’s body of statements to be evaluated. The function call is a statement directive. I know. it hurts my brain too.

In order to call a function we must define it first with a function declaration. The declaration does not need to be on a line number ahead of the function call. But it must be on the same or earlier frame number. All ActionScript on a particular frame number executes at the same time. So, as long as your call and declaration occur at the same frame number you could have them on separate layers…if you wanted to do it wrong, though it would still work.

The function declaration is broken up into two parts: a head and a body. You would not get a whole lot accomplished without your head; nor would your head be any good without a body to put thoughts into action. The same is true for functions. Here is the declaration head:

Here is the head with it’s body. Marvel at your creation.

Those two forward slashes is how we “comment” out a line. It’s for adding comments that help us remember what’s going on but we can also use the comment slashes to hide a real statement from flash if we need to diagnose something.

Here is the full function with an actual statement:

When we test nothing will happen though. The reason, if you will remember back a few paragraphs, is that flash will not evaluate statements in a function until the function has been called. We must call the function in order for the statements to be evaluated and executed (run). Here is the full function call and function declaration:

Now if we test this we should get the following in our “output” window:

Flash will perform the function by evaluating the statements in the function. Flash will then evaluate the function’s return value and any surrounding directives outside of the function call.

What’s a “return value”? A return value is basically output from the function. All functions perform some action but the function can also send a value back to where it was called. An example would be a function called <code>ageMe</code> that you call, including the year you were born, and the function returns your age based on the current date. Here’s a simpler example:

Instead of a trace command we are using the key word “return”. This tells flash to return the value or object that is after the word “return” on that statement line BACK to where the function was called. If you could see the actual code running you would find the string “Hey, imma let you finish.”; where the function call doThis(); used to be. Nothing would be sent to the output window because only a trace command can do that.

However, if we place the function call inside of a trace command then we can see the output:

So, when the statement on line 1 is evaluated Flash sees two directives, a function called doThis and a function called trace. It performs the doThis function first, which returns the string “Hey, imma let you finish.” This replaces the doThis function call and then Flash executes the trace function with “Hey, imma let you finish.” as it’s parameter.

Please visit the following link for directions to activate your FCC spam filter.

http://online.fresnocitycollege.edu/studentemail/junkemail.asp

Here are a few things to be aware of this semester…

  1. You are required to bring a usb/thumb drive to every class. 2GB will be sufficient. It’s a good idea to make sure that your drive is empty before using it in class. We are in the Mac lab this semester and we have had to format some drives in previous semesters.
  2. If you are unable to make it to class please email me with the reason if you wish for it to be an excused absence.
  3. If you are absent on the first day of class you will be automatically dropped (State rules, not mine) so please let me know if you can’t make it so I can hold your place.
  4. My email address is jason DOT cooksey AT fresnocitycollege DOT edu (uppercase should be translated to the actual character).

  5. The class has a Facebook page at http://www.facebook.com/FlashforWeb if you are interested. Its for sharing interesting Flash-related stuff.

Looking forward to meeting all of you on Tuesday!

Cheers,
Jason

Your Web site is not a Web site until it’s on teh internets. That’s why the class is called Flash for Web.

“We gotta look legit man!” -Uncle Rico

We have used Dreamweaver previously to connect and upload a project to the FresnoGRC.org Web site. Submitting our final will be very similar. Please make sure that you have read and followed ALL instructions in the FInal Project PDF that was handed out. See GRC33 Final Project for more info and a link to said PDF.

1. Verify publish settings in Flash
In Flash choose File->Publish Settings from the menu. Make sure that both the Flash and HTML boxes are checked.

flash publish settings

Flash and HTML are both checked

2. Choose the Publish button to publish your project.

publish button

The Publish button in Flash

3. Un-check HTML in publish settings and then click “OK”

uncheck HTML in Flash publish settings

Uncheck HTML in Flash publish settings

4. Rename project HTML file
In File Explorer/My Computer(Windows) or Finder (OSX) locate the final project files on your thumbdrive. Rename the file “grc33_fall2010_lastname_firstinitial_final_project.html” to “index.html“. Rename ONLY the HTML file, not the SWF or FLA.

You can rename a file in Windows by selecting it with one mouse click and then hitting the F2 key. On OSX select the file with one mouse click and then hit the “Enter” or “Return” key.

5. Launch Dreamweaver

6. Import the .ste file
From the menu choose Site->Manage Sites.

manage sites

Choose Site->Manage Sites


Then choose “Import”
import ste file

Choose Import to import the .ste file

It will ask you to locate the .ste file. I will place the .ste file on your desktop. Click OK after you find the site.

7. Choose your named folder – not the final folder – as the root folder when prompted by Dreamweaver
Dreamweaver will ask you for the location of the site’s files on your computer. The .ste file was built with my files and folder names and yours will be different. Use the provided file viewer to locate your named folder (lastname_firstinitial). Select your named folder (not the Final folder) and click “Choose”.

It will ask for the “images” location, just choose the same named folder again. Click “Choose”. Then click “Done” on the Manage Sites box.

8. Test the connection
Choose Site->Manage Sites from the Dreamweaver menu. Select the site you just imported and choose “Edit”. Choose “Remote Info” from the Categories list. Click OK if you get a warning about the images folder. Click the “Test” button.

remote info

Choose Remote Info then Test


You should receive a confirmation that you connected successfully.

9. Select your final project folder and upload
Select your final project folder in Dreamweaver (one click) then upload this folder by clicking on the UP arrow button (put files).

upload folder

Click the UP arrow button to upload

10. Go to GRC33 2010 Fall – Final Projects to verify that your folder was uploaded and that your site loads