I have a tricky issue that I am trying to work out…I have made the following “Booth Info Popup” when a user clicks a booth in my main application…this popup appears…and the fields within it are scrollable…this is fine and dandy and works great…until I run into a profile that is longer than the text field within each “item” in the popup…what I want is the last two items to have autosizing text fields…that seems easy but the issue comes when I try to resize and reposition all the rest of the stuff like the gradient masks and the shadow at the bottom of the “item” and also the rest of the items with respect to the one that is being placed…the popup is populated with items through actionscript…the “item” movieclip is an element in the library that is being brought in by actionscript…(AS2.0)…please take a look and if anyone could shed some light on how I can attack this problem, I would greatly appreciate it…(BTW as far as I know…I will always have 4 items and the first two do not need to resize and the last two do need to resize…if that helps at all)
http://www.expocadvr.com/test/default.html
here is the code that generates the popup
function fadeIn(my_mc, my_mcP)
{
if(_root.dropped)
{
my_mc.myTween.stop();
my_mcP.tweenHandler1.stop();
my_mcP.tweenHandler2.stop();
my_mc.myTween = new mx.transitions.Tween(my_mc, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 65, 2, true);
my_mcP.tweenHandler1 = new mx.transitions.Tween(my_mcP.titleText, "_xscale", mx.transitions.easing.None.easeNone, 100, 130, .5, true);
my_mcP.tweenHandler2 = new mx.transitions.Tween(my_mcP.titleText, "_yscale", mx.transitions.easing.None.easeNone, 100, 130, .5, true);
}
}
function fadeOut(my_mc, my_mcP)
{
if(_root.dropped)
{
my_mc.myTween.stop();
my_mcP.tweenHandler1.stop();
my_mcP.tweenHandler2.stop();
my_mc.myTween = new mx.transitions.Tween(my_mc, "_alpha", mx.transitions.easing.Strong.easeOut, 65, 0, 4, true);
my_mcP.tweenHandler1 = new mx.transitions.Tween(my_mcP.titleText, "_xscale", mx.transitions.easing.None.easeNone, my_mcP.titleText._xscale, 100, 1, true);
my_mcP.tweenHandler2 = new mx.transitions.Tween(my_mcP.titleText, "_yscale", mx.transitions.easing.None.easeNone, my_mcP.titleText._yscale, 100, 1, true);
}
}
function scrollItems(myClip, myMask, mySpeed)
{
if (myMask._xmouse > 0 && myMask._xmouse < myMask._width && myMask._ymouse > 0 && myMask._ymouse < myMask._height)
{
mouseY = myMask._ymouse;
clipY = myClip._y;
maxY = myClip._height - myMask._height - 2;
minY = 0;
midY = myMask._height / 2;
speed = mySpeed;
if (mouseY <= midY && clipY <= minY)
{
diff = (midY - mouseY) / speed;
myClip._y = clipY + diff;
}
else if (mouseY >= midY && clipY >= -maxY)
{
diff = (mouseY - midY) / speed;
myClip._y = clipY - diff;
}
if (myClip._y >= minY)
{
myClip._y = minY;
}
else if (myClip._y <= -maxY)
{
myClip._y = -maxY;
}
}
}
function loadItems()
{
for (var i = 0; i < 4; ++i)
{
var item_mc = newsScroll.newsItemHolder.attachMovie("item", "item" + i, i);
item_mc._x = 0;
t = newsScroll.newsItemHolder;
item_mc._y = t["item" + [i - 1]]._y + t["item" + [i - 1]]._height;
/*var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(item_mc.newsItemButton.buttonInner);
colorTrans.alphaMultiplier = 0;
trans.colorTransform = colorTrans;*/
var colorTrans = new flash.geom.ColorTransform();
var trans = new flash.geom.Transform(item_mc.newsItemButton.buttonInner);
colorTrans.alphaMultiplier = 0;
trans.colorTransform = colorTrans;
item_mc.newsItemButton.buttonInner.cacheAsBitmap = true;
item_mc.newsItemButton.gradientMask.cacheAsBitmap = true;
item_mc.newsItemButton.buttonInner.setMask(item_mc.newsItemButton.gradientMask);
item_mc.onRollOver = function ()
{
fadeIn(this.newsItemButton.buttonInner, this);
}
item_mc.onRollOut = item_mc.onReleaseOutside = function ()
{
fadeOut(this.newsItemButton.buttonInner, this);
}
}
}
newsScroll.newsItemHolder.setMask(newsScroll.scrollMask);
newsScroll.onEnterFrame = function ()
{
if(_root.dropped)
{
scrollItems(newsScroll.newsItemHolder, newsScroll.scrollMask, 5);
}
}
loadItems();
newsScroll.newsItemHolder.item0.titleText.newsContent_txt.text = "Applied Computer Technology";
newsScroll.newsItemHolder.item0.content.text = "69 S. La Salle"+"
"+"Aurora, IL 60505";
newsScroll.newsItemHolder.item1.titleText.newsContent_txt.text = "Contact";
newsScroll.newsItemHolder.item1.content.text = "phone: 630-555-0000"+"
"+"e-mail: [email]blah@expocad.com[/email]";
newsScroll.newsItemHolder.item2.titleText.newsContent_txt.text = "Profile";
newsScroll.newsItemHolder.item2.content.text = "This is a really cool Company";
newsScroll.newsItemHolder.item3.titleText.newsContent_txt.text = "Categories";
newsScroll.newsItemHolder.item3.content.text = "Software, Space Travel, Snorkeling, Kayaking, Snowboarding, Moon Pies, Porta Potties, WW2 Memorabilia";