Archive of 3rd Party Tools Discussion

Page: (Previous)   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18 ...72   (Next)
Title: fscommand LMSGetValue call from Flash
Description: I can't get anything returned to Flash
Author: Chris Flynn
Initial Date: April 3, 2007
Responses: 1
Last Post:
April 7, 2007
Posting:
04/03/2007 04:45:16 PM



Chris Flynn

Posts:
Joined: 12/20/2006

Hi all

I'm using fscommands to communicate with the SCORM 1.2 template published from Flash. I need to use fscommand because, even though I'm working in Flash 8, I'm working in an older file that was created in Flash 7. And everything breaks when I try to publish it to version 8.

So I can't use the ExternalInterface method, I have to use fscommands.

Now my problem is that I'm able to write to the LMS using the following:

fscommand("LMSSetValue", 'cmi.suspend_data,'+toLMS); //<--toLMS is a string of text i want saved
fscommand("LMSCommit", "");

BUT I'm not able to retrieve that string later. I try to use:

fscommand("LMSGetValue", "cmi.suspend_data,returnVal"); //<--returnVal is a string declared earlier

Ive also tried a number of variations like:

fscommand("LMSGetValue", 'cmi.suspend_data,'+returnVal);
var fromLMS:String = String(fscommand("LMSGetValue", "cmi.suspend_data,returnVal"));
textbox.text = String(fscommand("LMSGetValue", "cmi.suspend_data,returnVal"));
fscommand('LMSGetValue', 'cmi.suspend_data,returnVal');

Nothing has returned anything.

I do know for certain that my main_DoFSCommand in my HTML is called, it then calls the SCOGetValue, and that successfully calls the LMSGetValue function. And at each call, the variables being passed are all as expected.

So this is making me wonder if I'm actually calling it correctly from Flash in the first place. And with anything pertaining to SCORM and Flash, I haven't found much out there pertaining to this, so hopefully someone here can help.

Thank you in advanced
Chris
 
04/07/2007 06:40:23 PM



Leo Lucas

Posts: 260
Joined: 11/13/2002

Hi Chris,

fscommand("LMSGetValue", "cmi.suspend_data,returnVal"); is the correct syntax. But, your returnVal variable has to be associated with a dynamic_text object. The returnVal cannot by a variable that you define in ActionScript.

Also, the data returned from LMSGetValue will not be immediately available in returnVal. The data will be returned sometime in the future. Your Flash movie will have to wait for the value of returnVal to change. You can wait for the value of the variable to change using the onEnterFrame event in a movie clip or with a timer.

Our Flash Course Development Toolkit uses the onEnterFrame event to get the values of SCORM data items.

-------------------------
Leo Lucas
e-Learning Consultant
http://www.e-learningconsulting.com

Page: (Previous)   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18 ...72   (Next)