Description:
I have some instances of a mc, with inside a button; the button have the
code below:
on (rollOver) {
_root.blinker.myclip = this.arrow;
_root.blinker.gotoAndPlay(2);
_root.name = this._name; // NOTICE THIS
}
on (rollOut) {
_root.blinker.gotoAndStop(1);
my_color = new Color(this.arrow);
my_color.setRGB(0xFFFFFF);
}
on (release) {
if (_root.name == "blu1") { // NOTICE THIS
my_color = new Color(_root.backpop.ptit.backtit);
my_color.setRGB(0x0066FF);
my_color = new Color(_root.blu1.backpops);
my_color.setRGB(0x000066);
_root.numero2 = _root.numero+1;
var goto = _root.numero2;
} else if (_root.name == "red1") {
my_color = new Color(_root.backpop.ptit.backtit);
my_color.setRGB(0x00CCFF);
my_color = new Color(_root.red1.backpops);
my_color.setRGB(0x016FA9);
_root.numero2 = _root.numero+2;
var goto = _root.numero2;
} else if (_root.name == "yellow1") {
my_color = new Color(_root.backpop.ptit.backtit);
my_color.setRGB(0x00CC33);
my_color = new Color(_root.yellow1.backpops);
my_color.setRGB(0x028301);
_root.numero2 = _root.numero+3;
var goto = _root.numero2;
} else if (_root.name == "blu2") {
my_color = new Color(_root.backpop.ptit.backtit);
my_color.setRGB(0xFFCC00);
my_color = new Color(_root.blu2.backpops);
my_color.setRGB(0x838201);
_root.numero2 = _root.numero+4;
var goto = _root.numero2;
} else if (_root.name == "red2") {
my_color = new Color(_root.backpop.ptit.backtit);
my_color.setRGB(0xFF0000);
my_color = new Color(_root.red2.backpops);
my_color.setRGB(0x990000);
_root.numero2 = _root.numero+5;
var goto = _root.numero2;
}
_root.push(goto);
}
on the stage, there is a dynamic textfield, called 'name'.
When the cursor go over the button, the textfield display the instance name
of mc; this work fine.
But when the button is clicked, the action have a strange behavior. As you
can see in the code above, the first two actions that start onRelease are
two color change of mc. Well, the strange is that, any mc I try to click
first, just the second color change work (target: another mc inside the
clicked mc), while the first not. When I click on another mc, ALL work fine.
I.e., if the instance of mc on stage are:
blu1
red1
yellow1
blu2
red2
If I click, i.e., on 'red1', the action target to mc
_root.backpop.ptit.backtit don't work; but if click again, now on 'yellow1'
i.e., both the change color action work!
What about?
Enrico Tomaselli
+> web designer <+
[EMAIL PROTECTED]
http://www.metatad.it
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders