# Custom Cursor change on different areas

**URL:** <https://forum.kirupa.com/t/custom-cursor-change-on-different-areas/140796>\
**Category:** Uncategorized\
**Created:** [March 14, 2005, 3:35pm UTC](https://forum.kirupa.com/t/custom-cursor-change-on-different-areas/140796 "2005-03-14T15:35:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pat1](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@Pat1](https://forum.kirupa.com/u/Pat1)\
**Post date:** [March 14, 2005, 3:35pm UTC](https://forum.kirupa.com/t/custom-cursor-change-on-different-areas/140796/1 "2005-03-14T15:35:05Z")

</div>

Okay,

So, i have this Photogallery (downloaded from kirupa). When i move the mouse over different areas i want it to change the mouse cursor to my own back and forward buttons instead of the mousepointer.

This is what i got now… The gallery works perfekt but my custom mouse dont work.

**ActionScript for gallery functions** :

if (\_root.loadActive = false)  
{  
}  
else  
{  
\_root.loadActive = true;  
}

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
/////////////////////////////////////  
listen = new Object();  
listen.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
prevImage();  
} else if (Key.getCode() == Key.RIGHT) {  
nextImage();  
}  
};  
Key.addListener(listen);  
areaA.onRelease = function() {  
prevImage();  
};  
areaB.onRelease = function() {  
nextImage();  
};  
/////////////////////////////////////  
p = 0;  
this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};  
function nextImage() {  
if (p\<(total-1)) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}  
}  
}  
function prevImage() {  
if (p\>0) {  
p–;  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
}  
}  
function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
desc\_txt.text = description[0];  
picture\_num();  
}  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}

**And the actionscript for the different Areas where the mouse is suppose to change:**

onClipEvent (mouseMove)  
{

```
if (_root.loadActive == true)
{
    if (_parent._xmouse &lt;= _parent.areaB._x + _parent.areaB._width && _parent._xmouse &gt;= _parent.areaB._x && _parent._ymouse &lt;= _parent.areaB._y + _parent.areaB._height && _parent._ymouse &gt;= _parent.areaB._y)
    {
        Mouse.hide();
        _parent.hand._visible = 1;
        _parent.hand._x = _parent._xmouse;
        _parent.hand._y = _parent._ymouse;
        _parent.hand2._visible = 0;
    }
    else if (_parent._xmouse &lt;= _parent.areaA._x + _parent.areaA._width && _parent._xmouse &gt;= _parent.areaA._x && _parent._ymouse &lt;= _parent.areaA._y + _parent.areaA._height && _parent._ymouse &gt;= _parent.areaA._y)
    {
        Mouse.hide();
        _parent.hand2._visible = 1;
        _parent.hand2._x = _parent._xmouse;
        _parent.hand2._y = _parent._ymouse;
        _parent.hand._visible = 0;
    }
    else
    {
        Mouse.show();
        _parent.hand._visible = 0;
        _parent.hand2._visible = 0;
    } 
}
else
{
    Mouse.show();
    _parent.hand._visible = 0;
    _parent.hand2._visible = 0;
} 

```

}

onClipEvent (load)  
{  
\_parent.hand.\_visible = 0;  
\_parent.hand2.\_visible = 0;  
}

Whats wrong here?
