In this site, Mouse is set to hide = true, and replaced with an arrow that
change it's orientation from left to right and viceversa...
Most commonly this is set adding also an updateAfterEvent method.. This one,
should give you more performance as in will get less cpu activity, but not
sure, just try

Good Luck


On 3/22/07, Perdue, Blake <[EMAIL PROTECTED]> wrote:

I am building a photo slideshow and I want to add a next/back button to
the mouse cursor. If the mouse is on the right half of the screen, it
displays a right arrow (indicating that onclick, it will load the next
photo). When on the left half, it displays a left arrow (onclick loads
the previous photo).

My question is this: is there a better way to do this than using
onMouseMove and onMouseDown event handlers? My code is below. Adding
these event handlers is making my SWF eat up 20% more of the CPU
resources. Is there a less processor intensive method of achieving this?
A Group94 site seems to do a good job of this without hogging CPU
cycles: http://www.schierke.com/home.php?p=


// w=screenWidth

onMouseMove=function() {
       arrowL._x=_xmouse-14;
       arrowL._y=_ymouse+4;
       arrowR._x=_xmouse+14;
       arrowR._y=_ymouse+4;
       if (_xmouse<w/2) {arrowL._visible=true; arrowR._visible=false;}
       else {arrowR._visible=true; arrowL._visible=false;}
}


onMouseDown=function() {
       if (_xmouse<w/2) {loadImage(current-1);}
       else { loadImage(current+1);}
}
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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




--
Omar Fouad - Digital Emotions...

Love is always patient and kind. It is never jealous. Love is never boastful
nor conceited It is never rude or selfish. It does not take offense and is
not resentful. Love takes no pleasure in other people's sins...but delights
in the truth. It is always ready to excuse, to trust, to hope... and to
endure... whatever comes.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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