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

Button functionality in a movieclip within another movieclip for another movieclip

Guest
Mar 21, 2014 Mar 21, 2014

Ok so i have this looping thumbnails bar that goes like this:
Scene1-imagebar-imagebarinside
The buttons symbols are in the "imagebarinside" movieclip and i am using this code:

ss1.addEventListener(MouseEvent.CLICK, play1);

function play1(event:MouseEvent):void
{
gotoAndStop("ssbox1");
}

...in this movieclip to play another labeled frame in another movieclip (Scene1-Bara)
Problem is it wont work :-< if anyone has a better ideea i'll really apreciate it

TOPICS
ActionScript
757
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 21, 2014 Mar 21, 2014

where is that code?

ie, if it's on a timeline which timeline, imagebarinside?

and Scene1 is not the name of a movieclip, but is the name of the scene that contains bara and imagebar, correct?

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
Guest
Mar 21, 2014 Mar 21, 2014

the code is on the first frame of "imagebarinside"

the frame label i want to target is inside "bara"

and yes correct scene1 is the main scene wich contains "imagebar"-"imagebarinside" and "bara"

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 21, 2014 Mar 21, 2014

use

parent.bara.gotoAndStop("ssbox1");

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
Guest
Mar 22, 2014 Mar 22, 2014

ok i'm using this now:

ss1.addEventListener(MouseEvent.CLICK, play1);

function play1(event:MouseEvent):void

{

parent.bara.gotoAndStop("ssbox1");

}

and getting this:

Symbol 'imagebarinsinde', Layer 'Actions', Frame 1, Line 61119: Access of possibly undefined property bara through a reference with static type flash.display:DisplayObjectContainer.
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 22, 2014 Mar 22, 2014

use:

MovieClip(parent).bara.gotoAndStop('ssbox1');

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 Beginner ,
Mar 24, 2014 Mar 24, 2014
LATEST

Hey!

So, trying to understand the distribution of your MovieClips inside the flash file, this is what I understand:

Scene1 contains a movieclip with the instance name "imagebar" and another movieclip with the instance name "bara".

"imagebar" contains a movieclip with the instance name "imagebarinside". If that is the case (And the code being on the first frame of "imagebarinside"), I would use something like:

function play1(event:MouseEvent):void

{

     Object(this.parent).parent.bara.gotoAndStop("ssbox1");

}

Hope this works!

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