I have a small file that has a button and a text area. When I hit the button I attempt to connect to SCORM. In the Flash IDE, when I hit connect, it returns “Could not connect to scorm” in the text area as it should. When I test it embedded in the HTML, I get nothing. Any idea why that would be? Is it an embed font issue? Here is my code:
package com.dop.scormtest
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import fl.controls.TextArea;
import fl.controls.Button;
import pipwerks.SCORM;
public class ScormTest extends MovieClip
{
private var lessonStatus :String;
private var lmsConnected :Boolean;
private var success :Boolean;
private var scorm :SCORM;
private var window :TextArea;
private var button :Button;
public function ScormTest()
{
initTest();
}
private function initTest():void
{
window = new TextArea();
window.x = 25;
window.y = 37;
window.width = 550;
window.height = 300;
window.editable = false;
window.text = "Idle.
";
button = new Button();
button.x = 25;
button.y = 355;
button.width = 120;
button.label = "Connect To Scorm";
button.addEventListener(MouseEvent.CLICK, connectToScorm);
addChild(window);
addChild(button);
}
private function connectToScorm(e:MouseEvent):void
{
scorm = new SCORM();
lmsConnected = scorm.connect();
if (lmsConnected)
{
window.appendText("Successfully connected to LMS.
");
}
else
{
window.appendText("could not connect to LMS.
");
}
}
}
}