﻿var _movieName = "testcommand";

function thisMovie() {
    return document[_movieName];
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded(theMovie) {
    if (typeof (theMovie) != "undefined") {
        return theMovie.PercentLoaded() == 100;
    } else {
        return false;
    }
}

function setVar(arg) {
    if (movieIsLoaded(thisMovie())) {
        thisMovie().SetVariable("myObject.myVal", arg);
    }
}
