import utils.Util fails?

I am following the tutorial from the Adobe Flex 2 : Training form the source book
and have followed the instructions provided but I can't seem to get that utils.Util package imported.
Below is part of the code I have and the error i'm getting this error everytime I try to use Util

1120: Access of undefined property Util.

Any guidance appreciated.
Thanks

<mx:Script>
	<![CDATA[
		import utils.Util;
		import mx.rpc.xml.DataType;
		import mx.collections.ArrayCollection;
		import mx.rpc.events.ResultEvent;
		import flash.net.FileReference;
						
		
		private function populateForm(event:Event):void {
			var selectedNode:Object = event.target.selectedItem;
			if(selectedNode.@prodName != undefined) {
				Util.presetList(unitID,"unitID",selectedNode.@unitID);
				prodName.text = selectedNode.@prodName;
				cost.text = selectedNode.@cost;
				listPrice.text = selectedNode.@listPrice;
				description.text = selectedNode.@description;
				isOrganic.selected = Util.yesNoToBoolean(selectedNode.@isOrganic);
				isLowFat.selected = Util.yesNoToBoolean(selectedNode.@isLowFat);
				imageName.text = selectedNode.@imageName;
				
			} else {
				resetForm();
			}
		}
 
		
	]]>
</mx:Script>

Open in new window

CoreNeterAsked:
Who is Participating?
 
julianopolitoConnect With a Mentor Commented:
This is probably a class that came with the book (in cd exercises), and you should have your project pointing to the folder with that package, or just copy the utils folder into your project folder. this is not a standard flex class.
0
 
CoreNeterAuthor Commented:
Ah I see, I was going crazy over this because it seemed there was a package called flash.utils,
Thanks for the heads up, i'm reading from an ebook and don't  have the project files.
0
 
gdzillaCommented:
Hey CoreNeter,
I don't know if you're still interessted in this problem. But the Util - class can be found in one of the excerpts on the adobe website itself.

Just download one of the example lessons and copy paste the folder you want :)

http://www.adobe.com/devnet/flex/articles/tfs_excerpts.html

0
 
spamsickleCommented:
People are running into the same problem with the Adobe Flex 3: Training from the Source book.

I'm going through that book without opening the CD-ROM, and the first time I actually need the 2 functions from the custom Util class in in chapter 6.  I've simply coded my own "custom" versions of the actionscript.

For Util.presetList, I coded:


					// my version of missing Util.presetList
					for(var i:Number = 0; i < unitID.dataProvider.length; i++)
					{
						if(unitID.dataProvider.getItemAt(i)["unitID"] == selectedNode.@unitID)
						{
							unitID.selectedIndex = i;
							break;	
						}
					}

Open in new window

0
 
spamsickleCommented:
People are running into the same problem with the Adobe Flex 3: Training from the Source book.

I'm going through that book without opening the CD-ROM, and the first time I actually need the 2 functions from the custom Util class in in chapter 6.  I've simply coded my own "custom" versions of the actionscript.

For Util.yesNoToBoolean, I coded:

					// my version of missing Util.yesNoToBoolean
					isOrganic.selected = 
						(selectedNode.@isOrganic.toLowerCase() == "yes") ? true : false;
					isLowFat.selected = 
						(selectedNode.@isLowFat.toLowerCase() == "yes") ? true : false;

Open in new window

0
All Courses

From novice to tech pro — start learning today.