
29-08-07, 22:24
|
|
Junior Member
|
|
Join Date: Aug 2007
Location: Dallas
Posts: 10
Rep Power: 0
|
|
There should be a page that appears after the student either gets the answer right or if we decide to limit the number of times he can get it wrong. In that case a page appears. There is either a page of scrollable text or a graphic. Once the student is satisfied that he has gathered the information necessary from the additional information he goes on to the next question. The two fields that would generate that information would probably be a AddInfoTxt item and an AddInfoGraphic item. I would guess it would be pretty much the full page which is nearly 800 x 600.
The code that would create the page a text box and a simple scroll would be something like this but there would be some changes in extracting it from the text file as in this example or from a text file.
var external_txt:TextField = new TextField();
var externalReq:URLRequest = new URLRequest("external.txt");
var externalLoad:URLLoader = new URLLoader();
externalLoad.load(externalReq);
externalLoad.addEventListener(Event.COMPLETE, textReady);
up_btn.addEventListener(MouseEvent.CLICK, scrollUp);
down_btn.addEventListener(MouseEvent.CLICK, scrollDown);
external_txt.x = 175;
external_txt.y = 100;
external_txt.border = true;
external_txt.width = 200;
external_txt.height = 200;
external_txt.wordWrap = true;
external_txt.multiline = true;
addChild(external_txt);
function textReady(event:Event):void{
external_txt.text = event.target.data;
}
function scrollUp(event:MouseEvent):void
{
external_txt.scrollV --;
}
function scrollDown(event:MouseEvent):void
{
external_txt.scrollV ++;
} |
|