I added a note-formed description of what I need to happen. See post #5.
SOS ^^;
This is kind of a brainteaser- I don’t even know if it’s possible to make it in flash (but that usually doesn’t mean much- since I don’t know that much :D):
Here’s the deal:
I am using a function to dynamically create instances (duplicateMovieClip) of MCs to pose as “icons”, kind of. The original MC that is copied has the following AS in it (which works):
on (rollOver) {
_root.switch_io = 1;
_root.caption._width = 35;
_root.caption.variable_txt = "Text";
}
on (rollOut) {
_root.switch_io = 0;
_root.caption.variable_txt = " ";
}
Now comes the problem. Every MC copy / instance should display a different text on RollOver. See the code in line 4 where it says >> _root.caption.variable_txt = “Text”; <<… that “Text” should be different for each MC.
I was thinking that maybe while copying the MCs to also create & set distinct root-variables for each of them… then assign an “onRollOver” to the MC copy (also while creating it) that takes that value from the distinct root-variable and pushes it into a static root-variable… and that static root variable is then read and displayed by the actual “on (rollOver)” of the original MC.
This is the function I assign to the MC instance, just for testing:
var smc = eval("_root.distinct_MCname");
var smct = eval("_root.distinct_MCname_txt");
smct = "Some Random Text";
smc.onRollOver = function() {
_root.subtxt = smct;
};
I then added the line
trace(_root.subtxt);
to the “on (rollOver)” of the main MC (the one that is copied) for testing.
But even though I give each MC (“smc” and it’s root-variable, “smct”) a different name, the value that is returned is always the last value that was processed by the function.
Any ideas why that is or what I am doing wrong? Am I thinking too complicated? or not complicated enough?
I also tried directly putting the “caption.words = smct;” into the onRollOver I assign during duplication of the clip (second code example) but that always sets the same (last) value, too.
dies :wasted: