flash q
- Started
- Last post
- 2 Responses
- skelly_b
i created 4 buttons in a for loop. now I want apply a rollover to them. How do I do this?
Here is what I attempting in that same loop with no luck:
this["subBtn"+i].onRollOver = function() {
var col = new Color(this["subBtn"+i].sub.fill... col.setRGB(0x252D39);
}thanks for any help you may be able to provide
- ********0
First download Joey Lotts Proxy class:
http://www.person13.com/download…
from
http://www.person13.com/articles…then use this code:
// Joey Lotts Delegate equivalent
import ascb.util.Proxy;var link:MovieClip = this["subBtn"+i];
link.onRollOver = Proxy.create(this, linkOver, link);function linkOver(mc:MovieClip):Void
{
var trgtClip:MovieClip = mc.sub.fill
var col: Color = new Color(trgtClip);
col.setRGB(0x252D39);
}
//
This is AS2 code, easy to change to AS1Hope this helps
- caseyc0
No need for proxy classes and the like, you just have your scope wrong...
this["subBtn"+ i].sub.fill
should be
this.sub.fill