Programming Behavioral Experiments in Flash Intro to Web Programming, PhP, and Flash July 23 rd and 24 th, 2009– Jeff Galak (CMU)

Slides:



Advertisements
Similar presentations
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Advertisements

Lecture 4 Basic Scripting. Administrative  Files on the website will be posted in pdf for compatibility  Website is now mirrored at:
Endnote Tutorial The Version pictured is version 9.0 May 8, 2007.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Tips for New Mac Users 20 simple tips to make using a Mac quicker and easier.
Animating Web Graphics Using Adobe Edge. 1. Setting up your project Create a new folder on your desktop Call it [YOURNAME]infographic INSIDE THAT FOLDER,
1 Flash Actionscript Adding Interactive Actions Variables.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A.
UWWD In our quest to eliminate bad websites, we present…. HALLELUJAH!!
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Create Your Own Webpage. Today’s Agenda Cut & paste code Notepad++ or Notepad at home FTP Web Hosting Wordpress.
Review of last session The Weebly Dashboard The Weebly Dashboard Controls your account and your sites Controls your account and your sites From here you.
Chapter 17 Putting It All Together. Viewing the Preloader To view the preloader, 1.CTRL-Enter to test the movie. 2.View > Simulate Download.
SRM Community Wiki – User Guide Sign-up Edit a page Insert photo & video and other files Create pages & page menu titles Forum & commenting.
Programming Behavioral Experiments in Flash Session 3 of 3 Advanced Topics if Flash (Sounds, Videos, and Real Time Ratings) January 30, 2009 – Jeff Galak.
ACM Web Development Workshop - PHP By Luis Torres.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
CTRL + Z is your best friend. Use it to undo anything! You can even undo multiple mistakes!
© 2010 MediaMind Technologies Inc. | All rights reserved MediaMind Creative Michael Conway | Head of creative APAC July 2012.
BUILDING RICH MEDIA ELEMENTS. Design Decisions Based on Design Specification  Following the design specification will ensure that the application is.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Presentations Suitable for: Beginner Improver Advanced.
Adding Content To Your Faculty Page 1.Login 2.Create your Faculty Page 3.
Click your mouse for next slide Flash – Introduction and Startup Many times on websites you will see animations of various sorts Many of these are created.
The ePortfolio and Student Evaluation A training presentation by: Amy Cannady Robin Drewry Bonnie Hicks.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
I Didn’t Know You Could Do That in Articulate Quizmaker! Debbie Richards Creative Interactive Ideas Samples and Resources:
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
 street/ street/  Type text & download sign. (or use snipit)
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
My First ACCESSIBLE Flash Movie. Course notes Detailed course notes, a printable copy of my slides, and all the samples shown today can be downloaded.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Programming Behavioral Experiments in Flash Session 1 of 3 Intro to Web Programming, PhP, and Flash January 29 th – Jeff Galak (NYU)
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Fall 2005 Using FrontPage to Enhance Blackboard - Darek Sady1 Using FrontPage to Enhance Blackboard 1.Introduction 2.Starting FrontPage 3.Creating Documents.
Creating a Logo – Lesson 3 1 Creating a Logo Lesson 3.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
Tutorial 7 Planning and Creating a Flash Web Site.
Flash! Macromedia Flash is the key to designing and delivering low-bandwidth animations, presentations, and Web sites. It offers scripting capabilities.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
PowerPoint Taught by Gary Gabris. PowerPoint What is it? Where to get it How to use it How not to use it Q & A.
Review of last session Add text to your website Add text to your website Title Title Paragraph Paragraph Title and paragraph Title and paragraph Add photographs.
Create Your Own Webpage. Today’s Class Internet Safety & Privacy Tables Embedding music and video Frames.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
 When you receive a new you will be shown a highlighted in yellow box where your can be found  To open your new just double click.
