hi!
I have a FlashMx related question, I'm making a flash site which content has to come from a MySQL database and a PHP file. I'm not used to programming much and I'm having trouble. I have a code here that doesn't work and I'm wondering if anyone could help me:
ActionScript Code:
limit = 1;
g = new LoadVars();
g.load("http://intranet:7331/get.php?table=projects&sort=year%20desc");
g.onLoad = function() {
myy = 0
myTextFormat = new TextFormat();
myTextFormat.font = "MyArial";
_root.createTextField(mytextfield,i,30,myy,500,200);
_root[mytextfield].setNewTextFormat(myTextFormat);
_root[mytextfield].setTextFormat(myTextFormat);
_root[mytextfield].text = ""
_root[mytextfield].border = true;
_root[mytextfield].html = true;
_root[mytextfield].multiline = true;
_root[mytextfield].embedFonts = true;
_root[mytextfield].wordWrap = true;
scroll2.setScrollContent(_root[mytextfield]);
}
l = new LoadVars ();
l.load ("http://intranet:7331/get.php?table=projects&sort=year%20desc");
l.onLoad = function (myfunc)
{
_root.createEmptyMovieClip ("mymovie", 500);
for (i = 0; i < this.n; i++)
{
var myMov = _root.mymovie.attachMovie("Btn_Menu", "Btn_Menu" + i, 1000 + i * 10);
_root.mymovie["Btn_Menu" + i]._x = 100;
_root.mymovie["Btn_Menu" + i]._y = 100 + i * 18;
_root.mymovie["Btn_Menu" + i].num = i;
_root.mymovie["Btn_Menu" + i].menuTxt.text += +this["title"+i]+" ("+this["year"+i]+")";
_root.mymovie["Btn_Menu" + i].onPress = function ()
{
_root[mytextfield].text = ""
_root[mytextfield].text += +this["title"+i]+" ("+this["year"+i]+")"+this["description"+i];
}
}
myscrollpane.setScrollContent (_root.mymovie);
}
what I'm trying to do is to get is that when i press on one of the buttons generated with the fields "title" and "year" from my databse, the correspondent title, year and description fields get printed in another textfield. i can get the brackets printed, but the rest doesn't show. My buttons work though, with all the fields showing in them.
Honestly, i don't understand some parts of my script myself, so this might be a very easy thing to fix...
any help?