1 Replies - 5391 Views - Last Post: 13 August 2012 - 02:22 PM

#1 bryanbelle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-August 12

AS3 to get data from ASP file (variables)

Posted 12 August 2012 - 12:46 AM

Hi,

I hope anyone can guide me here on AS3 loading ASP file in a textfield.

I am new to AS3 and ASP. I just need to load the list of Doctors name in the textfield on AS3

Hoping anyone here can help a poor fellow :)

below is my AS3 code:
//Create the URLLOader instance
    var myLoader:URLLoader = new URLLoader()
    //the data will come as URL-encoded variables
    myLoader.dataFormat = URLLoaderDataFormat.TEXT;
    //Load using an URLRequest, even beeing local
    myLoader.load(new URLRequest("../doctors/thisdoctor.asp"))
    //onload handler listener
    myLoader.addEventListener(Event.COMPLETE, onDataLoad)
    //add a listener for the complete event
    function onDataLoad(evt:Event){
        for(var i:uint=0; i<evt.target.data.cant; i++){
            this["docname"+i].htmlText  = "<b>"+evt.target.data["Doctors Name"+i]+"</b>"
            this["docdesignation"+i].text = evt.target.data["Doctors Designation"+i]
            var loader:Loader = new Loader()
            this["holder_mc"+i].addChild(loader)
            loader.load(new URLRequest(evt.target.data["Image"+i]))
        }
    }



and below my ASP code:
<%
	sub displaydoctorprofile(doctorname)
	
		doctorname = StripHTML(TRIM(Request.QueryString("doctorname")))
	
		set rs = server.CreateObject("ADODB.recordset")
		rs.CursorLocation = adUseClient
	
		strQuery = ""
		strQuery = "SELECT * FROM tbl_website_doctors " &_ 
					" INNER JOIN tbl_website_master " &_
					" ON tbl_website_doctors.DoctorDept = tbl_website_master.ID " &_
					" WHERE tbl_website_doctors.DoctorName = '" & doctorname & "' AND tbl_website_doctors.Active = '1'"
		rs.Open strQuery, conn, adOpenStatic, adLockOptimistic
		if rs.RecordCount = 0 then
			response.redirect BaseURL
		else
			docname = TRIM(rs("DoctorName"))
			docdesignation = TRIM(rs("doctordesignations"))
			docdept = TRIM(rs("description"))
		
			'active
		end if
		
		rs.Close
	
		set rs = nothing
		set conn = nothing
	
		if docspecialinterest <> "" then
			ShowDocSpecialty = "Dr. " &  docname & " has clinical interests in " & docspecialinterest & "."
		else
			ShowDocSpecialty = "<strong style=""color:#ff0000;"">Profile Being Updated</strong>"
		end if
	
									</span>
<%
		Response.Write	"</div>"
	end sub
%>	



All the best,

BB

Is This A Good Question/Topic? 0
  • +

Replies To: AS3 to get data from ASP file (variables)

#2 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 999
  • View blog
  • Posts: 4,177
  • Joined: 14-February 08

Re: AS3 to get data from ASP file (variables)

Posted 13 August 2012 - 02:22 PM

What issues are you having? Do you have errors?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1