# ExternalInterface and an LMS

**URL:** <https://forum.kirupa.com/t/externalinterface-and-an-lms/215346>\
**Category:** flash\
**Created:** [February 6, 2007, 4:30pm UTC](https://forum.kirupa.com/t/externalinterface-and-an-lms/215346 "2007-02-06T16:30:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skot00mc](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@skot00mc](https://forum.kirupa.com/u/skot00mc)\
**Post date:** [February 6, 2007, 4:30pm UTC](https://forum.kirupa.com/t/externalinterface-and-an-lms/215346/1 "2007-02-06T16:30:33Z")

</div>

I’m trying to achieve bookmarking through use ExternalInterface.call. I’m not getting the results I want. Here’s my HTML:

```auto
//Alert user to bookmarking if returning
    var oprompt;
    function promptUser() {
        if(api.LMSGetValue("cmi.core.lesson_status") != "not started") {
            var x = window.confirm("You are returning from a previous attempt in this course. Would you like to return from where you left off?");
            if (x) {
                oprompt = api.LMSGetValue("cmi.core.lesson_location");
            } else {
                oprompt = 2;
            }
        } else {
            oprompt = 2;
        }
        return oprompt;
    }

```

Here’s my FLA (frame 1) code:

```auto
//This is needed to make any calls to HTML/JS/LMS from Flash
import flash.external.*;

// --> Get bookmark from LMS
var prompt;
function getBkmk(){
    //modstatus = ExternalInterface.call("api.LMSGetValue","cmi.core.lesson_status");
    //bookmarkframe = ExternalInterface.call("api.LMSGetValue","cmi.core.lesson_location");
    prompt = ExternalInterface.call("promptUser");
    ExternalInterface.call("alert","oprompt = "+oprompt);
    _root.gotoAndStop("main",oprompt);
    /*if(modstatus == "incomplete"){
        gotoAndStop(bookmarkframe);
    }else{
        gotoAndStop(2);
    }*/
}
getBkmk();

```

I’m using the ADL Test Suite to test it, but I’ve also put it up on a devbox in my real LMS.

I think the problem is Flash is not receiving the “oprompt” variable.

Any thoughts?
