Skip to main content
Inspiring
April 26, 2008
Question

make loaded swf invisible

  • April 26, 2008
  • 3 replies
  • 1061 views
I'm using this code to load in a random swf. I would like to make it invisible until I need it further down the timeline.
I can't make it invisible. Am I coding wrong or is there some other principal at work.

Thanks

var openPixs:Array = new Array ("openPix1.swf", "openPix2.swf", "openPix3.swf", "openPix4.swf");
function randomBackground() {
var randomNumber = random (openPixs.length);
_root.w1.word1x.pix1.loadMovie (openPixs[randomNumber]);
_root.w1.word1x.pix1._visible = false;
};

randomBackground();
This topic has been closed for replies.

3 replies

Inspiring
May 30, 2008
I've been struggling with this for several hours and haven't figured out yet how to do this. My apologies for asking a newb question like, "How do I make sure that the movies are loaded before assigning the _visible property to false?". Follows is a streamlined version of the code I'm using. What can I do to set the second two loaded swf movies to visibility if the array position is not zero?

Inspiring
May 30, 2008
I may have figured this out on my own. Since there's some parts of this code I still don't quite understand, I'm not sure if this is the best way to do it. I sort of hobbled it together from reading several websites on the subject and added some "for" loops to make it dynamically generated. Here's what's working for me so far (a modification off of my above post):
kglad
Community Expert
Community Expert
April 26, 2008
you're welcome.
kglad
Community Expert
Community Expert
April 26, 2008
us your target's _alpha property or you must wait until loading is complete to assign its _visible property
yogi bearAuthor
Inspiring
April 26, 2008
Works great. Thanks.