//Next Button function
mc_nextBtn.addEventListener (MouseEvent.CLICK, goForward);
function goForward (e:MouseEvent):void
{
page = xmlData.contentItem[currentContentItem + 1].toString();//this line stores the external swf in the page variable (var page:String)
scorm.set ("cmi.location", page);//setting the external swf (appears in SCORM debugger as ‘swfs/xyz.swf’)
}
function xmlLoaded (e:Event):void
{
xmlData = XML(e.target.data);
bookmark = scorm.get("cmi.location");
if (bookmark == "true")//if there is a stored value, do the following
{
coursePages = new URLRequest(xmlData.contentItem[page].toString());//calling to the page variable (incorrectly obviously) in hopes to load it…instead, page 1 appears.
coursePageLoader.load(coursePages);
coursePageLoader.x = 0;
coursePageLoader.y = 75;
totalPages.text = "Page " + pageNumber + " of " + xmlData.contentItem.length();
}
else//load it from page 1
{
loadCoursePage ();
trace ("bookmark is false");
}
}
//this is the typical load command in which it starts at page 1
function loadCoursePage ():void
{
coursePages = new URLRequest(xmlData.contentItem[currentContentItem].toString());
coursePageLoader.load (coursePages);
coursePageLoader.x = 0;
coursePageLoader.y = 75;
totalPages.text = "Page " + pageNumber + " of " + xmlData.contentItem.length();
}
{
coursePages = new URLRequest(bookmark);
function goForward (e:MouseEvent):void
{
page = xmlData.contentItem[currentContentItem + 1].toString();//this line stores the external swf in the page variable (var page:String)
scorm.set ("cmi.location", currentContentItem + 1);//setting the external swf (appears in SCORM debugger as ‘swfs/xyz.swf’)
}
Then your xmlLoaded() function would look like:
function xmlLoaded (e:Event):void
{
xmlData = XML(e.target.data);
bookmark = scorm.get("cmi.location");
if (bookmark != null && bookmark != "")//if there is a stored value, do the following
{
coursePages = new URLRequest(xmlData.contentItem[bookmark ].toString());--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "eLearning Technology and Development" group.
To post to this group, send email to elearning-technolo...@googlegroups.com
To unsubscribe from this group, send email to elearning-technology-and...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/elearning-technology-and-development?h...
-~----------~----~----~----~------~----~------~--~---
Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com
--
Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com