I’m a complete flash noob trying to do something extremely basic and I can’t for the life of me figure out how to do it. Code has always been greek to me and any time I have tried to do it in any language, it always ends with disastrous results.
So, and now for your easiest Flash question of the day:
I am trying to make a simple gallery of images. I want to have a small rollover popup appear with some text and another image embedded. So I figure easy enough, I’ll make the image a button and simply add the popup as a keyframe on the over field for the button. And it works. Problem is the popup is cutoff by the other buttons on the gallery. You see the corner of the popup on the corresponding button image but it is hidden by the other buttons. All I want is for the popup to overlay on top of the other buttons. Seems simple but I can’t get it to work for the life of me.
I can’t supply the FLA but ask any questions that would help resolve the matter. If I can avoid adding an Action to this, I’d like to. Thanks for the help.
Basically you’re running into issues with the “depth” of your images. You’re going to need to add some ActionScript to remedy the issue (it won’t be too complex though, don’t worry). If you want to avoid that, you can position the popup so that it doesn’t interfere with the other images (ie goes over its own image but doesn’t expand past to go under the others). Are you using AS 2 or 3? Probably 2… just check your Publish Settings.
All the images are titled due to space constraints, sadly. I’m using AS 2.0 now as all the how-tos I’ve found have been in that format and the only AS I’ve done for links has been in AS 2.0. I hope it’s simple! Any time I’ve gotten anywhere near scripting, it’s ended badly! Thanks again.
// store all of your buttons in an array
var buttons:Array = [ button1, button2, button3, button4 ];
// save the top most button in a variable so we can swap our depths
var topmost:MovieClip = button4;
// iterate through all of the buttons
for (var i:Number = 0; i < buttons.length; i++) {
// this function gets called whenever one of your buttons is rolled over
buttons*.onRollOver = function() {
// put the rolled over movieclip on top of the top most movieclip
this.swapDepths( topmost );
// change the topmost variable to be the currently rolled over movieclip
topmost = this;
}
}
Whatever you name your buttons, you need to put those names into the array, and then have the top most variable set to the one you have on top. You can force this by selecting any one of your buttons and then going to Modify > Arrange > Bring to Front if they’re all on the same layer.
Ok, I implemented that code but it isn’t working. I brought the first image (b1) to the front and added, to be simple, 4 buttons to the array (b1, b2, b3, b4). I think the problem may lie in that you say buttons in the array definition and then movieclip for the topmost definition. Should b1 be converted to a movieclip instead of a button?
Told you I was illiterate when it came to code.
It’s funny, but I understand everything you’re telling AS to do… just don’t know why it’s not doing it.
EDIT: Here’s what I pasted in:
// store all of your buttons in an array
var buttons:Array = [ b1, b2, b3, b4 ];
// save the top most button in a variable so we can swap our depths
var topmost:MovieClip = b1;
// iterate through all of the buttons
for (var i:Number = 0; i < buttons.length; i++) {
// this function gets called whenever one of your buttons is rolled over
buttons*.onRollOver = function() {
// put the rolled over movieclip on top of the top most movieclip
this.swapDepths( topmost );
// change the topmost variable to be the currently rolled over movieclip
topmost = this;
}
}
The problem got more complicated. I applied the button rollover to all 24 images that are tiled and now the rollover is wigging out. They are 100x100 images in a 8 by 3 configuration. When I mouseover the image in position 2 (that being the image second from the left on the first row), the popup for the image in position 9 appears (that being the 1st image in row 2) and it flickers. All the images in the middle row flicker as well and do not stay up on mouseover. The middle row interferes with the top row so they don’t work properly and it looks like the bottom row interferes with the middle row. It seems the the bottom is fine as the popups from the other rows do not touch the images themselves. The flickering is caused by moving the mouse - the popups appears and immediately disappeared and then reappear the second the mouse is moved, so one smooth motion of the mouse causes a flicker effect. Anything on the perimeter of the block of tiled images except for images #2-7 works fine (except for the existing topmost issue I originally asked for help with).
I’m just about ready to go with a javascript option and pray I can figure it out.
Sounds very weird portnoyd (apologies for not returning to this thread sooner). Maybe you could pop up the FLA so we could take a peek at what’s going wrong?
My friends and I are working on something and they’d have my head if I posted it anywhere. 
I think I have the root of the new problem. The mouseover popup (just a rectangle and text for now) is thinking its part of the button and it’s showing itself when you mouseover where it will popup which conflicts with all the other buttons and mouseovers doing the same thing at once. The popup rectangle is becoming part of the area for the button so when you mouseover where it will be, it pops itself up. Does that make sense? This is probably what’s not making your code work. I have the popups as a keyframe in the Over field for the buttons.