Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 07-04-2005, 02:52 PM   #1
silverbitz
Flash Chick
 
silverbitz's Avatar
 
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
Question onPress function to print data from php?

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?
silverbitz is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:11 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.