A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: assigning tween classes to objects in an array

Hybrid View

  1. #1
    Member
    Join Date
    Jul 2005
    Posts
    83

    assigning tween classes to objects in an array

    oh man this is heavy


    My array has a few objects that are revolving like on a carrousell...I want them to react on my mouseclick.

    I cant seem to get this to work...

    how would one make objects in an array do things?

    I cant even define the path to them properly, it appears that I SUCK.

    Allow me to present to you my little code-turdthat wont work in a million years



    _level0.holder_mc.dot0.onRelease = function() {
    var xScaleT:Tween = new Tween(kText, "_rotation", back.easeOut, 0, 1222, 2, true);
    };

    Id hugely appreciate some help...

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    If you have the objects in the array, you should use the array operator somewhere, to access one of its elements.
    Something like:
    code:

    var myArray = [ball_mc, square_mc, rectangle_mc];
    // if you want to tween square_mc:
    var xScaleT:Tween = new Tween(myArray[1], "_rotation", back.easeOut, 0, 1222, 2, true);
    // it's the second element, so, it's myArray[1]


  3. #3
    Member
    Join Date
    Jul 2005
    Posts
    83
    its all blurry to me...

    i dont understand where to put it anymore...

    could you help me understand this...?

    I want to click on one of those items and have it move to the forground, at the same time the other objects should flit off the stage...

    I cant seem to reach the objects to talk to them though...


    help?
    Attached Files Attached Files

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    I looked at your .fla but didn't find the tween script anywhere.
    As I don't have much time to look at it, I created a simple example instead.
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Jul 2005
    Posts
    83
    hey looks promising thank you

    checkin it to see if...

  6. #6
    Member
    Join Date
    Jul 2005
    Posts
    83
    a freind of mine wrote me this

    function doTheAction( clip:MovieClip, action:String ):Void
    {
    switch (action){

    case "toCenter":
    clip._x = Tween(clip,"_x",Regular.easeInOut,clip._x,
    Stage.width/2,30,false);
    clip._x = Tween(clip,"_y",Regular.easeInOut,clip._y,
    Stage.height/2,30,false);
    break;

    case "wobble":
    clip._parent.gotoAndStop("wibblewobble");
    break;

    case "whatTheFrig":
    _level0.dummyClip.gotoAndPlay("somewhere");
    break;
    }

    }


    only theres a syntax error in there somewhere - can you please tell me where?

  7. #7
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    There isn't a syntax error here, at least for me.
    I copy pasted to a blank document and tested it: no error.

    I tested with both Flash 8 and MX 2004.

  8. #8
    Member
    Join Date
    Jul 2005
    Posts
    83
    there was a colon missing in mine - i made it better but it still wont work properly.


    Can you please check this out?

    I simply dont get it...what the frig is wrong here?
    Attached Files Attached Files

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