Look up the List.itemRollOver event.

import mx.controls.List;
import mx.utils.Delegate;

var _list:List;

function itemRollOverHandler (o:Object) {
 trace("Application ::: itemRollOverHandler");
 trace("    - index: "+o.index);
 var item:Object = _list.getItemAt(o.index);
 trace("    - label: "+item.label);
};
_list.addEventListener("itemRollOver", Delegate.create(this, 
this.itemRollOverHandler));



Stop using:
- nested functions
- videoList.onMouseMove = function (){}
- r_mc.onRollOver = function (){}

Start using: mx.utils.Delegate;

http://livedocs.adobe.com/flash/mx2004/main_7_2/00002400.html
http://livedocs.adobe.com/flash/mx2004/main_7_2/00002401.html#3647338
http://www.adobe.com/devnet/flash/articles/eventproxy.html
http://www.moock.org/blog/archives/000134.html

regards,
Muzak

----- Original Message ----- 
From: "Ravi Marella" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, May 30, 2007 8:25 AM
Subject: [Flashcoders] handling list box item Rollover in flash8


Hi all,

Is there any way to handle the rollover event on the items present in a
flash 8 list box component? What I want to do basically is show a popup
text depending on the item that is being currently rolled over. I
googled a lot but didn't nothing much useful. I've written the following
code...it works fine if there is no scroll in the box...but once you
scroll, it returns the first element in the scrolled set as the first
element:





function fmouse ()

{

            videoList.onMouseMove = function ()

            {

                        sel = Math.ceil (videoList._ymouse / 21);
//assuming that size of each item in LB is 21

                        w = (roll_mc._x + roll_mc._width);

                        trace (sel);                     //sel is the
current selected iitem

                        if (_xmouse < roll_mc._x || _xmouse > w ||
_ymouse < roll_mc._y || _ymouse > roll_mc._y + roll_mc._height)

                        {

                                    r_mc._visible = true;

                                    delete videoList.onMouseMove;

                        }

            };

}

r_mc.onRollOver = function ()

{

            r_mc._visible = false;

            fmouse ();

};

fmouse ();





cheers,

Ravi li



_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to