Hi, I have a problem.
I'm generating a menu dynamically in a custom made scroolbar with a mask.
A movie clip holds my mc effect that is supposed to happen on roll over, a text field and a button. I’m creating instances of that movie clip with action script dynamically inside two other movie clips (two depths). I have a problem with the onRollOver method of the button that is inside.
I’m assigning like this:
for(var i=0; i < num; i++){
this.scroll_content.item_holder.attachMovie("meni", i+"_meni_mc", i, {_x:0, _y:(24*i) });
this.scroll_content.item_holder[i+"_meni_mc"].Tekst_txt.text = "SomeName";
}
- for(var i=0; i < num; i++){
- this.scroll_content.item_holder.attachMovie("meni", i+"_meni_mc", i, {_x:0, _y:(24*i) });
- this.scroll_content.item_holder[i+"_meni_mc"].Tekst_txt.text = "SomeName";
- }
_root._level0.scroll_content.item_holder.0_meni_mc.button_btn.onRollOver = function () {
_root._level0.scroll_content.item_holder.0_meni_mc.efekt_mc.gotoAndPlay("k1");
};
- _root._level0.scroll_content.item_holder.0_meni_mc.button_btn.onRollOver = function () {
- _root._level0.scroll_content.item_holder.0_meni_mc.efekt_mc.gotoAndPlay("k1");
- };
I get an error like this when testing:
**Error** Scene=Scene 1, layer=Script, frame=1:Line 7: Syntax error.
_root._level0.scroll_content.item_holder.0_meni_mc.button_btn.onRollOver = function () {
The path is true.
I think maybe I need to change the name of the button instance...
But how do I do that dynamically with AS?
The parent movie clips don’t have rollover methods assigned to them.
does anyone know a solution?