<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CityTech - Fall 2011: Interactive Interface Design</title>
	<atom:link href="http://classes.catherinegarnier.com/f11interfacedesign/feed/" rel="self" type="application/rss+xml" />
	<link>http://classes.catherinegarnier.com/f11interfacedesign</link>
	<description></description>
	<lastBuildDate>Tue, 20 Dec 2011 22:58:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Week 15: Final Project Presentations</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/20/week-15-final-project-presentations/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/20/week-15-final-project-presentations/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 22:58:11 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=211</guid>
		<description><![CDATA[Tonight you will present your final projects. By midnight tomorrow, December 21st, please publish your final files online, and post the links in the comments section of this week&#8217;s blog post. Please included the following: Your final project swf, embedded &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/12/20/week-15-final-project-presentations/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tonight you will present your final projects.</p>
<p>By midnight tomorrow, December 21st, please publish your final files online, and post the links in the comments section of this week&#8217;s blog post. Please included the following:</p>
<ul>
<li>Your final project swf, embedded in an html file</li>
<li>A zip file of your final .fla file, plus any unusual fonts and any remotely loaded images, music or video</li>
<li>Remember to credit any one else&#8217;s code that you used in the comments of your Actionscript in your .fla file. Failure to do so constitutes plagiarism and may cause you to fail the class. Provide the url where you found the code.</li>
</ul>
<p>Have a great break!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/20/week-15-final-project-presentations/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Week 14: Work Session</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/14/week-14-work-session/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/14/week-14-work-session/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 00:59:06 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=207</guid>
		<description><![CDATA[We&#8217;re working in class today. For those of you doing a game where you want scoring, here&#8217;s a tutorial. It&#8217;s for FlashMX, so using Actionscript 2, but the principle of what you need to do is the same: Games &#8211; &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/12/14/week-14-work-session/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re working in class today.</p>
<p>For those of you doing a game where you want scoring, here&#8217;s a tutorial. It&#8217;s for FlashMX, so using Actionscript 2, but the principle of what you need to do is the same:</p>
<p><a href="http://www.kirupa.com/developer/mx/score.htm">Games &#8211; Keeping Score</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/12/14/week-14-work-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week 12: Project Planning Review</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/29/week-12-project-planning-review/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/29/week-12-project-planning-review/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 22:48:37 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=161</guid>
		<description><![CDATA[Today we&#8217;re going to review your project brief, process flow, and storyboards. Next week is an in class work session. Your goal for next week should be to get all your interface elements set up in Flash, and to code &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/11/29/week-12-project-planning-review/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Today </strong>we&#8217;re going to review your project brief, process flow, and storyboards.</p>
<p><strong>Next week </strong>is an in class work session. Your goal for next week should be to get all your interface elements set up in Flash, and to code to a point where you hit a problem you are not sure how to solve.</p>
<p><strong>We have three more classes after today!</strong></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/29/week-12-project-planning-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Week 11: Using Third Party Libraries</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/14/week-11-using-third-party-libraries-apis/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/14/week-11-using-third-party-libraries-apis/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 15:40:51 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=142</guid>
		<description><![CDATA[Topics: Class evaluations Final Project Concept Presentations Final Project Next Steps Using third party libraries: Tween Lite Final PRoject: Project Planning The next step in your final project is to create a detailed plan. For next class (after Thanksgiving!) you &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/11/14/week-11-using-third-party-libraries-apis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Topics:</h3>
<ul>
<li>Class evaluations</li>
<li>Final Project Concept Presentations</li>
<li>Final Project Next Steps</li>
<li>Using third party libraries: Tween Lite</li>
</ul>
<h3>Final PRoject: Project Planning</h3>
<p>The next step in your final project is to create a detailed plan. For next class (after Thanksgiving!) you need to produce the following:</p>
<ol>
<li>Project Brief</li>
<li>Process Flow</li>
<li>Storyboards</li>
</ol>
<p><strong> 1. Project Brief</strong>– This is a text description of your project. It should include the following:</p>
<ul>
<li>Overview: A few sentence summary of the project.</li>
<li>Audience: Who is application for? Include age range, gender, anticipated technical skills, language capability.</li>
<li>Platform: How do you envision this application being used? Is it part of a larger Web site? A mobile application? Part of an installation?</li>
<li>Functionality requirements: Describe how the application will operate. How many distinct states or screens or pages will it have? How will a user interact with it?</li>
<li>Technical requirements: Describe as best you can what code elements will be required for the application.</li>
</ul>
<p><strong> 2. Process Flow – </strong>This is a bit like a site map for a Web site. A process flow visualizes the way a user would move through the application from a high level.</p>
<p style="text-align: center;"><a href="http://classes.catherinegarnier.com/f11interfacedesign/?attachment_id=408" rel="attachment wp-att-408"><img class="aligncenter" title="flowchart" src="../../f11webmedia1/wp-content/uploads/flowchart.png" alt="" width="164" height="261" /></a></p>
<p>Every distinct state or page of the application should be represented by a rectangle, connected by diamond shaped decision points.</p>
<p><strong>3. Storyboards</strong></p>
<p>Take your process flow and turn everything that is represented there into a fully designed interface for each step represented there. Design these in whatever tool you are most comfortable with (Photoshop, Illustrator, Flash itself, a combination) but turn the storyboards into a <strong>single PDF</strong> that you will present to the class after Thanksgiving. You should be able to fully walk us through the functionality of your Flash application with these storyboards. They should represent the near final design of your application. The more time you put into this step, the more time you will have for animation and coding. You are going to need it!</p>
<p>FYI, this is how the final project grades will break down:</p>
<p>Final Project Grading:</p>
<ul>
<li>30% Concept and Planning</li>
<li>30% Interface and Graphic Design</li>
<li>30% Code and Functionality</li>
</ul>
<h3>Using third party libraries: Tween Lite</h3>
<p>Third part libraries are code created by companies or individuals to extend the capabilities of Flash or make common tasks easier. These libraries arenot part of the core actionscript packages but can be imported into your Flash project for use in your applications. We&#8217;re going to look at one popular library today.</p>
<p><a href="http://www.greensock.com/tweenlite/" target="_blank">Tween Lite</a> – A more robust tweening engine than the built in Tween class.</p>
<p>Here are the <a href="http://www.greensock.com/get-started-tweening/#installing" target="_blank">detailed instructions</a> that we&#8217;re going to follow today to use Tween Lite</p>
<p>There is also a good tutorial on importing third party libraries <a href="http://active.tutsplus.com/tutorials/workflow/how-to-use-an-external-library-in-your-flash-projects/" target="_blank">here</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/14/week-11-using-third-party-libraries-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week 10: Loading Video, Final Project</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/08/week-10-loading-video-final-project/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/08/week-10-loading-video-final-project/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 21:07:54 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=138</guid>
		<description><![CDATA[&#62;&#62; Week 10 eXAMPLES Topics Loading Video Final Project Loading Video Loading video is similar to loading audio, but it needs a few more objects because video is loaded into the video object as a stream rather than the whole &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/11/08/week-10-loading-video-final-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>&gt;&gt; <a href="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/week10.zip">Week 10 eXAMPLES</a></h3>
<h3>Topics</h3>
<ul>
<li>Loading Video</li>
<li>Final Project</li>
</ul>
<h3>Loading Video</h3>
<p>Loading video is similar to loading audio, but it needs a few more objects because video is loaded into the video object as a stream rather than the whole file at once. Here&#8217;s some good reference on the video playback:</p>
<p><a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e1a.html" target="_blank">Livedocs &gt; Working with Video</a></p>
<h3>Final Project</h3>
<p>Now comes the time to start thinking about your final project! Next week I want you to come to class with a concept that you are prepared to discuss with the class, with the following parameters in mind:</p>
<ul>
<li>Your Flash application can take many forms &#8211; it can be a game, an art piece, and educational tool, an interactive animation, or something else that you invent</li>
<li>Your application should be interactive &#8211; something a user can really play with. A passive slideshow isn&#8217;t going to cut it.</li>
<li>It should serve a purpose beyond pure entertainment &#8211; it should inform and educate. Choose a subject matter than you are passionate about and think about how your Flash application could evoke the same enthusiasm in the user.</li>
<li>Think about who the application is for &#8211; how old are they? what are their technical skills? language skills? what form is going to most engage them?</li>
<li>Last, this application should showcase the skills you have learned throughout the class</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/08/week-10-loading-video-final-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Week 9: Loading Audio, Loading XML</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/01/week-9-loading-audio-loading-xml/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/01/week-9-loading-audio-loading-xml/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 20:46:30 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=121</guid>
		<description><![CDATA[Topics Loading Audio Loading XML &#8211; An XML Photo Gallery &#62;&#62; Week 9 examples Loading Audio Loading external audio files is similar to loading image or swf files, but you use the Sound and SoundChannel objects instead of the Loader. &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/11/01/week-9-loading-audio-loading-xml/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Topics</h3>
<ul>
<li>Loading Audio</li>
<li>Loading XML &#8211; An XML Photo Gallery</li>
</ul>
<p><a href="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/week9.zip">&gt;&gt; Week 9 examples</a></p>
<h3>Loading Audio</h3>
<p>Loading external audio files is similar to loading image or swf files, but you use the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html?filter_flash=cs5&amp;filter_flashplayer=10.2&amp;filter_air=2.6" target="_blank">Sound</a> and <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundChannel.html" target="_blank">SoundChannel</a> objects instead of the Loader. These objects also let you play and stop the playback.</p>
<h3>Loading XML</h3>
<p>XML stands for eXtensible Markup Language. This is a special document format that Flash can read, and is a relatively simple way to load any kind of data into your Flash application. Today we are going to look at an image gallery that gets all its info from an XML file.</p>
<h3>Homework</h3>
<p>Combine the two exercises today to make an audio player that can play mutliple tracks. The track info should come from an xml file. The player should have buttons to play and stop the current track, and navigate to the next and previous tracks. Note: If you use the method in the example, when you hit the stop button and then the play button, your track will always start over. For the purposes of this exercise, that&#8217;s ok!</p>
<p>&nbsp;</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/11/01/week-9-loading-audio-loading-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week 8: External Assets, Tweens and Transitions, Third Party Libraries</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/25/week-8-external-assets-tweens-and-transitions-third-party-libraries/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/25/week-8-external-assets-tweens-and-transitions-third-party-libraries/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 20:47:13 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=125</guid>
		<description><![CDATA[Topics: Loading External Assets Using Tweens and Transitions Third Party Libraries: Tween Lite &#62;&#62;Example files Loading External Assets As you could see from the banner ad exercise, file size adds up quickly when you are bringing graphics into your library. &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/10/25/week-8-external-assets-tweens-and-transitions-third-party-libraries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Topics:</p>
<ul>
<li>Loading External Assets</li>
<li>Using Tweens and Transitions</li>
<li>Third Party Libraries: Tween Lite</li>
</ul>
<h3><a href="/f11interfacedesign/wp-content/uploads/week8.zip">&gt;&gt;Example files</a></h3>
<h3>Loading External Assets</h3>
<p>As you could see from the banner ad exercise, file size adds up quickly when you are bringing graphics into your library. Even if you don’t have the kind of size restrictions that the banners do, an overly large file is going to take forever to download and start playing in the viewer’s browser. One way to minimize this is to load the assets as you need them when the Flash movie is playing. This is similar to the way you include images in a Web page. It also means that you have to upload those images to your Web server along with your swf and html files in order for them to load and display.</p>
<h3>Step 1: Create the Loader</h3>
<p>You can load images (jpeg, png, or gif only) or other swf files. First you need to create a container to hold the image you are going to load. This container is a special object called a <strong>Loader</strong>. This is how you create a loader:</p>
<pre>var myLoader:Loader = new Loader();</pre>
<p>In this example, “myLoader” is a variable Name that you decide, everything else is set.</p>
<h3>Step 2: Add the Loader to the Stage</h3>
<p>When we create an object like this with ActionScript 3, it doesn’t automatically add that object to the stage. Adding the loader is simple:</p>
<pre>addChild(myLoader);</pre>
<p>Even though the loader is now part of the stage, you won’t see it. Loaders have no appearance of their own, they are just an empty container to put things into.</p>
<h3>Step 3: Identify the asset to load</h3>
<p>Next we need to create an object to hold the path to the image or swf that we want to load into the loader. This object is called a <strong>URLRequest</strong>.</p>
<p>URL stands for “Uniform Resource Location”, which is just a fancy way of saying Web address. In other words, URLs are what you see in the address field of a Web browser. The URLRequest is going to show the path to the asset on our local machine or the server.</p>
<p>There are two ways to represent this path, <strong>relative</strong> or <strong>absolute.</strong></p>
<p>In an absolute path, you give the full address on the local machine or Web server: <em>http://www.domainname.com/subdirectory/filename.ext</em></p>
<p>In a relative path, you only give need to give the path relative to the swf file the image will be loaded into: <em>subdirectory/filename.ext</em></p>
<p>It’s best to use the “relative” path to the asset, because this will be the same when you are working on your local machine as when you publish to the Web server. To simplify things and stay organized, keep your assets in a subdirectory (folder) in the same directory (folder) as your Flash files.</p>
<p>So, if you had an image called “my_image.jpg” in a subdirectory called “images” the relative path to it would be “images/my_image.jpg”</p>
<p>You create the URLRequest like this:</p>
<pre>var myImage:URLRequest = new URLRequest(imagePath);</pre>
<p>In this example “myImage” and “imagePath” are variables. You can either put the image path directly in to the parentheses after URLRequest or create another variable to hold it.</p>
<h3>Step 4: Loading the Asset into the Loader</h3>
<p>Now that you’ve created the empty container, and identified the asset to go into it, it only remains to load one into the other:</p>
<p>myLoader.load(image);</p>
<p>If you test your movie, you will now see it on the stage. Here’s a couple things to note about the loader object:</p>
<h4>Positioning Loaded Content</h4>
<p>The loader is placed at the 0,0 coordinates on the stage, so you may want to reposition it. You can do this by accessing it’s x and y properties:</p>
<pre>myLoader.x = xposition;
myLoader.y = yposition;</pre>
<h4>Scaling Loaded Content</h4>
<p>The image is loaded into the the loader at 100%. You can scale with code with the scaleX and scaleY properties, but like importing into the library, it’s better to resize it outside of Flash. The larger the asset is, the longer it will take to load, and you don’t want to make the viewer wait around unecessarily. The scale property is a percentage expressed as a decimal between 0-1, so .5 represents 50%. You can scale above 100%, but you’d be blowing a bitmap up larger than its pixel dimensions, which is never recommended!</p>
<pre>myLoader.scaleX = myLoader.scaleY = yposition;</pre>
<p>Now let’s look at an example that puts the loading code into a function so that you can reuse it for multiple loaders. This will help you get started on the homework:</p>
<h3>Tweens</h3>
<p>The Tween class allows you to animate the same properties you could using a Motion Tween on the timeline:</p>
<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/transitions/Tween.html" target="_blank">Tween Reference</a></p>
<p>Now, with these objects, for the first time we are using Flash packages that are not automatically imported when we publish the file, so we have to do that first:</p>
<pre>import fl.transitions.Tween;
import fl.transitions.easing.*;</pre>
<h3>Transitions</h3>
<p>There are a number of transitions designed to bring content on or off the stage in the fl.transitions package. The Transition Manager class allows you to access these transitions:</p>
<p><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/transitions/TransitionManager.html#start%28%29" target="_blank">Transition Manager Reference</a></p>
<h3>Homework</h3>
<p>Create an image gallery / slideshow that does the following:</p>
<ul>
<li>Loads at least 10 external images</li>
<li>Automatically loads a new image every 10 seconds (slideshow)</li>
<li>Stop button to stop the slideshow</li>
<li>Play button to play the slideshow</li>
<li>Has buttons or some other navigation element to move to the previous and next images, one by one</li>
</ul>
<p>Extra credit: Add either a tween or a transition to switch between images</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3></h3>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/25/week-8-external-assets-tweens-and-transitions-third-party-libraries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Week 7: Quiz, Drag and Drop Events</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/18/week-7-quiz-drag-and-drop-events/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/18/week-7-quiz-drag-and-drop-events/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 20:13:08 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=110</guid>
		<description><![CDATA[&#62;&#62;week 7 examples Creating Drag and Drop Elements The Sprite class has built into it several methods for allowing user input to grab an object on the stage and drag it to another location. These methods are called startDrag and &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/10/18/week-7-quiz-drag-and-drop-events/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3><a href="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/week7.zip">&gt;&gt;week 7 examples</a></h3>
<h3>Creating Drag and Drop Elements</h3>
<p>The Sprite class has built into it several methods for allowing user input to grab an object on the stage and drag it to another location. These methods are called <strong>startDrag</strong> and <strong>stopDrag</strong>, can be used with any Sprite or MovieClip, and are generally triggered by mouse events. These methods are tied to a specific display object and triggered within an event handler.</p>
<p>The <strong>startDrag</strong> is called when the initial user event is dispatched, and causes the target object to be draggable. This method takes two optional arguments:</p>
<ul>
<li><em>lockcenter</em> – this is a Boolean that determines whether the Sprite is locked to the center of the mouse position (true) or to where the user first clicked on it (false). The default value is false.</li>
<li><em>bounds</em> – specifies a boundary rectangle for the Sprite, beyond which in cannot be dragged. The default value is null.</li>
</ul>
<p>The <strong>stopDrag </strong>method is called when the terminal user event is dispatched, and causes the target object to cease being draggable. This method takes no arguments.</p>
<p>There is a property of the Sprite object that is related to these functions, called the <strong>dropTarget. </strong>This specifies the object which the sprite was dragged and released onto.</p>
<h3>Homework</h3>
<p>Create a simple shape matching game, such as you might give to a young child. There should be at least 5 shapes and 5 matching shape targets. Create the code such that:</p>
<ul>
<li>If the user drags the shape to the wrong target, it snaps back to its original position and displays a message that tells the user that is incorrect</li>
<li>If the user drags the shape to the right target, a message is displayed that tells them they made the correct</li>
</ul>
<p>Have fun with this and be creative! Create something that would be appealing to a kid, and easy to understand.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="550" height="400" align="center">
      <param name="movie" value="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/example.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/example.swf" width="550" height="400" align="center">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/18/week-7-quiz-drag-and-drop-events/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Week 6: Animating With Code</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/11/week-6-animating-with-code/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/11/week-6-animating-with-code/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 01:46:31 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=99</guid>
		<description><![CDATA[Topics Frame-based events Timers Hit Testing So far we&#8217;ve been working with user-generated Mouse Events. Today we&#8217;re going to explore some non-User events that allow us to animate and react with code. &#62;&#62;Week 6 Examples Frame-based Events Now that we &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/10/11/week-6-animating-with-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Topics</h3>
<ul>
<li>Frame-based events</li>
<li>Timers</li>
<li>Hit Testing</li>
</ul>
<p>So far we&#8217;ve been working with user-generated Mouse Events. Today we&#8217;re going to explore some non-User events that allow us to animate and react with code.</p>
<p><a href="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/week_6.zip">&gt;&gt;Week 6 Examples</a></p>
<h3>Frame-based Events</h3>
<p>Now that we are comfortable with working with and creating display objects, and using event listeners and event handlers, we can also create animation entirely from code, without involving the timeline. To do this, we use a new event type, onEnterFrame, or ENTER_FRAME event.</p>
<p>You might think that you could use a for loop for animation, like this:</p>
<pre>for(i = 0; i &lt; 500; i++){
    ball.x = i;
}</pre>
<p>Where “ball” is a display object that you have defined elsewhere. You might think that this code would move the ball 1 pixel 500 times, and in a sense you would be right. The problem is that you would only see the result of the last loop, because all 500 loops are executed before the frame is rendered.</p>
<p>To get around this, you need to introduce time between loops, which is where ENTER_FRAME comes in. The ENTER_FRAME event is dispatched at the frame rate of the .swf.</p>
<p>This is how you set up an enter frame event:</p>
<pre>instancename.addEventListener(Event.ENTER_FRAME, eventHandler);

function eventHandler(event:Event):void {

            //do something
 }</pre>
<h3>Timer Events</h3>
<p>You can also set up an event that will happen at regular intervals in your code. This is called a Timer Event. A timer is actually an object, so first you need to create a new Timer instance, then add an event listener and handler to it, and last, start the timer!</p>
<pre>//create the timer instance
var myTimer:Timer = new Timer(500, 10);

//add the timer event to it
myTimer.addEventListener(TimerEvent.TIMER, eventHandler);

//start the time
myTimer.start();

function eventHandler(event:TimerEvent):void {
    //do something
}</pre>
<h3>Hit Testing</h3>
<p>It can be useful when creating dynamic code based animation to be able to detect when one display object collides with another. This is called “Hit Testing”. You can hit test two ways, with two objects or with an object and a point on the stage.</p>
<p>To hit test two objects, use the hitTestObject method:</p>
<pre>object1.hitTestObject(object2)</pre>
<p>To hit test and object and a point, use the hitTestPoint method:</p>
<pre>object.hitTestPoint(xcoordinate,ycoordinate)
<strong></strong></pre>
<h3> Homework</h3>
<p>Simulate the game of <a href="http://www.classicgamesarcade.com/game/21599/Pong-arcade-game.html" target="_blank">Pong</a>! Create an animation that uses enter frame to animate the properties of at least 3 objects and a hit test between them, and incorporates a timer.</p>
<p>Also, turn your drawing app homework in again with comments, so that I know you understand how it works!</p>
<p><em>Note: Next week we are going to have an in class quiz on the material we have covered so far. If there is anything you are unclear on, now is the time to ask questions. The quiz will be on paper, and you will not be allowed to look things up on the internet</em></p>
<p>&nbsp;</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/10/11/week-6-animating-with-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week 5: The Drawing API, Custom Cursors</title>
		<link>http://classes.catherinegarnier.com/f11interfacedesign/2011/09/27/week-4-the-drawing-api-custom-cursors/</link>
		<comments>http://classes.catherinegarnier.com/f11interfacedesign/2011/09/27/week-4-the-drawing-api-custom-cursors/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:55:32 +0000</pubDate>
		<dc:creator>katy</dc:creator>
				<category><![CDATA[Lessons]]></category>

		<guid isPermaLink="false">http://classes.catherinegarnier.com/f11interfacedesign/?p=77</guid>
		<description><![CDATA[&#62;&#62;week5 EXAMPles Topics Variable Scope Creating a Custom Cursor Working with the Drawing API Variable Scope This is something we haven&#8217;t talked about specifically, but is important to understand as you start to write more complicated code. A variable’s scope &#8230; <a href="http://classes.catherinegarnier.com/f11interfacedesign/2011/09/27/week-4-the-drawing-api-custom-cursors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3><a href="http://classes.catherinegarnier.com/f11interfacedesign/wp-content/uploads/week4.zip">&gt;&gt;week5 EXAMPles</a></h3>
<h3>Topics</h3>
<ul>
<li>Variable Scope</li>
<li>Creating a Custom Cursor</li>
<li>Working with the Drawing API</li>
</ul>
<h3>Variable Scope</h3>
<p>This is something we haven&#8217;t talked about specifically, but is important to understand as you start to write more complicated code.</p>
<p>A variable’s <strong>scope</strong> refers to where in the code it is defined. A variable is either <strong>global</strong> or <strong>local</strong>. A global variable is available to all code within the program. A local variable is only available to the function or statement where it is defined. For the most part, we’ve been dealing with global variables. However, variables that we’ve defined within conditional statements or loops are confined in scope to those statements.</p>
<p>Let’s take the example of the addMe Function from an earlier class:</p>
<pre>function addMe(var x:Number, var y:Number):Number {
 var z:Number = x + y;
 return z;
 }</pre>
<p>In this case, the variables x, y, z are all <em>local</em> to the addMe function. The problem with this is that the function returns the value of z, but there is no way to access this value, because it only has meaning within the function. Instead, you might want to define z outside the function:</p>
<pre>var z:Number;
function addMe(var x:Number, var y:Number):Number {
z = x + y;
return z;
}</pre>
<p>Now, when you call this function you will have access to the returned value of z. Note, however, that x and y are still local variables, because you defined them within the parameters of the function.</p>
<p>We&#8217;ll look at this issue more specifically in the next example.</p>
<h3>Creating a Custom Cursor</h3>
<p>There may be cases in a application where you want to display a different cursor icon than the standard arrow or hand that your computer usually uses. In flash, this icon is a property of the Mouse object. There is no direct way to replace this icon, what you do instead is hide the default icon, and then attach a new symbol in Flash to the position of the mouse.</p>
<p>To hide the mouse is a simple method of the Mouse object:</p>
<pre>Mouse.hide();</pre>
<p>Then it&#8217;s a simple matter of creating the new instance of the cursor symbol, adding it to the display list, and pinning it&#8217;s x and y coordinates to the position of the mouse. You can get the position of the mouse with these properties:</p>
<ul>
<li>mouseX</li>
<li>mouseY</li>
</ul>
<h3>The Drawing API</h3>
<p>If you are using simple shapes in your application, you can avoid creating library symbols completely and instead use ActionScript 3.0’s Drawing API to create vector graphics.</p>
<p>The Drawing API (Application Programming Interface) is part of the <strong>Graphics</strong> class. Any <strong>Sprite</strong> or <strong>Shape</strong> instance you create includes a graphics instance that you can draw within. There are a number of methods you use to draw and fill vector shapes.</p>
<p><a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Graphics.html" target="_blank">&gt; Live Docs &gt; Graphics Class</a></p>
<h3>Setting a Line Style</h3>
<p>The graphics.lineStyle method takes three arguments – <em>thickness</em>, <em>color</em>, and <em>alpha</em>:</p>
<pre>graphics.lineStyle(1);</pre>
<h3>Drawing Straight Lines</h3>
<p>To draw a straight line from the last point that the “pen” landed, use <strong>lineTo</strong>, which takes two arguments, x and y coordinates.</p>
<pre>graphics.lineTo(50,0);</pre>
<h3>Moving the Pen</h3>
<p>To move the pen position without drawing a line, use <strong>moveTo</strong>, which also takes x,y coordinates.</p>
<pre>graphics.moveTo (-50,50);</pre>
<h3>Drawing Curved Lines</h3>
<p>A curved line requires four points of reference – <em>controlx, controy, anchorx, anchory</em></p>
<pre>graphics.curveTo(0,-50,0,0);</pre>
<h3>Primitive Shapes</h3>
<p>There are built in methods for creating circles, ellipses, rectangles and rounded rectangles in ActionScript 3.0. They take various arguments depending on the shape:</p>
<ul>
<li>drawCircle(x:Number, y:Number, radius:Number)</li>
<li>drawEllipse(x:Number, y:Number, width:Number, height:Number)</li>
<li>drawRect(x:Number, y:Number, width:Number, height:Number)</li>
<li>drawRoundRect(x:Number, y:Number, width:Number, height:Number, ellipseWidth:Number, ellipseHeight:Number)</li>
</ul>
<h3>Fills</h3>
<p>To fill in lines or shapes created with the drawing API, you define a fill style with beginFill, which takes two arguments, color and alpha:</p>
<pre>graphics.beginFill(0xFFFF00,1);</pre>
<p>All shapes will be filled with this style until you invoke the endFill method:</p>
<pre>graphics.endFill();</pre>
<h3>Homework</h3>
<ol>
<li>Using just the Drawing API methods (no Library symbols or objects drawn on the Stage) draw a self-portrait.</li>
<li>Make a drawing application that lets the user draw on the screen using the mouse. (Hint: You can use the custom cursor example as a starting point for this application)</li>
</ol>
<p>&nbsp;</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://classes.catherinegarnier.com/f11interfacedesign/2011/09/27/week-4-the-drawing-api-custom-cursors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

