A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Pass a variable INTO a tween class

  1. #1
    Junior Member
    Join Date
    Mar 2003
    Location
    chicago
    Posts
    7

    Pass a variable INTO a tween class

    I have three circles MCs on the stage. Each is named circleOne, circleTwo, circleThree.

    If I have three buttons with three different vars.
    On button one: testVar = circleOne;
    On button two: testVar = circleTwo;
    On button three: testVar = circleThree;

    How do you pass the variable (which is the name of the circle movie clip) into the alpha tween class (that is in a function)?

    Like this:

    var testAlph = function () {
    var block_01a:Object = new Tween(testVar, "_alpha", Normal, 100, 10, 1, true);

    }

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    try something like this

    PHP Code:
    button1.onRollOver = function(){
        
    testAlph(circleOne)
    }
    button2.onRollOver = function(){
        
    testAlph(circleTwo)
    }
    button3.onRollOver = function(){
        
    testAlph(circleThree)
    }

    function 
    testAlph(who) {
        var 
    block_01a:Object = new Tween(who"_alpha"Normal100101true);


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center