Check value once swf is loaded
There are 50 movies loaded sequentially. From Q1 thru Q29 I want to attach a particular title (mc) to the main movie and then for Q30 thru Q40 another and so on. The file is on an Learning Management Sytem so I'm using SCORM code.
A movie is loaded in a clip in the main movie. A bookmark is set.
_parent.saveBookmark("Q1");
_parent.test1();
The main move has this code on the first frame:
function saveBookmark(loc:String) {
scorm.set("cmi.core.lesson_location", loc);
scorm.save();
}
function getBookmark():String {
return scorm.get("cmi.core.lesson_location");
}
var bookmark:String = getBookmark();
var mySubstring:Number = Number(bookmark.substr(1));
//There's a Q in my bookmark!
if(bookmark.indexOf("Q") !== -1 && bookmark !== undefined){
//add the underscore after the Q to match filename
bookmark = bookmark.split("Q").join("Q_");
swfURL = bookmark +".swf";
trace(swfURL);
}
function testi() {
trace(mySubstring);
trace("ahhh");
if (mySubstring <= 29 && isNaN(mySubstring) == true && bookmark !== undefined){
attachMovie("title_foundational", "ttl_foundational", 1, {_x: 217, _y: 5});
}}
startPreload(swfURL);
I'm lost.