-
Hello!
I have to make a FAQ section from a access database, PHP/ASP and my flash movie. I have two rows (among others) in my database q and a. When i go to my FAQ section in the flash page, i whant all the questions to be fetched fram the database. (I have that working.) But the challenge now, is that every question "string" has to become a lank, that opens a popupsite whith the correct answer from the database.
How can i do this? I tryed a few thing but I have to say i'm lost...
THANX goos
-
__OSX powered__
You need a movie clip with the followiing:
a dynamic text field named "question"
a button on top of it
then for the generation of the movie clips, lets say that your question is loaded in with : "question0", "question1" +++
place 10 instances of your movieclip on your timeline, name them "question_field0" -> "question_field9"
Code:
for(i = 0; i < 10; i++){
field = _root["question_field" + i];
field.question = _root["question"+i];
}
then on the button have a action that goes:
Code:
on(press){
getURL("faq.php?question=" add this.question, "_blank");
}
then in your pop-up get the $question variable and display it.
That should generate 10 fields with your string in it, if you have more than 10 questions: make a "next" button and display the next 10 in the same movieclips.
-
Thank you very much, it's big help!
But i forgot to mention, that i don't know how many quetions there are. I'm not the one updating the database, I only have to show the content, no matter how many enties there are....
-
__OSX powered__
Just send back a "total_question=23" variable, then you can show 10 & 10 question on the screen.
Include a "current_page=1" to see how many pages you need to flip through.
Now you can show a "next" button if "total_question" is over 10, and a "previous" button if the "current_page" is above 1.
-
i will try that!! thanx - one last thing: how can i show all my questions in a scrollbar? still not knowing how many there are?
goos
-
__OSX powered__
That's one issue I just solved in a glossary by loading in all terms, initially display 10, then have a arrow up and down, and if the "question_number" was above 10 I could send them to the "next page", it's not a scrollbar, but it looks and feels like on, only that when you click you get the next 10 automaticly.
Found that to be the best way , since each character a-z could have everything from 5 -> 100 (1000) terms in it, and more would be added later.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|