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

AS3 A Condition statement based on movement inside instance/object

Participant ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

  I'd like to condition (yeshbigGrayBall3) to play only after  (yeshgBall2) finishes its internal movement, Something like that.

function release6Ball1(event: MouseEvent): void {

  if (yeshgBall2.frame(60)) {

  yeshbigGrayBall3.gotoAndPlay(1);

  } else {

  yeshgBall2.gotoAndPlay(1);

  }

}

Basically I want yeshbigGrayBall3 to play on the next click, only after yeshgBall2 finishes it's movement. which is in frame 60. I'm just not sure how to tell it to check on which frame the object is in. any Idea?

TOPICS
ActionScript

Views

379

Translate

Translate

Report

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

LEGEND , Jul 23, 2015 Jul 23, 2015

Just how you have it, but the property is currentFrame.

if (yeshgBall2.currentFrame == 60) {

     // play 3

} else {

     // play 2

}

This is assuming the object is currently on the timeline and available to the script.

Votes

Translate

Translate
LEGEND ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

Just how you have it, but the property is currentFrame.

if (yeshgBall2.currentFrame == 60) {

     // play 3

} else {

     // play 2

}

This is assuming the object is currently on the timeline and available to the script.

Votes

Translate

Translate

Report

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
Participant ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

I'm getting Error #1006: value is not a function. on line 12 which is this: if (yeshgBall2.currentFrame(60)) {

Votes

Translate

Translate

Report

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
Participant ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

Ok got it. Thank you so much

Votes

Translate

Translate

Report

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
LEGEND ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

LATEST

You're welcome

Votes

Translate

Translate

Report

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