programming games cannonball due. drawing & printing example. acquiring video or sound homework:...
TRANSCRIPT
![Page 1: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/1.jpg)
Programming games
Cannonball due. Drawing & printing example.
Acquiring video or soundHomework: Catch up: complete
projects (rps, Bo, cb). Start video or audio. Plan your project.
![Page 2: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/2.jpg)
Cannonball extension
• You may consider adding sound to cannonball for your sound/video project.
• Can use– coding or– sound in frame
![Page 3: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/3.jpg)
Flash terms
• Create .fla and .as files using Flash development environment. This is development time.
• Runtime (aka execution time)– Test program using the development
environment. This does create a .swf file.– Publish creates .html file and .swf file
![Page 4: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/4.jpg)
Development time
• Bring instances of movie clip symbols in Library to the Stage.– Give instance names– ActionScript refers to instances by name
• Can File/Print– May not do what you want…– I copy and paste code into Word or
Dreamweaver
![Page 5: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/5.jpg)
Drawing & printing
• Adding content, namely a movie clip symbol to Stage at runtime– Various calculations– Use Properties of symbol (right mouse click)
to set up: Export for ActionScript
• Print during runtime– Can set up to print several pages. My
example just prints one page.
![Page 6: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/6.jpg)
Demonstrate
• Drawing example
• Note: this is a ‘stub’ for a bigger application.
![Page 7: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/7.jpg)
Features
• Create wall symbol. Change settings to Export for ActionScript.
• Set up handling for mouse click on board.– One handler for 1st click and another for 2nd
click– Use ev.localX and ev.localY to get
coordinates.– Use Math.atan2(…) and Point.distance(…)
• Use PrintJob
![Page 8: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/8.jpg)
Making your own video for Flash playback
• Shoot video
• Upload to computer
• [Edit]
• Produce .flv
• Create Flash movie and test
• Publish Flash movie– Upload .html, .swf, and all the .flv files to the
server
![Page 9: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/9.jpg)
Initial steps
• Shoot (?) video
• Upload to computer
![Page 10: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/10.jpg)
Producing .flv
• Just like images, there are different encodings for videos.– wmv, mov, avi, dv, ….
• Adobe Flash CS4 Media Encoder will accept many different types and produce an .flv file (an .flv version of the same video clip)– Can set quality settings
• Tradeoff: size (space on server, loading time) versus quality
![Page 11: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/11.jpg)
![Page 12: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/12.jpg)
![Page 13: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/13.jpg)
![Page 14: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/14.jpg)
Start queue
• Creating the .flv file takes a while….
• You can do more than one encoding at a time.– The name of each file is the same name, with
filetype .flv
• Use the pre-set settings OR get into more detail– Higher quality means larger files
![Page 15: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/15.jpg)
![Page 16: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/16.jpg)
Acquire video
• Find website with video (or audio)
• go to http://file2hd.com/– Enter URL of site– Check off agree to terms, filter (movies or
audio)– click on get files– be patient– choose from list.
![Page 17: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/17.jpg)
SoundTwo (at least) methods for incorporating
sound into Flash
• All coding: create Sound objects, set source of sound, play. Can manipulate volume, pan, etc. using Soundchannel. Also, register and handle events, including when sound has been loaded.
• Frame: associate [start of] sound with frame.
![Page 18: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/18.jpg)
Acquire sound
• Many types of sound. For coding method, need mp3
• Find on-line sound editors.
• Need to know location (URL) of sound file(s).
![Page 19: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/19.jpg)
Coding method
import flash.media.Sound;import flash.net.URLRequest;
var urlname:String = "missle.mp3";var requestsf:URLRequest = new
URLRequest(urlname);var msound:Sound = new Sound(requestsf);
// at appropriate place in the codemsound.play();
This file is located in the same folder on my computer. It doesn't have to be.
![Page 20: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/20.jpg)
Frame method
• File/Import/Import to Library– Select sound file(s).
• Click on appropriate frame in timeline
• In property panel, select Sound [file].– You can select a set effect and/or edit the
sound.
![Page 21: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/21.jpg)
Cautions
• In either method, need to be aware that sound lasts certain amount of time.
• Be careful about starting sound again and again (unless that is what you want)
![Page 22: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/22.jpg)
Examine source
• Sound added to frame– Bo the barking dog – consider for collapsing/exploding target
• Code– Play sound as event handler for button click– Play random choice of tune from [short] list.
• Note: pause, pan, volume features. These require other objects.
![Page 23: Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video](https://reader036.vdocuments.net/reader036/viewer/2022081603/5697bff11a28abf838cbb21a/html5/thumbnails/23.jpg)
Homework
• Decide on video or audio– Create or acquire video clip(s)– Create or acquire audio clips. Can use Common
Library / sounds.– Keep in mind: this is a short assignment.– You can incorporate sound or video into your final
project.
• Think about what you want to do for your project– Check with me AND make proposal to blog.