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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:35:39+00:00 2026-05-21T07:35:39+00:00

tweener doesn’t update myValue while passing the param while tweening. why? public var myValue:Number

  • 0

tweener doesn’t update myValue while passing the param while tweening. why?

public var myValue:Number = 0.0;

Tweener.addTween(this, {myValue: 1.0, time: 2.0, onUpdate: traceValue, onUpdateParams: [myValue]});

private function traceValue(value:Number):void
    {
    trace(value);
    }
  • 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-21T07:35:40+00:00Added an answer on May 21, 2026 at 7:35 am

    Primitive values are always passed by value in ActionScript, never by reference. Tweener is updating your value, but what gets passed to traceValue is always the original value. So in your code above it’ll always trace out 0. The solution is to pass in a reference to the target object instead, and read the value each time. If you pass in the field name this can be done dynamically for the most flexibility. Eg:

    public var myValue:Number = 0.0;
    
    Tweener.addTween(this, {myValue: 1.0, time: 2.0, onUpdate: traceValue, onUpdateParams: [this, 'myValue']});
    
    private function traceValue(target:Object, field:String):void
    {
        trace(target[field]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This works: Tweener.addTween( [ _fee, _fye, _fum ] , { alpna:1, time:10 }); But
i'm unsuccessfully trying to rotate a rectangle around an external point while tweening. i'm
I would like to tint a movieclip with the tweener class. This is how
I am working on a UI that makes heavy use of the Tweener class,
How to import it in Flex? import caurina.transitions.Tweener; It says: 1120: Access of undefined
This issue is giving me serious headaches, I don't have a clue what's going
I'm trying to infinitely loop a bitmap all the way through the colour spectrum
I have an swf file which behaves strangely on IE. The thing is that
I'm building a flash site that uses video transitions to go from section to
I have a problem that I have not faced before: It seems that the

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.