<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - flash - 9.0 - main - 00000035.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-24T20:54:34</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#88365" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#86330" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#86131" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#83878" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#83079" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#81226" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#81165" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#80438" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#80365" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#78747" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77871" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77578" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77464" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#76180" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#75594" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74883" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74555" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74546" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#88365">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#88365</link>
		<description>Actually, this worked like gangbusters for me on my Mac. The few problems I had were due to errors I made inputting the code. Found and fixed those, and it works perfectly.</description>
		<dc:creator>graylensman</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-10-09T06:59:40</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#86330">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#86330</link>
		<description>Pet peeve. When teaching a subject to someone the first time, the naming convention you choose can help or hurt. In particular I find that until I'm up to speed, using the same name for more then one item or task can be maddening.&lt;br /&gt;&lt;br /&gt;In this example, which almost worked the first time for me (hooray), the choice of using &quot;validName(s)&quot; for both a variable name and a function name just makes it harder to understand the first time around.  &lt;br /&gt;&lt;br /&gt;Imagine trying to teach someone 2 + 2 = 4, except instead of the operator &quot;+&quot; our language lets us substitute the number &quot;2&quot;, and the reader should simply read it as (+) when it appears between two numbers. This gives us the convenience of not needing to print an additional symbol &quot;+&quot;.&lt;br /&gt;&lt;br /&gt;Now try to teach someone   2 2 2 = 4    instead of   2 + 2 = 4&lt;br /&gt;&lt;br /&gt;Good luck&lt;br /&gt;&lt;br /&gt;now apply that logic to the code presented and remember you're teaching 2+2 to someone. What exactly is &quot;validName(s)&quot;?&lt;br /&gt;&lt;br /&gt;var validNames:Array = [&quot;Sammy&quot;, &quot;Frank&quot;, &quot;Dean&quot;];&lt;br /&gt;else if (validName(userName))&lt;br /&gt;public static function validName(inputName:String = &quot;&quot;):Boolean &lt;br /&gt;if (validNames.indexOf(inputName) &gt; -1) &lt;br /&gt;&lt;br /&gt;is it a function, a variable or is it some language trick that I missed in the readings?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;a simple change and confusion is eliminated&lt;br /&gt;&lt;br /&gt;var validNames:Array = [&quot;Sammy&quot;, &quot;Frank&quot;, &quot;Dean&quot;];&lt;br /&gt;else if (checkifvalidName(userName))&lt;br /&gt;public static function checkifvalidName(inputName:String = &quot;&quot;):Boolean &lt;br /&gt;if (validNames.indexOf(inputName) &gt; -1) &lt;br /&gt;&lt;br /&gt;Having written code in a bunch of different languages, the first reaction I'd have is &quot;Aw, com'on, if you don't understand the difference between validName and validNames you shouldn't be programming.&quot;  &lt;br /&gt;&lt;br /&gt;Realize that its not about understanding the difference, its about recognizing the difference. While going through the learning process your brain is dealing with information overload (Package, Public, {, instance name, .as, ...). At this time it is easy to confuse validName and validNames, and that can lead to all kinds of frustration.&lt;br /&gt;&lt;br /&gt;Long tirade, because as I said its a pet peeve.</description>
		<dc:creator>Todays Past</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-08-01T10:50:06</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#86131">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#86131</link>
		<description>I actually fixed mine because there was a boolean error in the Greeter.as &lt;br /&gt;class. I wrote it so that Greeter.as is in a foler path of &lt;br /&gt;com/example/Greeter.as (in relation the the fla).&lt;br /&gt;&lt;br /&gt;package com.example&lt;br /&gt;{&lt;br /&gt;	public class Greeter&lt;br /&gt;	{&lt;br /&gt;		//Define the names that should receieve a greeting.&lt;br /&gt;		public static var validNames:Array = [&quot;Dan&quot;, &quot;Dave&quot;, &quot;Molli&quot;];&lt;br /&gt;		&lt;br /&gt;		//Build a greeting string using the given name.&lt;br /&gt;		public function sayHello(userName:String = &quot;&quot;):String&lt;br /&gt;		{&lt;br /&gt;			var greeting:String;&lt;br /&gt;			if (userName == null)&lt;br /&gt;			{&lt;br /&gt;				greeting = &quot;Hello. Please type your name and press &lt;br /&gt;enter.&quot;;&lt;br /&gt;			}&lt;br /&gt;			else if (validNames.indexOf(userName) &gt; -1)&lt;br /&gt;			{&lt;br /&gt;				greeting = &quot;Hello &quot; + userName + &quot;.&quot;;&lt;br /&gt;			}&lt;br /&gt;			else {&lt;br /&gt;				greeting = &quot;Sorry, you're not on the list&quot;;&lt;br /&gt;			}&lt;br /&gt;			return greeting;&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;***you can do away with the second function and just add it into the else if &lt;br /&gt;statement in sayHello().&lt;br /&gt;&lt;br /&gt;Then everything else is the same in the .fla except you have to import the &lt;br /&gt;class you made at the beginning like this...&lt;br /&gt;&lt;br /&gt;import com.example.Greeter;&lt;br /&gt;&lt;br /&gt;var myGreeter:Greeter = new Greeter();&lt;br /&gt;mainText.text = myGreeter.sayHello(&quot;&quot;);&lt;br /&gt;&lt;br /&gt;mainText.border = true;&lt;br /&gt;textIn.border = true;&lt;br /&gt;&lt;br /&gt;textIn.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);&lt;br /&gt;&lt;br /&gt;function keyPressed(event:KeyboardEvent):void&lt;br /&gt;{&lt;br /&gt;	if(event.keyCode == Keyboard.ENTER)&lt;br /&gt;	{&lt;br /&gt;		mainText.text = myGreeter.sayHello(textIn.text);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then.. everything should work well.</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-07-26T20:17:25</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#83878">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#83878</link>
		<description>-kalibahlu:&lt;br /&gt;&lt;br /&gt;I have a regular macbook and after going through all the steps everything &lt;br /&gt;actually worked just fine.  I couldn't think of a reason why its not working for &lt;br /&gt;you, but I figured I'd respond because I hate it when no one responds to my &lt;br /&gt;posts for help :)  I'm sure you've figured it out by now anyway.  &lt;br /&gt;&lt;br /&gt;-Daniel</description>
		<dc:creator>d2burke</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-05-09T22:21:55</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#83079">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#83079</link>
		<description>When I executed the code, I wanted to have a way to clear the text box for another user entry. One thing I noticed is that users had to delete previous name entries, or they would continue to add on to the past attempts. I decided to empty the text box every time an entry was made. It works better, but the problem I'm having now is that after the first attempt, I have to press the delete key once or it will not recognize the input names. Any other ways around this?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My code:&lt;br /&gt;&lt;br /&gt;mainText.text = myGreeter.sayHello(userNameText.text); userNameText.text = &quot;&quot;;   // set input text to empty string</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-04-17T00:23:36</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#81226">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#81226</link>
		<description>I've been going insane trying to learn AS3 having huge difficulties JUST ATTACHING A CLASSPATH. &lt;br /&gt;&lt;br /&gt;Having made the leap of faith that I'm not a complete idiot, I've discovered that if my FLA is in a folder (at any depth / parentage) that has an underscore in the name, then the classpath will simply not connect - or even worse, if the classpath happens to be a correct path in &quot;relative&quot; terms to the FLA, it finds the classes in the relative folder, but fails to import them properly resulting in new even more exciting errors. &lt;br /&gt;&lt;br /&gt;The moment I move the FLA and package to folders with underscores - it works. Also, as per a pot above, it will nto work across different drive letters on a PC.&lt;br /&gt;&lt;br /&gt;I have wasted hours if not days of my life in these issues, and had all but abandoned plans to learn AS3 as a result. &lt;br /&gt;&lt;br /&gt;Have not found this issue mentioned within any documentation, hope this helps somebody else who feels somewhat &quot;up the creek&quot; due to the deficit of classpath info in the documentation.</description>
		<dc:creator>Paul I</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-02-27T11:28:49</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#81165">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#81165</link>
		<description>Also, random_ke make sure that your actionscript file is named correctly. I had it as &quot;greeter.as&quot; instead of &quot;Greeter.as&quot; and it wouldn't work.</description>
		<dc:creator>ssmithMil</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-02-26T10:51:36</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#80438">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#80438</link>
		<description>Those errors mean that Flash isn't able to find the Greeter class definition (the Greeter.as file that you created).&lt;br&gt;&lt;br&gt;The easiest way to fix this is to make sure that the Greeter.as file is saved in the same folder where your .fla file is saved (you must save the FLA file before testing it in order to use external classes).</description>
		<dc:creator>adbe_paul</dc:creator>
		<dc:type>1 0</dc:type>
		<dc:date>2008-02-07T10:41:05</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#80365">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#80365</link>
		<description>when i publish the application, i gave these erors..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1046: type was not found or was not a compile-time constant Greeter&lt;br /&gt;1180: Call to a possibly undefined method Greeter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;where is my mistake?</description>
		<dc:creator>random_ke</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-02-05T14:33:16</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#78747">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#78747</link>
		<description>Sorry, I didn't mean to split this comment.&lt;br /&gt;&lt;br /&gt;Anyway, you probably assumed this, but be sure to save both these files in the same folder.</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-12-19T20:34:55</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77871">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#77871</link>
		<description>An update to my post above.&lt;br /&gt;&lt;br /&gt;I have a secondary internal drive in my MacPro - all  of my work is done &lt;br /&gt;on this secondary drive. However all apps etc are installed on the &lt;br /&gt;primary (system drive). The default relative '.' (dot) classpath does not &lt;br /&gt;work in this situation - you have to set the classpath to the location of &lt;br /&gt;your working folder.&lt;br /&gt;&lt;br /&gt;All examples/tutorials using the relative classpath work perfectly on the &lt;br /&gt;system drive. They don't if you are working on any other drive.&lt;br /&gt;&lt;br /&gt;You won't find this documented ANYWHERE other than here, as far as I &lt;br /&gt;can tell.</description>
		<dc:creator>York Gibson</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-12-04T05:36:04</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77578">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#77578</link>
		<description>Sorry I have diligently followed all of the instructions here and have hit &lt;br /&gt;problems, I've been trying to get started with as3 for days and have got &lt;br /&gt;nowhere. When I run the helloWorld.fla I get: &lt;br /&gt;&lt;br /&gt;&quot;Error: Error #2136: The SWF file file:///550Gb%20Bay%202/work/&lt;br /&gt;experimental%2Fuseful/actionscript%203.0%20learning/hello%20world&lt;br /&gt;%20test/HelloWorld.swf contains invalid data.&lt;br /&gt;	at Greeter/::frame1()&quot;&lt;br /&gt;&lt;br /&gt;Also there is no mention here of how to link to the class file - I have &lt;br /&gt;assumed that I should set the Document Class to Greeter in the &lt;br /&gt;properties inspector??&lt;br /&gt;&lt;br /&gt;Can anyone help?</description>
		<dc:creator>York Gibson</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-11-29T08:14:05</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#77464">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#77464</link>
		<description>Has anyone been able to get this to work on a Mac?  The first example &lt;br /&gt;works fine, but the &quot;enhanced&quot; app doesn't work.  Error says &quot;Type was not &lt;br /&gt;found...&quot; and &quot;call to possibly undefined method&quot;, and no text appears in &lt;br /&gt;mainText.</description>
		<dc:creator>kalibahlu</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-11-27T13:29:33</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#76180">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#76180</link>
		<description>It's all about setting &quot;textIn&quot; to &quot;single line in&quot; the properties inspector.</description>
		<dc:creator>skinnycatgide</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-11-05T20:56:30</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#75594">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#75594</link>
		<description>Hey guys, you must begin programming this code in this way:&lt;br /&gt;&lt;br /&gt;mainText.border = true;&lt;br /&gt;textIn.border = true;&lt;br /&gt;&lt;br /&gt;var myGreeter:Greeter = new Greeter();&lt;br /&gt;mainText.text = myGreeter.sayHello(&quot;&quot;);&lt;br /&gt;&lt;br /&gt;textIn.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);&lt;br /&gt;textIn.addEventListener(KeyboardEvent.KEY_UP, limpaTextField);&lt;br /&gt;&lt;br /&gt;function keyPressed(event:KeyboardEvent):void {&lt;br /&gt;	if (event.keyCode == Keyboard.ENTER) {&lt;br /&gt;		mainText.text = myGreeter.sayHello(textIn.text);&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function limpaTextField(event:KeyboardEvent):void {&lt;br /&gt;	if (event.keyCode == Keyboard.ENTER) {&lt;br /&gt;		textIn.text = &quot;&quot;;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;when we set free the button, the textfield yet guards an 'enter' in him because a 'enter' is composed by the whole process of rise and descent of the button. soon, we should clean this in the rise of the button. did understand me? Sorry for my english =]</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-25T05:54:53</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74883">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#74883</link>
		<description>I do not understand the significance of &quot;static&quot;. If I were not to add static in this example, what would happen?</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-12T11:23:30</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74555">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#74555</link>
		<description>Check that you have enterd first letter capital.&lt;br /&gt;&lt;br /&gt;means, &quot;Frank &quot;will work,but &quot;frank &quot;is wrong.</description>
		<dc:creator>try_test</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-05T21:55:18</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/main/00000035.html#74546">
		<title>flash/9.0/main/00000035.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/main/00000035.html#74546</link>
		<description>It works fine.  Just make sure the input text field is set to &quot;Single line&quot;, not &lt;br /&gt;&quot;Multiline&quot;.</description>
		<dc:creator>texdc</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-05T14:32:30</dc:date>
	</item>
	</rdf:RDF>

