[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

Checkbox and gotoAndPlay()

I'm not feeling all that smart this morning...I thought I could do something really simple with a checkbox.

I dragged a checkbox component out to the stage and when it is checked I want to go to another frame in the same movieclip.

So my actionscript looks like this


on (click) {
    this.gotoAndPlay("default expand");
}

that does't seem to do anything.  If I replace it with trace(this);  and then click the box I do get a trace window.  Can the default checkbox event (click) execute goto commands or do I have to build an event listener?

Dan
0
dankazup
Asked:
dankazup
  • 2
1 Solution
 
DrakkonCommented:
this.gotoAndPlay("default expand");

"this" in your case would mean the checkbox and its trying to play the "default expand" frame of the checkbox. I think what you are wanting is:
_root.myMovieClip.gotoAndPlay("default expand");

or_root being level or whatever the path to the movieclip your "expanding" is
0
 
dankazupAuthor Commented:
I must not be understanding the timeline layers...I should add some more information


On my main timeline I have 5 frames with an instance of the scrollpane component named "scrollimage".

The scrollpane component content path is set to the movie clip ScrollImage7

Now the movie clip Scrollimage7 has three layers actions, buttons, background and 79 frames divided up into sections with the labels default, default expand, cl, cl expand, pl, pl expand, specialty, bond

if I was understanding your comment, for the on (click) I should use...

on (click){
  ScrollImage7.gotoAndPlay ("default expand");
}

I still think that is wrong because I also added a symbol on the same frame and the actionscript

on (release){
    this.gotoAndPlay("default expand");
}

works.....however the actionscript

on (release){
    ScrollImage7.gotoAndPlay ("default expand");
}

doesn't....so I must still be screwed up in my movieclip path.

I could use symbols instead of the checkbox...except I want the check to stay once clicked and the symbol doesn't give me that capability by default.

Dan


0
 
dankazupAuthor Commented:
I think I got it...

I used _parent.gotoAndPlay.... ad that seems to work..


I'm finding that the timeline issues are the most difficult for me...thanks for answering so quickly and helping to rattle my brain around a little.


Dan
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now