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

  • SEARCH
  • Home
  • 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 246867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:12:30+00:00 2026-05-11T21:12:30+00:00

I have: (1) this[btn_a].onRelease = function (){ this._parent[up_mc]._visible = true; this._parent[add_mc].num = random(10)+190; trace(this._parent);

  • 0

I have: (1)

this["btn_a"].onRelease = function (){
    this._parent[up_mc]._visible = true;
    this._parent[add_mc].num = random(10)+190;
    trace(this._parent);
}   

and I change it to (2)

function click1(){
    this._parent[up_mc]._visible = true;
    this._parent[add_mc].num = random(10)+190;
    trace(this._parent);
}
this["btn_a"].onRelease = function (){
    click1();
}  

When I click the button in (1), it shows ‘_level9’, but when I click the button in (2), it shows ‘undefined’. I know nothing about AS2, so please help me and explain in details. Thanks you very much.

  • 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-11T21:12:30+00:00Added an answer on May 11, 2026 at 9:12 pm

    scoping….

    in the first one, you are calling a function that belongs to the button.
    in the second, you are declaring a function at a level (your case:level9) and then calling it where it sits.

    I think.

    this["btn_a"].onRelease = function (){
        trace(this._parent+" "+this); // traces: _level0 _level0.btn_a
    }
    
    function click1(){
        trace(this._parent+" "+this); // traces: undefined _level0
    }
    this["btn_b"].onRelease = function (){
        click1();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: btn_jouer.onRelease = function () { verif = txt_email_user.text; if (txt_email_user.text
I have this code in jquery : $(#order_btn).click(function(){ var totalprice = $(.price_amount).text(); $(#totalprice).val(totalprice); });
I have a button with dynamic id like this: btn_732692732692029601_9037087001943716_asif.h@myemail.com I want to change
I have this JavaScript function which counts down until you can click the download
I have some simple code: function testing(){ for (a=1; a<=4; a++) { this[btn+a].enabled =
I have this problem, see the trace stack: E/AndroidRuntime(2410): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML
I have an asp:ImageButton with OnClick=Btn_OnClick. In Btn_OnClick I have this line: DataTable dtTable
I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have this code in jQuery, that I want to reimplement with the prototype
I have this idea for a free backup application. The largest problem I need

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.