So basically, I need to find a way to retrieve the image url that is stored in a database, and I need to do it through asp.net if possible (I want to avoid XML if I can). I'm an actionscript 3 newbie so I don't know what calls I might use to connect to the .net page, but I am able to retrieve the data through SQL to the .net page. Any help would be appreciated.
Asked
Active
Viewed 91 times
2 Answers
1
Web services are standard way to do this. Yes, it is xml, but i do not see a reason why not use it.

Tomas Voracek
- 5,886
- 1
- 25
- 41
-
I would prefer not to rely on XML because I am attempting to create an application that dynamically pulls data from the DB and uses it in the program. With XML files, I'd have to create XML files manually (from what I understand) to have the data pulled from them. Since the content of my db is volatile, it wouldn't be practical for me to be using XML and manually doing what I am making an entire app to automate. – CodedMonkey Jul 05 '11 at 23:47
-
XML in webservices is just data transfer object, and you are not creating it manually, .NET will create body automatically. You must write only WS method returning URL for given image. – Tomas Voracek Jul 05 '11 at 23:50
-
@ExitFailure asp.net webservices will work for you here. They will handle the creation of XML for you. All you need to worry about is consuming the XML via actionscript in your flash element. We have done this extensively in the past. I can not help you with the action script as I was the one developing the web service! – Jon P Jul 05 '11 at 23:54
-
Really now? In that case, thanks guys! I will have to look into it tomorrow since I must be off now, but I would really appreciate it if someone could link me to a tutorial on this stuff. Thank you! :) – CodedMonkey Jul 05 '11 at 23:58
-
@ExitFailure http://stackoverflow.com/questions/730496/calling-a-method-inside-web-service-in-action-script-3-0 – Tomas Voracek Jul 06 '11 at 00:05
-
http://msdn.microsoft.com/en-us/library/8wbhsy70%28v=VS.90%29.aspx as a starting point. Google will produce many results using: asp.net webservice tutorial. One point to note is you don't need a new project for a web service you can add it to your existing project. If you are using Visual Studio, Add New Item -> WebService – Jon P Jul 06 '11 at 00:09
-
Ok so I am still not understanding what I need to do to get my app working. What calls would I need to make with flash to get the data? I've checked out URLLoader and it only seems to be able to work if the target is in the same domain as the app, so does that mean I have to host my flash app on my site as well? I am just really confused and don't even know where to begin with this. Also, I am not building the site from scratch, I am adding on functionality to it so I'm not sure if a web service would even be possible. – CodedMonkey Jul 06 '11 at 16:12
1
If you really want to go nuts, you could write your own raw socket library which talks to the SQL server directly... but I also wouldn't recommend it, especially since you just need text data
Just in case you really want to go that route (which again- I strongly discourage)- here is a link to an existing library: http://code.google.com/p/assql/
:)

davidkomer
- 3,020
- 2
- 23
- 58