Skip to main content
Known Participant
May 3, 2015
Question

AS3 Problem..

  • May 3, 2015
  • 3 replies
  • 926 views

Hi,

I use to work at AS2.. so im New with CC and Flash AS3..

Im a designer.

I have 2 MovieClips, And one Button.

The button is inside one of the 2 MovieClips, and has to control also the other MC.

This is the Actionscript:

The Top AC work well and simple.. button that control the time line inside a MC.

Study_Butt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void

{

  gotoAndStop(2);

}

The other AC: (In the same Keyframe & AC window - at the bottom).

I dont Understand were do i enter the "Adress" of the other MC..

This "Adress": Object(this.parent.parent).topMenu.Map_m

Study_Butt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_1);

function fl_ClickToGoToAndStopAtFrame_1(event:MouseEvent):void

{

  gotoAndStop(1);

}

I hope you can answere me soon.... And Hope its anderstood..

My English is not so good.. (:

thanks!!

This topic has been closed for replies.

3 replies

Known Participant
May 3, 2015

I cant believe - it worked!!!! Thanks alot!!! U save my life..

Ned Murphy
Legend
May 3, 2015

What you should probably do to make it easier to manage is to place the code in the main timeline instead of inside the movieclip.  The following code is not going to work because I do not know how you have things arranged, but it should give you some idea.

topMCName.Study_Butt.addEventListener(MouseEvent.CLICK, clickStudyBtn);

function clickStudyBtn(event:MouseEvent):void

{

  topMCName.gotoAndStop(2);

  topMenu.Map_m.gotoAndStop(1);

}

Known Participant
May 3, 2015

Thanks! I will try it..

Joseph Labrecque
Community Expert
Community Expert
May 3, 2015

Hi. Can you post an example .fla? Want to tell you the right thing and need to see exactly how it is structured.

Known Participant
May 3, 2015

Hi,

How can I Send an example? i cannot find the option to attach fla file..

Thanks

Adi

Joseph Labrecque
Community Expert
Community Expert
May 3, 2015

You'd have to pop it up on DropBox or some other service and post the link.

Definitely have a look at Ned's suggestions though.