# XML photo gallery - disable buttons

**URL:** <https://forum.kirupa.com/t/xml-photo-gallery-disable-buttons/171637>\
**Category:** flash\
**Created:** [December 7, 2005, 12:27am UTC](https://forum.kirupa.com/t/xml-photo-gallery-disable-buttons/171637 "2005-12-07T00:27:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie\_Coder](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Newbie\_Coder](https://forum.kirupa.com/u/Newbie_Coder)\
**Post date:** [December 7, 2005, 12:27am UTC](https://forum.kirupa.com/t/xml-photo-gallery-disable-buttons/171637/1 "2005-12-07T00:27:17Z")

</div>

Okay, trying to do a little add-on, but having trouble.

I want to disable the previous button on the first image and disable the next button on the last image. I’ve been trying stuff like this:

```auto
if (p == 0) {
previous_btn.enabled = false;
}
 
if (p == total) {
next_btn.enabled = false;
}

```

But no worky :(, any help?
