dynamic flash text
- Started
- Last post
- 11 Responses
- ganon
i am currently building a site entirely in flash, for a client...for his "press" section, he wants a list of articles, which you can click on to display that article...he wants to be able to update and change these...i am bringing in external .txt files, and plan to have one just for initial article titles...is there a way i can make these titles jump to a keyframe label which would have that dynamic article in it?..or is there a better way to do this?..also, can you specify a soft return in simple text?..when i return a line in simple text, it gives me a double-spaced look....
thanks....
- gun0
set the format properties of the textfield to <=0 pt's.
- ganon0
thanks, but i am afraid you are dealing with a actionscript newbie...could you elaborate please?...
- ganon0
ok i got that, adjust the linespacing, thanks...how about linking to the articles...any ideas please?!!.
- ganon0
bmpd
anyone have ideas please?...
- ganon0
ouch
im hurt
- Jnr_Madison0
Do you know any php?
- Duane0
so the list of article titles is dynamic and so are the articles?
- ganon0
no, i dont know php...
yes, the titles are dynamic and link to the full article...both which the client wants to change/update...if this cant be done with external text files, i will persue other options, but since i can do the external text thing myself, i would like to figure out a way to do it this way....any ideas?...
- welded0
It's quite simple to do what you want, actually. You can have as many variables defined in a single text file as you like, so you could have each file structured something like this:
&storyID_1=123&title_1=This Is The Headline&story_1=Blah blah blah blah blah blah blah...[etc]......
Or if you want to use two text files for each story, put the ID and the title in one then the main article in another. This'll speed up the initial loading time. Anyway, since you're already asigning a value to a variable (the title text) it's simple to asign a value to a button on top of the title at the same time. By this I mean:
onRelease {
var storyID = storyID_1;
gotoAndStop("articlePage");
}
(or something like that)So each button will have a different storyID attatched to it based on what text files you've loaded and this ID will determine what story is loaded on your "articlePage" keyframe.
My instructions might be a bit off, it's been some time since I've used Flash but I've done pretty much exactly what you want to do in the past. It might be simpler in the future to use a PHP/mySQL backend, but while learning, flatfiles will work just fine.
Next, if your client want to change the text files himself, then you have two options: a) Either he can modify them offline then FTP them into place and overwrite older files, or b) Use a PHP script to modify the text files. The first option might be easier for you until he messing something up and deletes all of his press articles, but I think it would be in your best interest to spend a bit of time and research how to read-write text files with PHP. It's really quite easy, but if you've got problems, let me know. I know I have an older script kicking around that will point you in the right direction.
So enough reading, get to work and *good luck*!!
:)
- Robo0
Welded - I would love to have a look atb that old script as this is what I am really looking for!
- dstlb0
This might help... http://www.actionscripts.org/tut… ... it explains actions from a dynamic text field, I think it's from text in actionscript but you can do it with external files too.