Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

target a movieclip from inside another movieclip

Contributor ,
Mar 03, 2016 Mar 03, 2016

target a movieclip from inside another movieclip

i want gotoandplay symbol timeline from main time line

Clicking 1 , i want to goto inside 5 . not 5  timeline . it is main timeline . but i want to go symbol timeline of 5

So the code i am using is :

stop();

movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

function fl_ClickToGoToScene(event:MouseEvent):void

{

  MovieClip(circle).gotoAndPlay(1);

}

instace.jpg

 

here i wan to go

ok.jpg


TOPICS
ActionScript
3.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 03, 2016 Mar 03, 2016

if inside5 is the object on the same timeline as movieClip_1 and you want to target circle is a child of inside5, use:

inside5.circle.gotoAndPlay(1);

Translate
Community Expert ,
Mar 03, 2016 Mar 03, 2016

if inside5 is the object on the same timeline as movieClip_1 and you want to target circle is a child of inside5, use:

inside5.circle.gotoAndPlay(1);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 03, 2016 Mar 03, 2016
Scene 1, Layer 'Actions', Frame 1, Line 71120: Access of undefined property inside5.

yes. here is the way i made inside5 symbol timeline from circle . inside5 symbol is inside the circle . i want to go inside5 symbol timeline clicking 1 rect

way.jpg

stop();

movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

function fl_ClickToGoToScene(event:MouseEvent):void

{

inside5.circle.gotoAndPlay(1);

}

it shows error : acess of undefined property inside5

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2016 Mar 04, 2016

inside5 and circle must be instance names (in the properites panel).

in addition, they must both exist when the code executes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 04, 2016 Mar 04, 2016

certainly this code is working fine but reverse shows error


btn1.addEventListener(MouseEvent.CLICK, btn1Down);

function btn1Down(event:MouseEvent):void {

MovieClip(parent).salma.text = "You pressed button 1";

}

// means textfield salma is instace name situated in parent timeline. here your btn1 situated in child timeline .

//My question is what is the reverse of it ?

btn1 will be situated in parent timeline and textfield salma is situated child

apply this code you will get error . but anyway to fix the issue ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 04, 2016 Mar 04, 2016

check your duplicate message.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 07, 2016 Mar 07, 2016
LATEST

we access child using dot operator . here is the source .fla for begineers

access child | Graphicscoder

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines