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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Links Dynamically

Status
Not open for further replies.

TigerGirl7

Programmer
Apr 8, 2003
152
US
hi again!

so, a friend of mine wants to create a newsroom on his flash web site that i've designed for him. he is currently able to create html press releases via a php admin that someone designed for him.

we want to display the dates and titles of the press releases in the flash website. clicking on a title will launch an html popup. how is it possible to control the dates and titles using the php admin?

I know how to create text in movie clips using an external txt file. I don't know how to make them links. The other problem is that titles would need to list in chronological order from most recent on down. I guess this would require something that pushes titles down as new ones are published.

Any suggestions? I'm not a programmer...

cheers,
;) jen
 
I believe that your friends news releases are created using PHP and are stored in a mySql database. I think that you're going to have to build an interface that can communicate with mySql and process sql statements that would query the database (presumably the title and date). Those queries can dynamically sort the query results as needed. I've not done much with PHP & mySql so this is about as far as I can take you. I suggest that you do a search both here and in google for soemthing like php & flash, flahs & mySql, etc.

Good luck....

There's always a better way. The fun is trying to find it!
 
thanks! I've come up with some interesting results on actionscript-toolbox.com but if anyone wants to throw in their 2 cents, go right ahead.

jen
 
Connecting to the database is pretty easy. You need to use loadVars() to talk to the PHP script:

Code:
lv = new LoadVars();// object to send information
rv = new LoadVars();// object to receive information
lv.onLoad = function() {
	// show data returned from php
	trace(this.newsStory1);
};
lv.sendAndLoad('phpScript.php', rv, 'POST');

The data sent from the PHP script needs to be formatted as name/value pairs like this:

Code:
&newsStory1=this is new story one blah blah blah&newsStory2=this is news story two blah blah

...which may mean making changes to your PHP script in ordert o get the formatting right.

 
Creating links is the same in Flash as in HTML:

Code:
<a href='[URL unfurl="true"]www.somesite.com'[/URL] target='_blank'>click here</a>

Make sure your text box is set to HTML formatting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top