Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-28-2008, 06:45 PM   PM User | #1
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Adding question to quiz

Hello

I have a Flash quiz which I have downloaded (it was free) and eventually hope to post something like it online, but I need first to come to terms with what is going on in the Timeline.

After answering a question the

function answer (choice) {

advances the user to the next question and at the end of the two questions (!), a total score is given.

The Action Script looks like this:

Code:
var quizTimeline = this;     // Stores reference to the timeline that contains the quiz user interface.
var numQuestions = 2;        // Number of questions in the quiz
var q1answer;                // User's answer for question 1
var q2answer;                // User's answer for question 2
var correctAnswer1 = 3;      // The correct choice for question 1
var correctAnswer2 = 2;      // The correct choice for question 2
answer.currentQuestion = 0;  // Function property: the question being answered
If I wished to add a third or fourth question, or any number of questions, I understand that I need to add to the AS as follows:

Code:
var numQuestions = 5;        // Number of questions in the quiz
var q1answer;                // User's answer for question 1
var q2answer;                // User's answer for question 2
var q3answer;                // User's answer for question 3
var q4answer;                // User's answer for question 4
var q5answer;                // User's answer for question 5
var correctAnswer1 = 3;      // The correct choice for question 1
var correctAnswer2 = 3;      // The correct choice for question 2
var correctAnswer3 = 1;      // The correct choice for question 3
var correctAnswer4 = 2;      // The correct choice for question 4
var correctAnswer5 = 1;      // The correct choice for question 5
What I am unsure about is how to customise the Timeline. I have copied and pasted frames and tried to change the nature of the questions asked (and their numbers) graphically on the stage, but I cannot get it to work doing that. For example, under question 2 I can see question 1, etc after pressing Ctrl + Enter.

What would be the best way of proceeding? I can post the file if it helps.

Many thanks.

Steve
SteveH is offline   Reply With Quote
Old 04-13-2008, 02:48 PM   PM User | #2
jairusbondoc
New Coder

 
Join Date: Apr 2008
Location: Makati Philippines
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
jairusbondoc has a little shameless behaviour in the past
yeah better post the file. i am assuming it might be a same instance problem.
__________________
Hope is a good thing, maybe the best of things. And no good thing ever dies. -Andy Dufresne

Jairus Bondoc PHP Programmer Philippines
jairusbondoc is offline   Reply With Quote
Old 04-15-2008, 11:10 AM   PM User | #3
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Hello jairusbondoc

Many thanks for getting back to me.

I have tried to add a couple of questions to the quiz since my post and have had some success, though it is not completely working.

Confession: I have added them, but I'm not sure how. You mention instance names, but I think I have included them where necessary.

The AS does not pose a problem as the main work to be done is in the timeline.

To add a question, do I simply pull out all the layers by 10 frames and add another layer to introduce an additional question? I am unsure of the sequence of stages I need to go through in order to do it properly.

Many thanks for taking the time to look at it.

Steve
Attached Files
File Type: zip Quiz5.zip (10.8 KB, 105 views)
SteveH is offline   Reply With Quote
Old 09-02-2011, 10:48 AM   PM User | #4
Sajad
New to the CF scene

 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Sajad is an unknown quantity at this point
Unhappy Javascript help

Sir

I have a .js file in which i have placed Urdu text like

function Urdutext()
{
innerHTML.right_column='HTML tags and Urdu text';}

the .js file contains near about 80 lines of urdu text.

When i try to run the .js file it displays only half of the file and where the rest of lines go i dnt know.

And when i include the file in my web page and want to display the urdu text nothing displays becaus the file remains in a wrong syntax. AS i have said I cant understand y the file gets half uploaded and y not full.

Plz help me.

Thanks
Sajad
Sajad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:39 AM.


Advertisement
Log in to turn off these ads.