Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash mx and sql server

Status
Not open for further replies.

magmo

Programmer
May 26, 2004
291
SE
Hi


I would like to get a record from a sql server using macromedia flash MX, does anyone know of any tutorials on that?
 
You will have to use a server side script (ASP, PHP, JSP) to do it. Flash can not connect directly to the database, but can connect to the server side page.

Wow JT that almost looked like you knew what you were doing!
 
Hi


I cant get it to work... here's what I do...

create a new dynamic text field and name it strSumm, then I convert it to a movie and give the movie the following action script...

onClipEvent(data)
{
strSumma = SummaRightNow;
}

onClipEvent(load)
{
loadVariables ("GivenMoney.asp", this);

}


but when I test the movie I get this error...


**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent(data)

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 6: Clip events are permitted only for movie clip instances
onClipEvent(load)

Total ActionScript Errors: 2 Reported Errors: 2




Does anyone see what I do wrong here?


Regards

M
 
Try this:

Did you give the movie clip you created an instance name? In other words you have an MC with the dynamic text area "strSumma" inside of it. Right? From the looks of the errors you are getting you did not create a MC containing the dynamic text box. (and you don't really need to). I would recommend using LoadVars instead of loadVariables.

Try this:

On your main timeline create your text box with the instance name of "strSumma".

Create an actions layer in your main timeline. On frame 1 of the actions layer add the following code.

Code:
myVars = new LoadVars();
myVars.onLoad = function(success){
   if(success){
      _root.strSumma.text = myVars.SummaRightNow;
   }else{
      _root.strSumma.text = "Error";
}
myVars.load("givenmoney.asp");

That should work for you. Remember your asp page must be returning name/value pairs for Flash to be able to parse it.

Hope it helps.


Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top