A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Simple AS3 variable as an object in tween!

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    1

    Simple AS3 variable as an object in tween!

    Hi there. Im sure this is super simple but ive been searching and cant find an answer. I am trying to make an image scroller type thing where there will be 5-6 ingredients with only 3 showing at one time (just using a mask) and the middle of the 3 will sink down a little. For now im just testing with the minimum of 3 ingredients. I can work out which ingredient is in the middle but when i chuck this variable into the tween it brings up the following error:

    ReferenceError: Error #1069: Property y not found on String and there is no default value.
    at testing_fla::MainTimeline/goLeft()

    Please help. I am stumped. It's the fruitgrow tween and the inggrow variable that are causing the problems.

    Also i have tried putting: fruits.fruitimages_mc.lychee_mc into the tween and it works but inggrow = ing3 = fruits.fruitimages_mc.lychee_mc and it doesnt work.

    Actionscript Code:
    var ing1 = fruits.fruitimages_mc.ice_mc;
    var ing2 = fruits.fruitimages_mc.grapefruit_mc;
    var ing3 = fruits.fruitimages_mc.lychee_mc;
    var maining = 2;

    function goLeft(event:MouseEvent):void {
    var fruitsLeft:Tween = new Tween(fruits.fruitimages_mc, "x", Strong.easeOut, fruits.fruitimages_mc.x, fruits.fruitimages_mc.x-110, 2, true);
    maining=maining+1;
    var inggrow = ('ing'+maining);
    trace(inggrow);
    var fruitgrow:Tween = new Tween(inggrow, "y", Strong.easeOut, inggrow.y, inggrow.y+30, 2, true);
    }

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    nvm
    Last edited by ImprisonedPride; 03-29-2011 at 05:52 PM.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

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