Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.split into arrays?

Status
Not open for further replies.

Cheech

Technical User
Nov 6, 2000
2,933
EU
Hi

I am trying to get the following code to work.
Code:
Code:
import flash.external.ExternalInterface;
var getScore = ExternalInterface.call("parent.SCORM_GetDataChunk"); 
var susData = getScore.split("=")[1];
veiwData = susData.split("|",1);
arrVisited = veiwData.split(",");
for (i=0;i<arrVisited.length; i++) {
fnClicked(arrVisited[i]);
}
The getScore string originally looks like
"visited=1|lastVisited=1|time=1:30" or "visited=1,2,5|lastVisited=5|time=3:30"
It is the string of numbers after visited= that I am trying to pass through to fnClicked?
My problem is arrVisited is always undefined?
Thanks for any help.

TC

[Peace][Pipe]
 
Hi,
I finally figured this out..
In case it might help someone else
Code:
import flash.external.ExternalInterface;
var getScore:Object;
var susData:String;
var vewData:Array;
var arrVisited:String;
getScore = ExternalInterface.call("parent.SCORM_GetDataChunk"); 
var getScore:String;
susData = getScore.split("=")[1];
vewData = susData.split("|",1);
arrVisited = vewData[0].split(",");
TC

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top