Programming Behavioral Experiments in Flash Advanced Topics if Flash (Sounds, Videos, and Real Time Ratings) July 23 rd and 24 th, 2009– Jeff Galak (CMU)
XP Tutorial 8 Adding Interactivity with ActionScript.
Quick Introduction to creating Eyeblaster ads.  Steps for creating an Eyeblaster ad  Building Eyeblaster compatible flash assets  Adding Eyeblaster.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Programming Behavioral Experiments in Flash Session 2 of 3 Building Your First Flash Experiment January 30, 2009 – Jeff Galak (NYU)
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Know your computer Make a Folder Copy from Word to Composer Format the Font Change the Alignment Format the Background Format the Colors Insert a Picture.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Motion Graphics & Animation.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
PHP Form Processing * referenced from
XP Tutorial 8 Adding Interactivity with ActionScript.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
TechKnowlogy Conference August 2, 2011 Using GoogleDocs for Collaboration.
Flash Interface, Commands and Functions
Presenting Prezi Michael Pelitera
April 8th – Jeff Galak (CMU)
Flash Concepts and Demos - Overview
Presentation transcript:

Programming Behavioral Experiments in Flash Intro to Web Programming, PhP, and Flash July 23 rd and 24 th, 2009– Jeff Galak (CMU)

Flash Workshop - Intro to Web Programming, PhP, and Flash 2 Agenda for the Week Session 1: Thursday, July 23 rd (10-12pm) Session 2: Thursday, July 23 rd (2-4pm) Session 3: Friday, July 24 th (10-12pm) Session 4: Friday, July 24 th (2-4pm) Topics: Intro to Web Programming, PhP, and Flash Building Your First Flash Experiment Advanced Topics if Flash (Sounds, Videos, and Real Time Ratings)

Flash Workshop - Intro to Web Programming, PhP, and Flash 3 Agenda for Today Why Flash? Software requirements. How to run experiments and collect data. Components of a Flash experiment. A brief discussion on PhP. Your first look at Flash

Flash Workshop - Intro to Web Programming, PhP, and Flash 4 Three Programming Options (maybe 4)

Flash Workshop - Intro to Web Programming, PhP, and Flash 5 Why is Flash best? Almost entirely cut + paste Web based –Ubiquitous “Flash Player” Massive support infrastructure online –Tech-support = Google –For really tough problems: I’m pre-writing 99% of all your future programs.

Flash Workshop - Intro to Web Programming, PhP, and Flash 6 What software will you need? Flash…duh. –Anything after version 7 is fine. –CS4 is ideal (it’s the latest and what I use). Text editing software for PhP –Notepad works just fine. –I use EditPad Pro because it makes life easier. FTP Program –Use whatever your school IT dept recommends. –I use FileZilla because it works with almost every FTP standard (including SFTP/SSH)

Flash Workshop - Intro to Web Programming, PhP, and Flash 7 What you need to run a Flash Experiment Access to a web server with: –PhP 4 or 5 support –Your school should have this –UCLA:?? If you want to get fancy, you can store the data in a database (MySQL). –Ask me about this off-line

Flash Workshop - Intro to Web Programming, PhP, and Flash 8 The Flash Experiment Infrastructure URL PhP Parser Calls Flash (SWF) File Flash Sends Data Converts Raw Data into CSV Ss goes to website

Flash Workshop - Intro to Web Programming, PhP, and Flash 9 6 Files For Every Program Don’t get scared…it’s not that complicated 1. Flash.fla file - This is the file you program in. 2. Flash.swf file - This is the file that you upload to the web server. - It is automatically created by Flash

Flash Workshop - Intro to Web Programming, PhP, and Flash 10 6 Files For Every Program 3. Condition file:.txt - This is just a place holder file that helps with assigning conditions 4. PhP:.php execution file - This file acts like an.html file and runs your flash program (.swf). - It assigns conditions (more later)

Flash Workshop - Intro to Web Programming, PhP, and Flash 11 6 Files For Every Program 5. PhP:.php debriefing file - This is where you include the debreifing for your experiments (it can be blank…but has to exist). 6. PhP:.php parser - This is a program I wrote that converts Flash data into a.csv data file - You never have to touch this file…just make sure it’s there.

Flash Workshop - Intro to Web Programming, PhP, and Flash 12 Setting up Your Program Use a simple naming convention. Here’s mine: –Pick a simple name (workshopfiles) –Use that to name the folder –Every file (except the parser) shares the same name workshopfiles.fla workshopfiles.swf workshopfiles.txt workshopfiles.php workshopfilesdebrief.php

