I have a MS Access query ProductDetailsAll that is queried using an ASP.net web service. The service simply fills a data table with query results.
How do I setup and pass parameters from Flash? I need to sear ProductDetailsAll for records having CategoryID 1 or 3 based on user selection. How is the CategoryID passed from Flash to the web service?
I have created rectangle objects in Flash. Each one must contain product name, description, price and the image from the ProductDetailsAll query. How do I pass the search phrase from Flash to the query? Do I use dynamic text boxes to house the returned values?
Thanks, Sid
EDIT To elaborate further: I have a combo box cbRentalType with values 1 (Sale), 3 (Party) or All. I have a combo box cbCatSelect that needs to read the SubCategory from the database table. I have a textbox txtSearch that will house the product keyword and should be queried from the KeywordID field in the database table.
How do I set outbound variables in Actionscript equal to the values of the above objects?
How do I return query results matching these values and map them into Flash variables?
I have 16 rectangle objects on the movie clip. Each one will house one item from the query result with output of product image, product name, description and price. If the query returns more than 16 records, how do I populate another frame to contain the full query result?
Finally, I found a code sample that is used to setup the ASP.NET web service connection. The AS3 code is as follows:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import mx.rpc.soap.*;
import mx.rpc.events.*;
import mx.rpc.AbstractOperation;
import flash.events.Event;
public class MainDocument extends MovieClip {
private var ProductWebService:WebService;
private var serviceOperation:AbstractOperation;
public function MainDocument() {
// constructor code
addEventListener(Event.ENTER_FRAME, SetupWebService);
}
function SetupWebService(event:Event):void
{
var url:String ="http://www.mydomain.com/WebService/completedb.asmx?WSDL";
ProductWebService = new WebService();
ProductWebService.loadWSDL(url);
ProductWebService.addEventListener(LoadEvent.LOAD,BuildServiceRequest);
}
function BuildServiceRequest(evt:LoadEvent)
{
serviceOperation=ProductWebService.getOperation("GetProducts");
serviceOperation.addEventListene
(FaultEvent.FAULT,DisplayError);
serviceOperation.addEventListener
(ResultEvent.RESULT,DisplayResult);
serviceOperation.send([GenerateRandomNumber(0,9)]);
}
function DisplayError(evt:FaultEvent)
{
trace("error");
}
function DisplayResult(evt:ResultEvent)
{
var productName:String = evt.result as String;
productText.Text=productName;
}
function GenerateRandomNumber(min:int,max:int):int
{
return Math.floor(Math.random()*(1+max-min))+min;
}
}
}