views:

27

answers:

1

I have two frames with as3 code:

// frame1:
gotoAndPlay("show controls");

// frame2 - have movieclip with name slide0
// create menu items click listeners
for (var i:int = 0; i < slides.items.length; i++) // slides.items.length = 1
    this["menu_item"+i].addEventListener(MouseEvent.CLICK, menu_item_click);

// click on the first menu item
this["menu_item0"].dispatchEvent(new MouseEvent(MouseEvent.CLICK));

// menu item click handler
function menu_item_click(e:MouseEvent):void {
    this["slide0"].gotoAndPlay("show");
}

// in movieclip slide0 on frame with label "show"
trace("slide0 show begin");

And I get 2 messages "slide0 show begin". But when I click on menu_item0 I have one message.

Please help - where is a mistake?

A: 

Hmm, I move dispatchEvent to frame3 and it's working fine.

// frame3
this["menu_item0"].dispatchEvent(new MouseEvent(MouseEvent.CLICK));

But the reason for such behavior is not clear...

im4LF
Yes, if you join a flex framework forum such as Parsley or Mate then this problem is the most W*F. Seems like it is comes without a reason. :)
ktutnik