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 945367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:44:27+00:00 2026-05-15T22:44:27+00:00

I am a java/php developer helping someone with actionscript. I don’t understand why this

  • 0

I am a java/php developer helping someone with actionscript. I don’t understand why “this” is undefined in the below code. this is only a snippet of the code, but hopefully it’s gives an idea of where i’m trying to reference “this”. I’m trying to find out which movie the tween is moving so that i can load the next movie. Tweens are used to move the movies in and out of the screen.

var tween_move_1:Tween = new Tween(movie_0, "_x", Strong.easeOut, 1600, 150, 0.5, true);

tween_move_1.onMotionFinished = function() {
    stop();
    setTimeout(function () {
        trace(this);//when trace runs it shows undefined
        var tween_move_2:Tween = new Tween(movie_0, "_x", Strong.easeOut, 150, 1600, 0.5, true);
        tween_move_2.onMotionFinished = function() {
        var tween_move_1:Tween = new Tween(movie_1, "_x", Strong.easeOut, 1600, 150, 0.5, true);
        };
    }
    ,2000);//end of setTimeout
};//end of tween.onMotionFinished

UPDATE! Here is the working code after applying tips from the responses/answers:

var tween_move_in:Tween = new Tween(movie_0, "_x", Strong.easeOut, 1600, 150, 0.5, true);   
tween_move_in.onMotionFinished = function() {
    stop();
    var tweeny = this;//create reference to this so it can be used in setTimeout()
    setTimeout(function () {
         var movie = tweeny.obj;//use ref to get the movie affected by the tween
         var movieName:String = movie._name;
         var splitArray = movieName.split("_");
         var index = parseInt(splitArray[1]);
         var tween_move_out:Tween = new Tween(_root["movie_"+index], "_x", Strong.easeOut, 150, 1600, 0.5, true);
         tween_move_out.onMotionFinished = function() {
              var tween_move_in2:Tween = new Tween(_root["movie_"+(index+1)], "_x", Strong.easeOut, 1600, 150, 0.5, true);
         };
    }
    ,2000);//end of setTimeout
};//end of tween.onMotionFinished
  • 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-15T22:44:27+00:00Added an answer on May 15, 2026 at 10:44 pm

    If you trying to trace out tween_move_1, you can refer to it directly inside the setTimeout().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 496k
  • Answers 497k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To get the height, just call your own method, passing… May 16, 2026 at 11:49 am
  • Editorial Team
    Editorial Team added an answer Plone's portal_catalog is rather efficient/fast/optimized. It's not like an SQL… May 16, 2026 at 11:49 am
  • Editorial Team
    Editorial Team added an answer Axis allows you to to create web services from existing… May 16, 2026 at 11:49 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am primarily a Java and PHP developer and have some experience with .NET
Hi I'm a PHP developer and I have some experience with Java. I'm trying
I am a PHP developer, I read about Java EE technologies and I want
Let's define languages like c,c++,java as code Python,PHP as script. Is c# code or
I'm a php developer and I want to broaden my knowledge base by learning
I'm a PHP developer . Let's just get that out of the way now.
PHP 5.3 has a new feature called PHAR similar to JAR in JAVA. It's
Written in c++ Highlighter php, html, css, javascript Easy Code Navigation Hinting Remote and
This is a subjective question just to get a general impression. As Java is
I'm trying to get started on combining my (slightly limited) PHP experience with my

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.