Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5952557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:41:55+00:00 2026-05-22T17:41:55+00:00

I define a function and try and run it but it won’t run, if

  • 0

I define a function and try and run it but it won’t run, if i take the code out of the function it runs fine and I can’t work out why, here is the function and the call…

function Boomclat() { 
        var TweenX:Tween = new Tween(this, "_x", mx.transitions.easing.Strong.easeOut, this._x, 16.9, 1, true);
        var TweenY:Tween = new Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, listY, 1, true);
        }
        Boomclat();

Here is my whole code (on this MC, there is more outside):

    onClipEvent (load) {
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    startX = this._x;
    startY = this._y;
    mn = 0;
}
onClipEvent (enterFrame) {
    this.onRollOver = function() {
        this.gotoAndStop("over");
    };
    this.onRollOut = function() {
        this.gotoAndStop("up");
    };
    this.onPress = function() {
        this.gotoAndStop("down");
    };
    this.onReleaseOutside = function() {
        this.gotoAndStop("up");
    };
    this.onRelease = function() {
        this.gotoAndStop("up");
        this.enabled = false;
        this.arrow.gotoAndStop("ordered");
        if (_global.hasAnswered != 1) {
            this.arrow.listNumber = this._parent.Order.length+1;
            listY = 35+(74.9*this._parent.Order.length);
            this._parent.Order.push(this);
            function Boomclat() { 
            var TweenX:Tween = new Tween(this, "_x", mx.transitions.easing.Strong.easeOut, this._x, 16.9, 1, true);
            var TweenY:Tween = new Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, listY, 1, true);
            };
            Boomclat();
            this._parent.buttonHolder.previousOrder.push(this);
        } else {
            for (i=0; i<this._parent.trueOrder.length; i++) {
                if (this == this._parent.trueOrder[i]) {
                    _global.previousButton.enabled = true;
                    _global.previousButton.gotoAndStop("up");
                    myColor = new Color(_global.previousButton);
                    myColor.setTint(255,255,255,0);
                    myColor = new Color(this);
                    myColor.setTint(113,205,0,23);
                    this.gotoAndStop("down");
                    var TweenX:Tween = new Tween(_global.lastText, "_x", mx.transitions.easing.Back.easeOut, 276.4, -210, 0.7, true);
                    _global.whichText = this._parent.textFile[i];
                    var TweenX:Tween = new Tween(_global.whichText, "_x", mx.transitions.easing.Back.easeOut, 760, 276.4, 0.7, true);
                    _global.lastText = whichText;
                    _global.previousButton = this;
                }
            }
        }
    };

}

Anyone can see what’s wrong? Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:41:56+00:00Added an answer on May 22, 2026 at 5:41 pm

    Strangely enough if I define the function before the onRelease it works… here is final code:

    onClipEvent (load) {
        import mx.transitions.Tween;
        import mx.transitions.easing.*;
    
        function orderTween() {
            var TweenX:Tween = new Tween(this, "_x", mx.transitions.easing.Strong.easeOut, this._x, 16.9, 1, true);
            var TweenY:Tween = new Tween(this, "_y", mx.transitions.easing.Strong.easeOut, this._y, listY, 1, true);
        }
        startX = this._x;
        startY = this._y;
        this.onRollOver = function() {
            this.gotoAndStop("over");
        };
        this.onRollOut = function() {
            this.gotoAndStop("up");
        };
        this.onPress = function() {
            this.gotoAndStop("down");
        };
        this.onReleaseOutside = function() {
            this.gotoAndStop("up");
        };
        this.onRelease = function() {
            this.gotoAndStop("up");
            this.enabled = false;
            this.arrow.gotoAndStop("ordered");
            if (_global.hasAnswered != 1) {
                this.arrow.listNumber = this._parent.Order.length+1;
                listY = 35+(74.9*this._parent.Order.length);
                this._parent.Order.push(this);
                orderTween();
                this._parent.buttonHolder.previousOrder.push(this);
            } else {
                for (i=0; i<this._parent.trueOrder.length; i++) {
                    if (this == this._parent.trueOrder[i]) {
                        _global.previousButton.enabled = true;
                        _global.previousButton.gotoAndStop("up");
                        myColor = new Color(_global.previousButton);
                        myColor.setTint(255,255,255,0);
                        myColor = new Color(this);
                        myColor.setTint(113,205,0,23);
                        this.gotoAndStop("down");
                        var TweenX:Tween = new Tween(_global.lastText, "_x", mx.transitions.easing.Back.easeOut, 276.4, -210, 0.7, true);
                        _global.whichText = this._parent.textFile[i];
                        var TweenX:Tween = new Tween(_global.whichText, "_x", mx.transitions.easing.Back.easeOut, 760, 276.4, 0.7, true);
                        _global.lastText = whichText;
                        _global.previousButton = this;
                    }
                }
            }
        };
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to figure out how to define a function that works on
With a class in Python, how do I define a function to print every
What is the correct (most efficient) way to define the main() function in C
I'm trying to dynamically define functions that call through to another function that takes
I want to define a JavaScript class, Foo. Foo = function(value){ this.value = value;
How can I get a user-defined function to re-evaluate itself based on changed data
Python, C++, Scheme, and others all let you define functions that take a variable
I have a user defined function in SQL called getBuisnessDays it takes @startdate and
I would like to write this as a user defined function: private double Score(Story
Suppose a header file defines a function template. Now suppose two implementation files #include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.