# Conditional for paging

**URL:** <https://forum.kirupa.com/t/conditional-for-paging/307035>\
**Category:** flash\
**Created:** [March 26, 2010, 2:09pm UTC](https://forum.kirupa.com/t/conditional-for-paging/307035 "2010-03-26T14:09:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitree](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dimitree/32/2530_2.png) [@Dimitree](https://forum.kirupa.com/u/Dimitree)\
**Post date:** [March 26, 2010, 2:09pm UTC](https://forum.kirupa.com/t/conditional-for-paging/307035/1 "2010-03-26T14:09:46Z")

</div>

I just need a condition for paging in an XML gallery where i get a server response.  
Whenever there is a new records to load, server gives me the xml tag **np** (stands for next page) and then a next arrow appears on stage to load the new records when clicked.

The thing is I need a condition that will secure my paging when the records are over and there will be only **pp** in my XML file - where **pp** stands for previous page. I mean I don’t want when the user goes to last page the **next arrow** to be active or present on stage…

So far my code

```php

if ("np" in myXML)
	{
		addChild(_Rarrow);
		_Rarrow.buttonMode = true;
		_Rarrow.x = gal_back.width + 40;
		_Rarrow.y = gal_back.height / 2;
		_Rarrow.addEventListener(MouseEvent.CLICK, navigateToRight);		
	   }	
if ("pp" in myXML)
	{
		addChild(_Larrow);
		_Larrow.buttonMode = true;
		_Larrow.rotation = 180;
		_Larrow.x = thumbsHolder.x - 30;
		_Larrow.y = gal_back.height / 2;
		_Larrow.addEventListener(MouseEvent.CLICK, navigateToLeft);
}

```

– Actually i need sthg like

```php
If ("pp" doesn't exist in my XML) 
{
 remove right arrow from stage

}

```