Flash Workshop - Intro to Web Programming, PhP, and Flash 13 Let’s Start with PhP You do not need to know how to understand everything! I have put comments throughout the entire file. There are only a few lines of code that really matter.

Flash Workshop - Intro to Web Programming, PhP, and Flash 14 First a Note about Conditions PhP and Flash don’t understand what a 2x2 is. But they understand numbers. So if you have, say, a: 2 (Name: Jeff, Not-Jeff) x 3 (Awesomeness: Low, Medium, High) you rewrite the conditions as: 1 = Jeff + Low 4 = Not-Jeff+ Low 2 = Jeff + Medium 5 = Not-Jeff + Medium 3 = Jeff + High 6 = Not-Jeff + High

Flash Workshop - Intro to Web Programming, PhP, and Flash 15 workshopfiles.php You only care about two lines: $experimentname = "workshopfiles"; - defines the name of the experiment $numofconditions = 6; - defines the number of conditions Ignore the rest Voilà! You learned php.

Flash Workshop - Intro to Web Programming, PhP, and Flash 16 First Look at Flash

17 Tools Timeline Layers Stage Properties Library Zoom Scenes Flash Workshop - Intro to Web Programming, PhP, and Flash

18 A Note on Layers Always have 4 layers (at least) in this order 1. Actionscript (keep ALL scripts in here) 2. Text (all text related stuff here) 3. Button (all interactive stuff here) 4. Outline (all background stuff here)

Flash Workshop - Intro to Web Programming, PhP, and Flash 19 How to Insert a Frame/Screen This is the most annoying part of flash: 1. Highlight entire column of frames BEFORE the place you want to insert a new one. -Do this by clicking on the top one, then holding down SHIFT and clicking on the bottom one. 2. Hit F5 to insert new frame to the right of the original frame

Flash Workshop - Intro to Web Programming, PhP, and Flash 20 How to Insert a Frame/Screen Cont… If you want to copy and paste an existing frame (you almost always do), again select the ENTIRE column of frames and right click on them…then select “Copy Frames”

Flash Workshop - Intro to Web Programming, PhP, and Flash 21 How to Insert a Frame/Screen Cont… Then again highlight the ENTIRE new column and right click on the new column and select “Paste Frames”

Flash Workshop - Intro to Web Programming, PhP, and Flash 22 A Note on Properties for Text Boxes Static Text: never changes Dynamic Text: can be modified via actionscript Input Text: used to get collect user responses (and can be modified via actionscript) Instance Name: This is what you name your object. You refer to this name when you want to do things like make it invisible. Variable: is the name of a variable that is associated with the content of the text box. This is one of the easier ways to manipulate what is in the box via actionscript. Multiline vs. Single Line: Self explanatory If selected makes the text html formatted. VERY useful for manipulating font/style/color. If selected puts a shadow box behind text. Great for “Input Text”

Flash Workshop - Intro to Web Programming, PhP, and Flash 23 Different Types of Inputs 7/9 point single item scale 7/9 point multi-item scale (on same page) Slider scale Choices Text (short and long) Sum to 100% 7/9 point multi-item scale on different pages (randomizing order)

Flash Workshop - Intro to Web Programming, PhP, and Flash 24 How to Test Your Program CTRL + ENTER: Run entire program CTRL + ALT + ENTER: Run current scene SHIFT + ENTER: Compile program trace!! –Sends text to the “output” window –Only used for debugging –VERY useful

Flash Workshop - Intro to Web Programming, PhP, and Flash 25 Your Three Best Friends 1. Copy + Paste –Demo 2. Google –Aka. Flash Community 3. Experts-Exchange.com –Saved me many many times

Flash Workshop - Intro to Web Programming, PhP, and Flash 26 ActionScript Basics - Variables Variables can be declared, but don’t have to be. Examples: var myVariable = 10; myArray = new Array(); Avoid reserved names –If a variable “turns blue,” change it. –E.g. “new”, “array”, “data”, “time”, etc…

Flash Workshop - Intro to Web Programming, PhP, and Flash 27 ActionScript Basics – Variables Tricks How to convert a number stored as a string to a number that you can work with: –Easy: multiply by 1 –If you have: myVariable = “1”; and you want to have a new variable which is equal to myVariable + 5 : newVariable = myVariable * 1 + 5;

