Skip to main content
Known Participant
June 19, 2007
Question

[URGENT HELP NEEDED] Scroll Textboxes in a Main Textbox & Print Issue

  • June 19, 2007
  • 6 replies
  • 648 views
Hi everyone,

I really need help on this.
I have created a maths quiz for my school and at the last frame of the timeline i will display all the questions, student's input answers as well as the correct answers to each question.
But I am using dynamic text to display student's answer and the rest such as Questions and Correct answer i am putting them in a movie clip.

I know that to make a scroll bar we need the textfield to be dynamic and we will put the message in the textfield using actionscript. Because some of the questions are too long and i cant fit all the questions, student's ans and correct ans in a frame, so i separate them into different frames. But now i am told to put all the questions, student's ans and correct ans in the same frame but using Scrollbars to scroll.

Is it possible for me to put all the student's ans (dynamic txt) in one main dynamic textbox and create a scroll bar to scroll?
I am sorry if i sound confusing... Anyone please help? Is it possible to do this?

Another thing is that i need to print out all the answer from that certain frame. But will i be able to print all the thing out since there is the scrollbar?
This topic has been closed for replies.

6 replies

Inspiring
June 21, 2007
The printing side of it is something I am less familiar with, but I don't think you'll want to print the frame with the TextArea as it is because I'm assuming it will only print the text that's visible inside the scroll range.

I think I did something similar some time ago by having a dedicated movieclip (_visible set to false or offstage?) which is set up for printing ,i.e. that would display the text in a different way than you would do it on-screen where you have scroll bars etc.

Others undoubtedly know more about this - its been a long time since I did that kind of thing - and the printing support in flash has improved since then so perhaps this advice is outdated.
Inspiring
June 21, 2007
Thanks GWD!

Also, it will be helpful if anyone tells how to send the content of a text field to the printer as this is a familiar need.
Inspiring
June 21, 2007
quote:

I know that to make a scroll bar we need the textfield to be dynamic and we will put the message in the textfield using actionscript.


MurMeeKeer didn't mean that literally - it was an example of how to use the TextArea - you can think of it as pretty much the similar to using a dynamic textfield... but you get the scroll bars.
What is the name of your message variable? E.g. if its in a variable called myMessageVar... (e.g. "you got answer 1 right and anwer 2 wrong etc etc and your total score was 10 out of 12.." ) then using a TextArea is

myTxt_ti.text = myMessageVar;

For this to work, you will need to have already created/calculated the summary report string of the quiz and assigned it to (in the example) a variable called myMessageVar and have a TextArea instance named myTxt_ti in the same frame (at the end of the quiz) All you're telling the myTxt_ti TextArea component to do is to display the text message which you have created.
IreDevilAuthor
Known Participant
June 28, 2007
quote:

Originally posted by: GWD
quote:

I know that to make a scroll bar we need the textfield to be dynamic and we will put the message in the textfield using actionscript.


MurMeeKeer didn't mean that literally - it was an example of how to use the TextArea - you can think of it as pretty much the similar to using a dynamic textfield... but you get the scroll bars.
What is the name of your message variable? E.g. if its in a variable called myMessageVar... (e.g. "you got answer 1 right and anwer 2 wrong etc etc and your total score was 10 out of 12.." ) then using a TextArea is

myTxt_ti.text = myMessageVar;

For this to work, you will need to have already created/calculated the summary report string of the quiz and assigned it to (in the example) a variable called myMessageVar and have a TextArea instance named myTxt_ti in the same frame (at the end of the quiz) All you're telling the myTxt_ti TextArea component to do is to display the text message which you have created.


Wah, this is sooo confusing.
But it I will try to figure it out.
IreDevilAuthor
Known Participant
June 21, 2007
But what i mean is i do not want to enter text in the text area using AS.
Because I am creating a quiz, and i need to store the student's ans in a variable and display it out at the end of the quiz...
IreDevilAuthor
Known Participant
June 21, 2007
I've found it in MX 2004.
By using text area instead of dynamic do you mean i can store the student's ans in a variable and pass it to the text area? Then i add a scroll bar to the text area?
Inspiring
June 21, 2007
Yes. You can use the text area component directly but no need to put the details in a variable and then to text area. If you text area component instance name is 'myTxt_ti', then you can use like this:

myTxt_ti.text = "Your text will come here"

Also, no need to attach a scroll bar. If the text exceeds the height, a vertical scroll bar will be attachd automatically.
IreDevilAuthor
Known Participant
June 21, 2007
How do i use text area component?
Does MX 2004 version have this component?
Inspiring
June 21, 2007
It's available in the components panel (Window/Components or ctrl+F7).

Sorry, I don't know whether it is available in MX 2004 or not. But, I little remember that once I used the components in MX 2004. Not sure.
Inspiring
June 20, 2007
Hi,

You can use text area component instead of a dynamic text.