# HELP! SWF not showing properly!

**URL:** <https://forum.kirupa.com/t/help-swf-not-showing-properly/57394>\
**Category:** flash\
**Created:** [July 12, 2004, 10:21pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394 "2004-07-12T22:21:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otsego](https://avatars.discourse-cdn.com/v4/letter/o/977dab/32.png) [@Otsego](https://forum.kirupa.com/u/Otsego)\
**Post date:** [July 12, 2004, 10:21pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/1 "2004-07-12T22:21:49Z")

</div>

I created a slide show from the tutorial on the site. Although, my buttons are on a different (above) layer from the pictures. When i publish the fla file, it looks perfect. Now im using this swf file as a page in my main site, but it omits my buttons! its the exact size it needs to be to fit in the site, and i see the spot where the buttons should be, but its not rendering!  
see for yourself:

[www.saggezzamarketing.com/okamura/flash/](http://www.saggezzamarketing.com/okamura/flash/)

-go to smile gallery  
-it shows the first pic  
now go to same site except to view the swf file, its smilegallery.swf  
so …/flash/smilegallery.swf  
works fine (though bigger than it should be)  
ideas suggestions?  
ive tried the following:  
making the movie container the exact size of the .jpgs  
making the movie container no size  
putting all the other layers above the movie container layer

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 10:29pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/2 "2004-07-12T22:29:25Z")

</div>

It’s because it’s an .swf exactly. Nothing is controlling how big it is ;).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 10:57pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/3 "2004-07-12T22:57:34Z")

</div>

but i defined the movie size to fit in the given area. its the same size as the other pages on the site… they work fine.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:00pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/4 "2004-07-12T23:00:26Z")

</div>

Oh I see - the next/prev buttons are missing.

Are you sure you have the movieclip to the left top registration and the exact size? Are you sure that the buttons aren’t being covered up by some white rectangle?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:11pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/5 "2004-07-12T23:11:01Z")

</div>

yes. i even tried moving the buttons to the middle to see if they would even show up. no go. so its something quirky with the buttons… also, the bg should be black. i made the image to size in photoshop.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:13pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/6 "2004-07-12T23:13:44Z")

</div>

Try making the buttons again inside the main movie.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:14pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/7 "2004-07-12T23:14:14Z")

</div>

also as i stated, the buttons are on a layer ABOVE the picture.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:20pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/8 "2004-07-12T23:20:46Z")

</div>

tried replacing the buttons… that didnt work either.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 12, 2004, 11:47pm UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/9 "2004-07-12T23:47:38Z")

</div>

[http://www.kirupa.com/developer/mx/photogallery.htm](http://www.kirupa.com/developer/mx/photogallery.htm)

must have something to do with the code… im not versed enough to know if this is the problem, but it must have something to do with my using this swf within another swf.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 12:13am UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/10 "2004-07-13T00:13:49Z")

</div>

here is the code i think needs to be edited to be used within another SWF:

//Code written by sbeener (suprabeener)  
/\*  
i wrote this code, but you can use and abuse it however you like.  
the methods are defined in the order which they occur to make it  
easier to understand.  
\*/  
// variables ------------------------------------------  
// put the path to your pics here, include the slashes (ie. “pics/”)  
// leave it blank if they’re in the same directory  
this.pathToPics = “animation/”;  
// fill this array with your pics  
this.pArray = [“image0.jpg”, “image1.jpg”, “image2.jpg”, “image3.jpg”, “image4.jpg”, “image5.jpg”, “image6.jpg”, “image7.jpg”, “image8.jpg”, “image9.jpg”];  
this.fadeSpeed = 20;  
this.pIndex = 0;  
// MovieClip methods ----------------------------------  
// d=direction; should 1 or -1 but can be any number  
//loads an image automatically when you run animation  
loadMovie(this.pathToPics+this.pArray[0], \_root.photo);  
MovieClip.prototype.changePhoto = function(d) {  
// make sure pIndex falls within pArray.length  
this.pIndex = (this.pIndex+d)%this.pArray.length;  
if (this.pIndex\<0) {  
this.pIndex += this.pArray.length;  
}  
this.onEnterFrame = fadeOut;  
};  
MovieClip.prototype.fadeOut = function() {  
if (this.photo.\_alpha\>this.fadeSpeed) {  
this.photo.\_alpha -= this.fadeSpeed;  
} else {  
this.loadPhoto();  
}  
};  
MovieClip.prototype.loadPhoto = function() {  
// specify the movieclip to load images into  
var p = \_root.photo;  
//------------------------------------------  
p.\_alpha = 0;  
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);  
this.onEnterFrame = loadMeter;  
};  
MovieClip.prototype.loadMeter = function() {  
var i, l, t;  
l = this.photo.getBytesLoaded();  
t = this.photo.getBytesTotal();  
if (t\>0 && t == l) {  
this.onEnterFrame = fadeIn;  
} else {  
trace(l/t);  
}  
};  
MovieClip.prototype.fadeIn = function() {  
if (this.photo.\_alpha\<100-this.fadeSpeed) {  
this.photo.\_alpha += this.fadeSpeed;  
} else {  
this.photo.\_alpha = 100;  
this.onEnterFrame = null;  
}  
};  
// Actions -----------------------------------------  
// these aren’t necessary, just an example implementation  
this.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
this.changePhoto(-1);  
} else if (Key.getCode() == Key.RIGHT) {  
this.changePhoto(1);  
}  
};  
Key.addListener(this);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 13, 2004, 1:19am UTC](https://forum.kirupa.com/t/help-swf-not-showing-properly/57394/11 "2004-07-13T01:19:39Z")

</div>

I think i found your problem, young padawan. Through much strife and scrutinization, and sheer programer genius, I might add. The code in which you submitted (from this site) was not meant to be used within another .swf file. Thus you have to go through and change the references to the MC “photo” from referencing the \_root. to the specific movie you are currently in… ie THIS movie. so the proper syntax to reference the MC would be

this.photo

using root will take you back to the parent SWF, thus replacing your movie with just the photo.

Thank you for your submission, and i hope to answer more of your questions about flash in the future. Welcome to Kirupa, Otsego.