Flash Workshop - Intro to Web Programming, PhP, and Flash 28 ActionScript Basics – Data Flow Some data comes in from the initial php file (workshopfiles.php): –ip, condition, date_start, time_start All data (including the initial data) must then be stored in a single variable in Flash (datastring) –This is done using the storedata fuction –This function ONLY works when the entire program is run (not just a single scene).

Flash Workshop - Intro to Web Programming, PhP, and Flash 29 ActionScript Basics – Storing Data Data is stored using the function “storedata” –How to store the value in the variable “name”: –storedata(“name”, name) –Both can be “hard coded” or variables. –MAKE SURE THAT “COLUMN NAMES” ARE UNIQUE!! Name of column in data file Value to store

Flash Workshop - Intro to Web Programming, PhP, and Flash 30 ActionScript Basics – Conditionals if(person==“jeff”) {text = “The person is Jeff”;} else {text = “The person is not Jeff”;} 2 equal signs for checking “sameness” Parentheses around the conditional Brackets around action Does this if the conditional fails

Flash Workshop - Intro to Web Programming, PhP, and Flash 31 Three Ways To Get Pictures Into Your Program 1.“Hard Code” them Drag an image file from a folder directly onto the stage. Note that Flash adds it to the library. File -> Import to Stage/Library 2.Use ActionScript –Leave photos in folder (not in flash program) –Advantage: Flexibility 3.Use ActionScript –Import photos into flash –Advantages: Pre-loaded + All One File

Flash Workshop - Intro to Web Programming, PhP, and Flash 32 Pictures and ActionScript (not imported…option 2) Use the “empty movie clip” place holder Name it something: “imageLoader1” Save an image file in the same folder as the program In ActionScript, use the following code: loadMovie(“img.jpg", "imageLoader1"); Name of image file. Can be variable or string. Name of place holder. Can be variable or string.

Flash Workshop - Intro to Web Programming, PhP, and Flash 33 Pictures and ActionScript (imported…option 3) Import photo to library

Flash Workshop - Intro to Web Programming, PhP, and Flash 34 Pictures and ActionScript (imported…option 3) From the library, change the image properties

Flash Workshop - Intro to Web Programming, PhP, and Flash 35 Pictures and ActionScript (imported…option 3) Enable “Linkage” Make sure that both the “Export for ActionScript” and “Export in Frame 1” boxes are checked Give the image a name (idendifier)

Flash Workshop - Intro to Web Programming, PhP, and Flash 36 Pictures and ActionScript (imported…option 3) Use the following code (it seems like a lot, but it’s pretty straight forward): imagename = “C74.jpg”; import flash.display.BitmapData; var linkageId:String = imagename; var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId); var imageLoader1:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth()); imageLoader1.attachBitmap(myBitmapData, this.getNextHighestDepth()); imageLoader1._x = 100; imageLoader1._y = 200; The same name as you used in the “Identifier” box The x and y coordinates of the image. Using the TOP- LEFT corner as a reference.

Flash Workshop - Intro to Web Programming, PhP, and Flash 37 Pictures and ActionScript (imported…option 3) Final notes: –Center the image on the screen, regardless of the image size: imageLoader1._x = (Stage.width-imageLoader1._width)/2; imageLoader1._y = (Stage.height-imageLoader1._height)/2; Remove an image from the scene: –myBitmapData.dispose();

Flash Workshop - Intro to Web Programming, PhP, and Flash 38 Reaction Times in Actionscript gettimer() Starttime = gettimer() –Put this somewhere in the main part of the frame Endtime = gettimer() –Put this wherever you exit the frame (e.g. when a button is clicked) storedate(“reactiontime”,endtime-starttime); –Put this just below the endtime=gettimer() line Done!

Flash Workshop - Intro to Web Programming, PhP, and Flash 39 Homework 1. Install software 2. Try and upload the existing files to your webserver and see if everything works –Make sure to check permissions (CHMOD 755 (or 777) works well)…ask me for help 3. Take any simple questionnaire you have and try to turn it into a program (at least 2 conditions) –If you can’t get the web version to work just yet, try and get it to work locally (e.g. with CTRL+ENTER) –If you don’t have a questionnaire, I will give you one