I’ve got this button press code:
[left]on (release) {[/left]
if (_root.portfolio == undefined) {
myTimer = setInterval(visibility, 1000);
function visibility() {
trace("hello");
}
_root.createEmptyMovieClip("subLoaderMC", 1);
subLoaderMC._x = 0;
subLaoderMC._y = 0;
//
_root.subLoaderMC.loadMovie("flash/subMovies/portfolio.swf");
//set variable "portfolio" to "on"
_root.portfolio = "on";
_root.windowGlowMC1._visible = 0;
_root.windowGlowMC3._visible = 0;
_root.windowGlowMC4._visible = 0;
}
}
I can’t seem to get the word “hello” to appear in the output window. Not sure why. Any ideas? It works when it’s not in the if statement.
This has been fixed:
[left][color=#b1b100]on (release) {[/left]
[color=#b1b100]myTimer = setInterval(visibility, 1000);[/color]
[color=#b1b100]function visibility() {[/color]
[color=#b1b100]trace("hello");[/color]
[color=#b1b100]}[/color]
[/color][color=#b1b100]if (_root.portfolio == undefined) {[/color]
[color=#b1b100][/color]
[color=#b1b100]_root.createEmptyMovieClip("subLoaderMC", 1);[/color]
[color=#b1b100]subLoaderMC._x = 0;[/color]
[color=#b1b100]subLaoderMC._y = 0;[/color]
[color=#b1b100]//[/color]
[color=#b1b100]_root.subLoaderMC.loadMovie("flash/subMovies/portfolio.swf");[/color]
[color=#b1b100]//set variable "portfolio" to "on"[/color]
[color=#b1b100]_root.portfolio = "on";[/color]
[color=#b1b100]_root.windowGlowMC1._visible = 0;[/color]
[color=#b1b100]_root.windowGlowMC3._visible = 0;[/color]
[color=#b1b100]_root.windowGlowMC4._visible = 0;[/color]
[color=#b1b100]}[/color]
[color=#b1b100]}[/color]
[color=#33bb33][color=#b1b100][CODE[/color]][/color]
[color=#33bb33][/color]
[color=#33bb33]The function can't be in the "if" statement.[/color]