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);
}