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

Return to a calling function

Participant ,
Dec 15, 2008 Dec 15, 2008

Copy link to clipboard

Copied

I need some help here, please.
I have several buttons calling the bounceOut() function and the bounceOut() function calls the onMotionFinish() function. After that function is finished I want to go back to the original calling function. Can someone help me with this?

First a call is made to bounceOut() when a button is clicked. I have ten buttons.

function bounceOut() {
var smSlide:Tween=new Tween(sideMenu_mc,"x",Regular.easeOut,200,-200,2,true);
smSlide.addEventListener(TweenEvent.MOTION_FINISH, onMotionFinish);

}

function onMotionFinish(event:Event):void {
removeChild(pageTitle);
removeChild(sideMenu_mc);
removeChild(missionContent_mc);
removeChild(missionTitle_mc);

}
TOPICS
ActionScript

Views

440

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 ,
Dec 15, 2008 Dec 15, 2008

Copy link to clipboard

Copied

What is the original calling function, and what do you need to accomplish there after the fact? The call to BouneOut(); can be followed by code in the original function, so I guess I'm not really clear on what you are after.

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 ,
Dec 15, 2008 Dec 15, 2008

Copy link to clipboard

Copied

LATEST
Thanks Ned. I solved it. I just put return; after each function and that "back traked me" to the original calling function. When I tried this at first it did not work and I think the basic problem I am having is with the Tween as the motion does not always complete and therefore does not let the rest of the script execute. Do you have any idea why these Tweens are not completing? I have a few of them throughout the program and they are all doing the same. I have to "Test Movie" several times before I get lucky and they complete and then the program runs fine. I have them all set to under 1.5 seconds as I read somewhere that there this might happen after this time. It's driving me nuts.
Thanks for your help any way. I appreciate it.

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