Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting buttons in a ScrollPane

Status
Not open for further replies.

zieben73

Technical User
Jun 30, 2007
7
I have a slight problem: I am trying to put a series of buttons (alot of them) into a scrollpane, but when I put them in, they not only don't act as buttons (with the up, over, and down frames), but they also don't follow their ActionScript (which is, by the way, to load a picture into an empty movie clip).

Is this not supposed to be done, or is there just a small option that makes the buttons work?

Thanks in advance...
 
Well, I'm using Flash 8, and in the left side of the actions window, it says "ActionScript 1.0 & 2.0".
 
wait, I'm definitely using ActionScript 2.0
 
yeah sure:

but theres actually a new problem: the buttons work as buttons, and change color when I hover over them, but I don't know where to put the code that makes the buttons load the external images. Now that you have the .fla, I guess you'll be able to find the thing I'm doing wrong.

Thanks
 
thumb1.onRelease = function() {
infoField._visible = true;
startLoading("pic1.jpg");
};
thumb2.onRelease = function() {
infoField._visible = true;
startLoading("pic2.jpg");
};
thumb3.onRelease = function() {
infoField._visible = true;
startLoading("pic3.jpg");
};
thumb4.onRelease = function() {
infoField._visible = true;
startLoading("pic4.jpg");
};
thumb5.onRelease = function() {
infoField._visible = true;
startLoading("pic5.jpg");
};
thumb6.onRelease = function() {
infoField._visible = true;
startLoading("pic6.jpg");
};
thumb7.onRelease = function() {
infoField._visible = true;
startLoading("pic7.jpg");
};
thumb8.onRelease = function() {
infoField._visible = true;
startLoading("pic8.jpg");
};
thumb9.onRelease = function() {
infoField._visible = true;
startLoading("pic9.jpg");
};
thumb10.onRelease = function() {
infoField._visible = true;
startLoading("pic10.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "viewer");
_root.onEnterFrame = function() {
infoLoaded = viewer.getBytesLoaded();
infoTotal = viewer.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}




I'm pretty sure the code works fine, because when i take one of the buttons out of the scrollPane and put it on the regular part (like where the image viewer is) that button works.

thanks
 
wow, i suck at this; when I do that, none of the scroll content in the scrollstuff mc appears in the scrollPane.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top