Ultrashock Forums > Flash > Flex
Default Getting error #1009 desperately need help

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Default Getting error #1009 desperately need help
Old 2008-10-18

Ive created a search engine in flex not to elaborate and it works to a certain extent. the timeline is i input a word and hit the search button it sends the word to a php script that looks in the database for entries in a table that match then returns the values of the rows to the php file and spits out an xml file. The xml is then parsed by the search engine and the nodes are put into an array collection whos data is then used by my itemRenderer to populate a list component.

Now the problem i have is that if i input a search word that i know has more than one entry in the database all the code works the search works and it populates the list properly. However if i input a word that has only 1 or no entry it get the error #1009 and i cant figure out why. i kind of understand if the arrayCollection has nothing in it since its a null object but when i know theres an entry it makes no sense why its spitting that error out.. heres my mxml code for the search engine..

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="644" height="374" backgroundColor="#ffffff">
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			
			[Bindable] private var resultList:ArrayCollection;
			[Bindable] private var resultHolder:ArrayCollection;
			
			/* private function init():void
			{
				writeData.send();
			} */
			public function startSearch():void
			{
				var validEntry:Boolean = ! ( search_txt.text == "" );
				if ( validEntry )
				{
					var objSend:Object = new Object();
					objSend.searchee = search_txt.text;
					writeData.send(objSend);
				}
				else
				{
					Alert.show("Please input a search");
				}
			}
			private function faultHandler(event:FaultEvent):void
			{
				Alert.show('There was a problem');
			}
			 private function resultHandler(event:ResultEvent):void
			{
				try
				{
					resultList = writeData.lastResult.businesses.business;
				}
				catch(error:Error)
				{
					Alert.show("Unable to display results!");
				}	
			} 
		]]>
	</mx:Script>
	<mx:HTTPService id="writeData" url="searcher2.php" showBusyCursor="true"
		fault="faultHandler(event)" result="resultHandler(event)" useProxy="false" method="POST" />
	<mx:VBox id="my_searcher" paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10" width="644" height="374">
    		<mx:FormItem direction="horizontal" width="100%" paddingLeft="-14">
    			<mx:TextInput id="search_txt" width="100%" />
    			<mx:Button id="search_it" label="Search" click="startSearch()"/>	
    		</mx:FormItem>
    		<mx:List id="rl" dataProvider="{resultList}" 
    			itemRenderer="components.resultRenderer" width="100%" height="100%">
    	</mx:List>
	</mx:VBox>
</mx:Canvas>
if you need to see the custom itemRenderer code let me know and ill post..Please help i have no idea why its not working and im really pressed for time..Thank you in advance for those who can help..
postbit arrow 2 comments | 549 views postbit arrow Reply: with Quote   
Registered User
hpnotiqtymes is offline
seperator
Posts: 5
2007-12-17
hpnotiqtymes lives in United States
seperator

Ultrashock Member Comments:
hpnotiqtymes hpnotiqtymes is offline hpnotiqtymes lives in United States 2008-10-19 #2 Old  
Please any help would be greatly appreciated as i am really stumped on how to get this to work ived tryed a couple of different ways and still cant get it to work..thank you in advance for the help if any..
Reply With Quote  
mindtwitch's Avatar mindtwitch mindtwitch is offline mindtwitch lives in United States 2008-10-20 #3 Old  
Can you paste in the full error message you are getting? Should provide a little more information about what/where your problem is.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: