Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
var watchList = new Array();
var watchIV = setInterval(this, "watchClips", 4);
function watchClips() {
for (var i=0; i<watchList.length; i++) {
if (!watchList[i]._src.getDepth()) {
trace("Objekt " + watchList[i]._name + " entfernt");
watchList.splice(i, 1);
}
}
}
function watchClip(obj) {
if (!inWatchList(obj)) {
watchList.push({_src:obj, _name:(obj._target)});
}
}
function inWatchList(obj) {
for (var i in watchList) {
if (watchList[i]._src == obj) return true;
}
return false;
}
// Testen:
var mc1 = this.createEmptyMovieClip("mc1", 1);
var mc2 = this.createEmptyMovieClip("mc2", 2);
createBut(mc1);
createBut(mc2);
watchClip(mc1);
watchClip(mc2);
function createBut(obj) {
obj.beginFill(0xFF0000, 100);
obj.moveTo(0, 0);
obj.lineTo(50, 0);
obj.lineTo(50, 50);
obj.lineTo(0, 50);
obj.lineTo(0, 0);
obj._x = Math.random() * Stage.width;
obj._y = Math.random() * Stage.height;
obj.onPress = function() {
this.removeMovieClip();
}
}
Interval = setInterval(checkWin, 10);
function checkWin()
{
if(this == true)
{
//....
}
}
Nein, denn wenn ein MC weg ist, ist er weg und kann auch nichts mehr ausführen. Du wirst die Existenz der Instanz von außen beobachten müssen.das wird wohl kaum klappen
var MC:Movieclip = emptyMovieclip_mc.attachMovie("test_mc", "test_mc", 0);
MC._x = empty....
.....