Welcome to WebmasterWorld Guest from 54.160.244.240

Forum Moderators: open

Message Too Old, No Replies

Read from database with Flash MX

can anyone provide a direction to go?

     
2:48 pm on Nov 19, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 12, 2002
posts:1482
votes: 0


I'm an ASP developer, looking to make a simple news ticker with Flash MX. I'm going to have the data stored in an Access database, then pulled to the flash ticker to display. Are there any sites that provide good tutorials regarding pulling data from a database? I don't want pre-built stuff, I would like to learn how to do it from scratch. I've never used ActionScript before, but I'm sure I can piece together the parts I need.

Thanks for your help.

-Matt

7:42 pm on Nov 20, 2003 (gmt 0)

Moderator from US 

WebmasterWorld Administrator 10+ Year Member

joined:Dec 3, 2002
posts:1908
votes: 4


This might get you started:
http*//www.macromedia.com/devnet/mx/flash/articles/delta_packet.html
1:34 pm on Nov 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 13, 2003
posts:1240
votes: 0


ive been dabbling with something similar - getting bits from a php script into flash.

Ive found that if you have a script that pulls what you need out of database and echos (dont know asp equivilent;)) it out like this:

var1=blah&var2=blah&var3=foo etc

so if you were to goto script url and view source in browser you would see just that var1 etc, no html or anything, you can then call it into flash using something like:


var myVars = new LoadVars();
myVars.onLoad = function(ok) {
if (ok) {

holdermc.box1.text = myVars.var1;
holdermc.box2.text = myVars.var2;
}
};
myVars.load("http://path to script.asp");

holdermc is the 'instance' name of a movieclip to recieve the data.

box1 and box2 are the 'instance' names and 'variable' names of dynamic text boxes that are within the holdermc movieclip that are going to contain the recieved variables, var1 and var2 in this case.

this should load the variables into the dynamic text boxes. obviously you can add as many text boxes as you have variables produced by the script - just add more lines in this format: holdermc.box2.text = myVars.var2;

the last line: myVars.load("http://path to script.asp"); can also have parameters append to the url. in the?usual=way.

the parameters append can also be dynamic, e.g from a input box, just use a variable to hold the info you want to pass and added it like this:

myVars.load("http://path to script.asp?subject="+SUBJECT);

where SUBJECT is a variable containg the output from a input or whtever.

finally, if you then need to animate the recieved data, just animate the contating movieclip as normal. if different data needs different animations, create two or movie 'holdermc' type movieclips - with different instance names.

sorry for going on and on.

ben

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members