# Action scripts

**URL:** <https://forum.kirupa.com/t/action-scripts/331282>\
**Category:** Uncategorized\
**Created:** [June 28, 2013, 7:07am UTC](https://forum.kirupa.com/t/action-scripts/331282 "2013-06-28T07:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![si\_imran](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@si\_imran](https://forum.kirupa.com/u/si_imran)\
**Post date:** [June 28, 2013, 7:07am UTC](https://forum.kirupa.com/t/action-scripts/331282/1 "2013-06-28T07:07:12Z")

</div>

\*\*i want to call 6 new thumbs in my xml gallery and remove previous 6 thumbs by mouse on(press) event…  
what should i do for this… \*\*  
[CENTER]my script is …   
[/CENTER]  
import mx.transitions.Tween;  
import mx.transitions.Zoom._;  
import caurina.transitions._;  
var myGalleryXML = new XML();  
myGalleryXML.ignoreWhite = true;

myGalleryXML.load(“26-demo.xml”);  
myGalleryXML.onLoad = function()  
{  
\_root.gallery\_x = myGalleryXML.firstChild.attributes.gallery\_x = 100;  
\_root.gallery\_y = myGalleryXML.firstChild.attributes.gallery\_y;  
\_root.gallery\_width = myGalleryXML.firstChild.attributes.gallery\_width;  
\_root.gallery\_height = myGalleryXML.firstChild.attributes.gallery\_height;  
\_root.myImages = myGalleryXML.firstChild.childNodes;  
\_root.myImagesTotal = myImages.length;  
\_root.thumb\_height = myGalleryXML.firstChild.attributes.thumb\_height;  
\_root.thumb\_width = myGalleryXML.firstChild.attributes.thumb\_width;

```
_root.full_x = myGalleryXML.firstChild.attributes.full_x;
_root.full_y = myGalleryXML.firstChild.attributes.full_y;

callThumbs();

```

};

function callThumbs()  
{  
\_root.createEmptyMovieClip(“wall”,\_root.getNextHighestDepth());  
wall.\_x = \_root.gallery\_x = 0;  
wall.\_y = \_root.gallery\_y = 230;  
wall.addEventListener(MouseEvent.CLICK);

```
var clipLoader = new MovieClipLoader();
var preloader = new Object();
clipLoader.addListener(preloader);

```

\*\* for (i = 0; i \< 6; i++)\*\* _// want to change here_  
{  
thumbURL = myImages\*.attributes.thumb\_url;  
myThumb\_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());  
myThumb\_mc.\_x = \_root.thumb\_height \* i;  
myThumb\_mc.\_x = \_root.thumb\_position = -3260 + i \* 765;

```
    clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);

                             **[U]my Next button script is....[/U]**

```

on(press){  
var s;  
if(s==null)  
s=0;  
else  
s+=6;  
}[CENTER] **my Next button script is…** [/CENTER]  
on(press){  
var e;  
if(e==null)  
e=\_root.s;  
else  
e-=6;  
}
