# Yet another rollOver/rollOut problem

**URL:** <https://forum.kirupa.com/t/yet-another-rollover-rollout-problem/274325>\
**Category:** flash\
**Created:** [October 28, 2008, 2:40pm UTC](https://forum.kirupa.com/t/yet-another-rollover-rollout-problem/274325 "2008-10-28T14:40:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktmdms](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@ktmdms](https://forum.kirupa.com/u/ktmdms)\
**Post date:** [October 28, 2008, 2:40pm UTC](https://forum.kirupa.com/t/yet-another-rollover-rollout-problem/274325/1 "2008-10-28T14:40:18Z")

</div>

I’ve attached my test fla which is a compilation of code from a couple of different tutorials/examples (one of which from [kirupa.com](http://kirupa.com), thanks for that). It reads an xml file that looks like this:

\<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?\>  
\<images\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/kresge.jpg](http://www.kirupa.com/developer/mx2004/pg/kresge.jpg)\</image\>  
\<caption\>Kresge\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/medialab.jpg](http://www.kirupa.com/developer/mx2004/pg/medialab.jpg)\</image\>  
\<caption\>Media Lab\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/stata.jpg](http://www.kirupa.com/developer/mx2004/pg/stata.jpg)\</image\>  
\<caption\>Stata Center\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/stata\_lobby.jpg](http://www.kirupa.com/developer/mx2004/pg/stata_lobby.jpg)\</image\>  
\<caption\>Stata Lobby\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/construction.jpg](http://www.kirupa.com/developer/mx2004/pg/construction.jpg)\</image\>  
\<caption\>Construction\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/dome.jpg](http://www.kirupa.com/developer/mx2004/pg/dome.jpg)\</image\>  
\<caption\>The Dome\</caption\>  
\</pic\>  
\<pic\>  
\<image\>[http://www.kirupa.com/developer/mx2004/pg/structure.jpg](http://www.kirupa.com/developer/mx2004/pg/structure.jpg)\</image\>  
\<caption\>Structure\</caption\>  
\</pic\>  
\</images\>

So it displays the images in a slide show, changing to the next picture every 5 seconds or so. It has a previous and next button and the timer resets every time you go forward or backward a slide. What I _can’t_ get to work is the rollOver/rollOut effect. I’ve coded it this way:

this.onRollOver = function()  
{  
this.onEnterFrame = function()  
{  
this.\_x -= this.\_width/2;  
this.\_y -= this.\_height/2;  
this.\_xscale = 200;  
this.\_yscale = 200;  
}  
};  
this.onRollOut = function()  
{  
this.onEnterFrame = function()  
{  
this.\_xscale = 100;  
this.\_yscale = 100;  
this.\_x += this.\_width/2;  
this.\_y += this.\_height/2;  
}  
};

and this way:

this.onRollOver = function()  
{  
this.\_x -= this.\_width/2;  
this.\_y -= this.\_height/2;  
this.\_xscale = 200;  
this.\_yscale = 200;

};  
this.onRollOut = function()  
{  
this.\_xscale = 100;  
this.\_yscale = 100;  
this.\_x += this.\_width/2;  
this.\_y += this.\_height/2;

};

but nothing happens at all. I’m guessing I’m missing something obvious here but this is my first attempt at Flash and I just can’t see it (and I’ve read thru about 100 different posts in here and gone thru I don’t know how many “tutorials” and just can’t seem to “get it”). Any help is greatly appreciated.

Thanks.

Kevin
