Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




_height Tweening Issue



I have this code for a simple drop down-style menu i guess.All I want is it to stretch up or down from its current _height.It works if you do it slowly, but the problem occurs if you roll over and out quickly.Shortly after you rollOut and the box/mask has returned to _height = 1, it jumps to _height = Stage.height and doesnt return.Same thing happens with an onEnterFrame/hitTest which I use for another drop-down with rollovers within rollovers.Any ideas?CheersAttach Code_parent.desc.onRollOver = function() {useHandCursor = false;if (_root.menus.topbar.desc.desc_mc._alpha == 100) {var scalebarOut:Tween = new Tween(stretch_bar, "_height", Strong.easeOut, stretch_bar._height, Stage.height, 2, true);var scalemaskOut:Tween = new Tween(stretch_mask, "_height", Strong.easeOut, stretch_mask._height, Stage.height, 2.2, true);}};_parent.desc.onRollOut = function() {if (_root.menus.topbar.desc.desc_mc._alpha == 100) {var scalebarIn:Tween = new Tween(stretch_bar, "_height", Strong.easeOut, stretch_bar._height, 1, 1.5, true);var scalemaskIn:Tween = new Tween(stretch_mask, "_height", Strong.easeOut, stretch_mask._height, 1, 1.3, true);}};



Adobe > ActionScript 1 and 2
Posted on: 02/26/2008 11:03:25 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Tweening _height Or _width Moves The Object
Is there a way around this issue? I've got this code:


Code:
twnH = new mx.transitions.Tween(thumb, "_height", mx.transitions.easing.Back.easeOut, this._height, this._height+150, 5, true);
twnW = new mx.transitions.Tween(thumb, "_width", mx.transitions.easing.Back.easeOut, this._width, this._width+250, 5, true);
My problem is that when this tween happens it moves the thumb Object. However if I trace the _x and _y before and after the tween I get the same results. So it appears to be moving but technically it doesn't move?

What I'm trying to do is I've got a grid of movieclips that display a thumbnail and title of an image. And when somebody clicks anywhere in the movieclip I want that MC to go to _x:20 and _y:175 and resize to 760 x 425 to display more info on that image. Is there a better way to do this then to tween it to these locations?! Because its not really working well for me and I guess I could use onEnterFrame if necessary but i'd rather use the tween class.

Thanks for the help people!

Tweening Issue
Hello Flash Guru's..

I'm wondering how I manage to make a smooth motion-tweening with just 12 fps??

Tweening Issue
okay, my new homepage is at:

http://www.brainrage.net

The 'resume' and 'download' buttons are movie clips with animated tweens, with the code:

resButt.onRollOver = function() {
resButt.play();
};
resButt.onRollOut = function() {
resButt.play();
};

Tweening Issue
I have a row of buttons that I want to scale 125% on rollover and back to 100% on rollout. My script is not working though. For the time being, I'm just trying to get one button to work. It's instance name is claritybtn

Any help is greatly appreciated.







Attach Code

import mx.transitions.Tween;
import mx.transitions.easing.*;

claritybtn.onRollOver = function() {
new Tween(claritybtn, "_xscale", Strong.easeOut, _xscale, 100, 125, 10, false);
new Tween(claritybtn, "_yscale", Strong.easeOut, _yscale, 100, 125, 10, false);
};

claritybtn.onRollOut = function() {
new Tween(claritybtn, "_xscale", Strong.easeIn, _xscale, 125, 100, 10, false);
new Tween(claritybtn, "_yscale", Strong.easeIn, _yscale, 125, 100, 10, false);
};

Tweening Issue
Here is the problem I have:

I have a flash banner that has movie clips on it. Each movie clip triggers different easing animations in the background depending on which movie clip you roll over.

For example,

roll over mc1 = 3 graphics eased into back ground displaying 26% savings (photo, %, text description

roll over mc2 = 40% savings, different photo, 46%, and a text description)

roll over mc3 = 70% savings

my problem is that I'd like the flash movie to animate itself through the different savings when it starts and allows the user to interrupt the animation and mouse over one of the movie clips and view the possible savings on their own

I would like to do this because I am worried that users might miss the movie clips and never roll over it all, so I would only need the flash movie to animate once.

here is a sample of the code I used:

Y_value = menu1._y;
X_value = bg1._x;
Z_value = bg2._x;
Q_value = bg2._y;

T_value = text3._x;

P_value = percent3._y;

A_value = pl._x;

over_clip.onPress = false;
over_clip.enabled = false;





menu1.onPress = function() {

};
menu1.onRollOver = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value, Y_value-40, 2, true);
new mx.transitions.Tween(bg1, "_x", mx.transitions.easing.Strong.easeOut, X_value, X_value-795, 2, true);
new mx.transitions.Tween(text1, "_x", mx.transitions.easing.Strong.easeOut, T_value, T_value+520, 2, true);
new mx.transitions.Tween(percent1, "_y", mx.transitions.easing.Strong.easeOut, P_value, P_value-150, 1.5, true);
};
menu1.onRollOut = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value-40, Y_value, 2, true);
new mx.transitions.Tween(bg1, "_x", mx.transitions.easing.Strong.easeOut, X_value-795, X_value, 2, true);
new mx.transitions.Tween(text1, "_x", mx.transitions.easing.Strong.easeOut, T_value+520, T_value, 2, true);
new mx.transitions.Tween(percent1, "_y", mx.transitions.easing.Strong.easeOut, P_value-150, P_value, 1.5, true);
};
//----------------------------------
menu2.onPress = function() {

};
menu2.onRollOver = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value, Y_value-60, 2, true);
new mx.transitions.Tween(bg2, "_x", mx.transitions.easing.Strong.easeOut, Z_value, Z_value+795, 2, true);
new mx.transitions.Tween(text2, "_x", mx.transitions.easing.Strong.easeOut, T_value, T_value+640, 2, true);
new mx.transitions.Tween(percent2, "_y", mx.transitions.easing.Strong.easeOut, P_value, P_value-150, 1.5, true);
};
menu2.onRollOut = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value-60, Y_value, 2, true);
new mx.transitions.Tween(bg2, "_x", mx.transitions.easing.Strong.easeOut, Z_value+795, Z_value, 2, true);
new mx.transitions.Tween(text2, "_x", mx.transitions.easing.Strong.easeOut, T_value+640, T_value, 2, true);
new mx.transitions.Tween(percent2, "_y", mx.transitions.easing.Strong.easeOut, P_value-150, P_value, 1.5, true);
};
//----------------------------------
menu3.onPress = function() {

};
menu3.onRollOver = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value, Y_value-90, 2, true);
new mx.transitions.Tween(bg3, "_y", mx.transitions.easing.Strong.easeOut, Q_value-200, Q_value, 2, true);
new mx.transitions.Tween(text3, "_x", mx.transitions.easing.Strong.easeOut, T_value, T_value+250, 2, true);
new mx.transitions.Tween(percent3, "_y", mx.transitions.easing.Strong.easeOut, P_value, P_value-150, 1.5, true);
};

menu3.onRollOut = function() {
new mx.transitions.Tween(this, "_y", mx.transitions.easing.Elastic.easeOut, Y_value-90, Y_value, 2, true);
new mx.transitions.Tween(bg3, "_y", mx.transitions.easing.Strong.easeOut, Q_value, Q_value-200, 2, true);
new mx.transitions.Tween(text3, "_x", mx.transitions.easing.Strong.easeOut, T_value+250, T_value, 2, true);
new mx.transitions.Tween(percent3, "_y", mx.transitions.easing.Strong.easeOut, P_value-150, P_value, 1.5, true);

Shape Tweening Issue
In flash MX i cannot make a shape tween, i can start one, with the starting image, but when i try to make the ending image it will not form the arrow, it is still a dotted line.. im kinda a newbie at shape tweening, so can someone help me? or show me where i can find a tutorial on it?

thx in advance.. -agunc

Slow Tweening Issue
I am working on a movie with a intricate background, which is just a single graphic replicated 20 times or so. my problem is that any tweening i do on top of the background runs slow.

look at the file below. on about frame 50, im doing a simple background color change. I do it by fading in a solid graphic from alpha 0 to alpha 100, over about 10 frames. the trouble is that it takes much longer than that.

http://www.birminghammenus.com/rojo/rojo.html

anyone know why it runs slow, or how i can code it differently? Thanks in advance.

Issue With Tweening And Alpha
Hi guys, it's me again... I'm going through the tutorials from Lynda.com and I've come to a strange issue. When I wish to have a tween morph and also "fade in" the tutorial tells me to bring the Alpha down to 0%. However when I do this... my object completely disappears from the tween... so upon testing I just get a solid black object with no morphing or fading blinking for one frame on the loop. Once this happens I can no longer select the object. Has anyone encountered an issue like this before?

I should note that if I bring the Alpha to down to 1% instead of 0, the fade-in and morphing effects work just fine.

Thanks in advance.


david

Shape Tweening Issue
I have a shape tweening problem. I'm trying to melt these numbers, but I'm getting a wierd line on number 3. The line goes from the end of the three to the middle line. I don't understand why it appears
I've added quite a few shape hints and it's helped, but I've still got this stubborn line.
You can see the problem here:
3 is on the right
The number 2 is also freaking out, but I'm going to get 3 sorted out first.

thanks.

Tweening With Actionscript - Repeating/cycling Issue
Hi

I am using MX2004 Pro. I am trying to produce a cycling effect on some scripted tweening, using the mx.transitions classes. The idea is that when one transition finishes it triggers the next. It's kind of recursive - everything works apart from the function call from within the onMotionFinished event handler. Ie. it fails to cycle. Here is my for the function in question:


Code:
public function tweenNextRelease():Void
{
var clipRef:MovieClip = eval('this.r' + _currentRelease);
trace(_currentRelease + " Clipref = " + clipRef._name);
var myTween:Object = new Tween(clipRef, "_alpha", Regular.easeIn, 100, 0, 1, true);
mx.transitions.TransitionManager.start(clipRef, myTween);

if(this._currentRelease == 0 ) this._currentRelease = _releases.length;
this._currentRelease--;

myTween.onMotionFinished = function() {
trace("Finished: " + clipRef._name);
clipRef.tweenNextRelease(); // keep cycling
};

}

Any ideas where I am going wrong?

TIA

Please Take 2 Mins To Look At This Issue ... MC Not Motion Tweening After Enlargment
Hi All, not even sure where to start, i have spent around 7 - 8 hours on this issue.

http://stuff.visualtwist.com/test/prob.swf this is the problematic .swf file and the code below is the problematic code:

on (press) {
setProperty(this.framelarge, _height, "438.6");
setProperty(this.framelarge, _width, "378.3");
}
on (release) {
setProperty(this.framelarge, _height, "219.3");
setProperty(this.framelarge, _width, "189.2");
}

Its all simple enough but its leaving the image stuck on the page after zooming, i have searched google and endless forums and tried every piece of code i can think of.
If you dont press the enlarge button its fine ... *sigh*
The photo image itself is randomly generated leaving out the option of doing a duplicate clip for the enlargement and then unloading it else that would work... does ANYONE have any ideas at all? I would LOVE YOU forever you simply cannot believe how frustrating this has been for me, 8 hours and getting absolutely no-where.

MC _height ?
Hi,

How can you set the height of a parent MC without affecting attached MC's inside? I created a test file ... a bar and a box.. I am attaching the boxMC to the barMC. I have a button that sets the _height property of the barMC.... it adjusts the height of the barMC but also the attached boxMC's.... and it appears to have "scale" to it, not just height manipulation??

Here is a look at the test code......

Code:
amount = 3;
spacing = 20;
for (var i = 1; i<=amount; i++) {
newBox = _root.bar.attachMovie("boxMC", "box"+i,10 + i);
newBox._x = 28;
newBox._y = newBox._height + spacing*i + -50;
}
myButton.onRelease = function() {
_root.bar._height += 5;
};
The demo file is attached. Any ideas how to only manipulate the _height property of the bar and not the attached boxes?

Thanks
NTD

_height Of Textfield ?
Hello everyone,

I have a strange problem. I've created MC including textfield (static text). The textfield includes various fonts and sizes. When I check height of the MC, its DIFFERENT than _root.myMC._height (the difference is a few pixels and changes everytime I change height of the Textfield).

Am I doing something wrong ??

Thanx for reply, Peter

_height & _width
Hi all

I am trying to return the size of my movie using _height and _width properties, but this returns the size of the MC I have placed on the stage. Does anyone know how I can return the actual movie size?

Cheers
Mark

Scrollbar MC _height?
Maybe someone can help -
How can I change the height of TextBox_size(MC). Is everything controlled by the movie size?

I put the scrollbarDynamic7.fla at http://www.bitweb.com/test for reference

TextBox._height = TextBox_Height;
function springAction () {
scrollpos = -scroll._y;
ratio = (content._height - TextBox_Height) /(TextBox_Height - scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos - content._y;
addY = difY / 5;
overshootY = overshootY + addY;
content._y = content._y + overshootY + addY;
}
function easeOut () {
scrollpos = -scroll._y;
ratio = (content._height - TextBox_Height) /(TextBox_Height - scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos - content._y;
content._y = content._y + difY / 3;
}

Cheers

Kobus

_x, _y, And _width, _height
Hey guys please explain something to me:

this code works perfectly:

on (release) {
createEmptyMovieClip("holder", 1);
holder.loadMovie("muestra.jpg");
holder._x=200
holder._y=100

}


BUT THIS ONES DOES NOT WORKS:

on (release) {
createEmptyMovieClip("holder", 1);
holder.loadMovie("my_image.jpg");
holder._x=200
holder._y=100
holder._height=100
holder._width=50


}




please why? when i only position my .JPG with the _x and _y, it works perfectly, but if i what to change it dimensions too it does not work. Please why is this, and how do i do it? I´m pulling hair here.

_width And _height
I have a problem with the _width and _height property. I have a menu that contain a mask (to hide the 3D effect). My problem is that the _width and _height property give me the size of the Mask and not the actual visible size. Is there a way to specify a layer or something on which I want the _witdh and _height property to have those of the visible part only?

I want to use this to hide my sub menu like that
if (((_parent._ymouse < 0) or (_parent._ymouse > _parent._height))
or ((_parent._xmouse < 0) or (_parent._xmouse > _parent._width))){
HideSubMenu();
}

_height From Library?
Is there any way that I can find out what the _width or _height of a movieclip in my library is before I attach it to the stage? I don't want to create an instance of a movie unless I need to, and I won't know if I need to unless I know how big it is.

This._height = Undefined?
I'm trying to get the value of the "main" body of the flash movie.. the actual.. working area on flash defined.. by flash.. BUT I keep on getting this "undefined" statement when I try to
trace(this._height);
trace(root._height)'
trace(level0._height);

.... width doesnt work either


I'm also wondering if I can change this values using action script..

Thanks

[F8] _height Not Getting Correct Value
I have this:


Code:
for (var i = 0; i<nTotalPics; i++) {

picHolder.createEmptyMovieClip( "pic"+i, i);
var pic:MovieClip = picHolder["pic"+i];

// load images
image_mcl.loadClip( astrImages[i], pic );

// add text boxes and such underneath thumbs
var txtPicQuan = pic.createTextField("txtPicQuan", i, _parent._x, (_parent._y+_parent._height+5), (thumbWidth-pad), 20);
txtPicQuan.text = "How many?";

}
trace (this.picHolder.pic0._height);
This trace function is not giving my an output of 100 like I thought it should, it's giving me the height of the textfield I created at the bottom of my code that is put inside of pic0. My images show up fine and with a height and width of 100, but my trace function doesn't give me those values.

Thanks for ANY ideas !

[CS3] Limit _height
Hello,

I am 95% through my project and have hit a snag. My .fla incorporates _xscale and _yscale on a button to scale a movie clip. It's a simple code that scales up and down - to infinity it seems. My client wants me to limit the scale to no more than 200% or 800 pixels. I thought a simple fix would accomplish this, but it appears that I am not correct.

I would really appreciate a pointer in the right direction-and/or why I can't use what I am using.

Below is my code.

Thank you for your time in advance.


PHP Code:



stop();

var middle:Number = Stage.width/2;
var middle2:Number = Stage.height/2;

//centers image//

zoomOut_mc.onPress = function ()
{

chair._x = middle;
chair._y = middle2;
chair._xscale *= .9
chair._yscale *= .9
}

zoomIn_mc.onPress = function ()
{
    
chair._x = middle;
chair._y = middle2;
chair._xscale *= 1.1
chair._yscale *= 1.1
}


chair.onEnterFrame()
{
if(chair._height > 800) {zoomIn_mc.enabled = false();
}

}

Target_mc._height
hi if got a little problem how can I use the target_mc._height outside of my onloadinit function? i have to add it to my var K to keep me on the right height?


var k = 10;
//variabele voor het bijhouden van de hoogte
var j = 10;
//variabele voor het bijhouden van dfe depth
function loadXML(loaded) {
if (loaded) {
myTBX.contentPath = "content_holder";
xmlNode = this.firstChild;
date = [];
titel = [];
entry = [];
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
date = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
titel = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
entry = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
image = xmlNode.childNodes.childNodes[3].firstChild.nodeValue;
//formatting voor datums
var my_fmt2 = new TextFormat();
my_fmt2.font = "Verdana";
my_fmt2.size = 11;
my_fmt2.underline = true;
my_fmt2.color = 0xFFCC33;
//Yellow
my_fmt2.bold = true;
var metricsDate:Object = my_fmt2.getTextExtent(date, 100);
thisTextBox = myTBX.content.createTextField("tbxDate"+i, 20+j, 20, k, 100, metricsDate.textFieldHeight);
j++;
k += 15;
//tussen titel en datum
thisTextBox.background = false;
thisTextBox.border = false;
thisTextBox.backgroundColor = 0xcccccc;
//light grey
thisTextBox.borderColor = 0x000000;
//black
thisTextBox.multiline = true;
thisTextBox.wordWrap = true;
thisTextBox.text = date;
thisTextBox.setTextFormat(my_fmt2);
//formatting voor datums
var metricsTitel:Object = my_fmt2.getTextExtent(titel, 300);
thisTextBox1 = myTBX.content.createTextField("tbxTitel"+i, 20+j, 20, k, 300, metricsTitel.textFieldHeight);
j++;
k += 15;
//tussen titel en txt
var my_fmt3 = new TextFormat();
my_fmt3.font = "Verdana";
my_fmt3.size = 11;
my_fmt3.underline = true;
my_fmt3.color = 0xFF9900;
//orange
my_fmt3.bold = true;
thisTextBox1.background = false;
thisTextBox1.border = false;
thisTextBox1.backgroundColor = 0xcccccc;
//light grey
thisTextBox1.borderColor = 0x000000;
//black
thisTextBox1.multiline = true;
thisTextBox1.wordWrap = true;
thisTextBox1.text = titel;
thisTextBox1.setTextFormat(my_fmt3);
var my_fmt = new TextFormat();
my_fmt.font = "Verdana";
my_fmt.size = 10;
my_fmt.color = 0x000000;
//grey
var metricsText:Object = my_fmt.getTextExtent(entry, 450);
thisTextBox2 = myTBX.content.createTextField("tbxText"+i, 20+j, 20, k, 450, metricsText.textFieldHeight);
j++;
k += metricsText.textFieldHeight;
thisTextBox2.background = false;
thisTextBox2.border = false;
thisTextBox2.backgroundColor = 0xcccccc;
//light grey
thisTextBox2.borderColor = 0x000000;
//black
thisTextBox2.multiline = true;
thisTextBox2.wordWrap = true;
thisTextBox2.html = true;
thisTextBox2.htmlText = entry;
thisTextBox2.setTextFormat(my_fmt);
k += 15;
//eindhoogte tussen enrty
if (image != "undefined") {
var mci:MovieClip = myTBX.content.createEmptyMovieClip("mc"+i, 40+j);
j++;
var image_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace(target_mc._height); // <--here i have it


};
image_mcl.addListener(mclListener);
image_mcl.loadClip(image, mci);
mci._y = k;
mci._x = 30;

//k+= target_mc._height + 10; // <-- here's my problem


}
}
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("

_height & _width
i have following code

this.createEmptyMovieClip("img",1);
img.loadMovie("M-1.jpg");

trace(img._width);
trace(img._height);

and this both trace give output 0.

so how can i know the height n width of movieclip after loading jpg.

_height Property In Flash5
I set out to increase the height of a box existing in the main timeline using actionscript. I converted the given box into a movieclip first and gave the intstance a name of "box". I then added the following code into frame 1 of the main timeline:

boxheight = getProperty ( "box", _height );
if (boxheight>=300) {
gotoAndStop (3);
} else {
setProperty ("box", _height, number(boxheight)+30);
}


Frame 2 has a goto frame 1 and play statement. Frame 3 has a stop statement.

When I run this movie the box does increase in height until it reaches a height greater than or equal to 300.

My problem is that when the height of the box is increasing both the top and bottom of the box move. I don't want this to happen. I want the bottom to remain anchored, so to speak, and only the top to increase. Can someone help?

Changing The _root._height Is It Possible?
I havent tried this yet. I could just do it without asking and see if it works, but I wanted to see if I could get some feedback. I have a site that used a flash menu for navigation. There are a couple sections in which that menu needs to expand further than it needs to in most other sections.

Lets say I typically have it set at 295 x 350 on most pages but some pages require the menu to expand a little farther so it needs to be 295 x 425.

Rather than force that section to load a whole new file, can I embed the same movie with the new height specififed in the HTML? Then in the flash file I will add a line of code to set the _root._height to its new height.

The flash file would know it was being called into the this section of the site becuase these pages would pass it a variable like flashfile.swf?sectionID=newHeight.

Then if the flash file saw it was a "newHeight" section it would set the _root._height accordingly.

Would this work? It seems like it should, but I have yet to try it.

Thanks. Keep rockin baby!

Scroll Bar _height At Runtime
How do you set the scroll bar _height at runtime without distorting it.
whatever=40
myScrollbar._height=whatever
dosn't work

Scrollbar _height At Runtime
How do you set the scroll bar _height at runtime. If you just asign a value to it then it distorts it. this is what I have been doing.

whatever=50
myScrollBar._height=whatever

Boo Hoo it dosn't work

_width And _height, How It Works?
Why when i execute this script :

if (_root.mcPict._width<400){
_root.mcPict._width=_root.mcPict._width+5;
}

When i execute this, the height of my movie clip is changing too, is somebody can explain me what is appening.


---
thanks
merci

Eval(pathToMC)._height ?
Why this doesn't work??

eval("_root.content.staticMovie"+i+".image"+i)._he ight = 140;

or

eval("_root.content.staticMovie"+i).setProperty("i mage"+i, _height, 140);


Any suggestions?!?

Thanks
Cash

_width & _height Detection
I have written this to resize an mc:
code: mc.onEnterFrame = function() {
speed = 5;
endW = 200;
endH = 200;
w = endW - this._width;
h = endH - this._height;
this._width += w/speed;
this._height += h/speed;
if (this._width >= endW && this._height >= endH) {
trace("trace");
delete this.onEnterFrame;
}
}

I need to have the width and height detected then have an action to occur.

It's odd because if i change it to <= instead of >=, the trace occurs.

Thanks for any help.

Misreading _height Of A TextField?
I have some script that has to rely on the height of a movie clip.

Code:
if (textBox._height>190) {
scrollAmount = 190-textBox._height;
stop();
} else {
gotoAndStop(3);
}

This is normally fine, but the static textField that I have inside the movieClip textBox is being read incorrectly. Instead of taking the height of the textField, its only reading from the top of the top letter to the bottom of the bottom letter...which knocks off 9px or so. Is there any way to fix this?

Thanks for any help.

Right now I'm jerry-rigging around it, but I would really like to fix this issue.

_height Based Off .maxScroll
Hi All,
I'm having a little problem with my AS2 .maxscroll. I am using the total number of text lines(.maxscroll) multiplied by 14 to give me the _height of a movie clip called entryBackMiddle... Seems to work until I look closer... it appears that some of my clips are sized to long and other clips are to short... Originally I was using .textHeight but that keeps giving me undefined so I switch over to maxscroll...

I've marked in red what I think might be the problem. I have also included a file and the entire code of how I'm looping thought my xml and attaching my clip in case its something else is wrong.
code:
//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
//var theTextHeight:Number = this["entry_clip" + h + "" + i].entry_text.textHeight;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//



It loops thought the xml just fine.

code:
/***** LOAD EXTERNAL XML****/
var timeLineXMLConn:XML = new XML ();
this.timeLineXMLConn.ignoreWhite = true;
this.timeLineXMLConn.load ("CompleteTimelines.xml");
this.timeLineXMLConn.trigger ();
trace ("this is = " + this);
this.timeLineXMLConn.onLoad = function (success:Boolean):Void {
if (success) {
//trace("this is Loaded = "+this);
eval ("entry_clip" + i).entry_text.text = timeLineXMLConn;
this.timelineXML.onload = processXML (timeLineXMLConn);
} else {
trace ("error loading XML file");
}
};
/***** LOAD XML****/

function processXML (xml:XML) {
trace ("processXML = " + "Called");
// the y value of our entries,
// ie how far above the line they are
root_element = timeLineXMLConn.firstChild;
// loop through the XML
for (h = 0; h < root_element.childNodes.length; h++) {
trace ("--------- h = " + h + " -------- ");
element = root_element.childNodes[h];
// pulling out the data as we go
for (i = 0; i < element.childNodes.length; i++) {
entry_text = root_element.childNodes[h].childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nod eValue;


var newPlot = this.attachMovie ("entry_clip", "entry_clip" + h + "" + i, this.getNextHighestDepth ());
this["entry_clip" + h + "" + i]._x = Math.round(Math.random()* 800)+ 20;
this["entry_clip" + h + "" + i]._y = Math.round(Math.random()* 600)+ 20;
this["entry_clip" + h + "" + i].entry_text.autoSize = true;
//this["plot" + h + "" + i].entry_clip.entry_text.wordWrap = true;
this["entry_clip" + h + "" + i].entry_text.multiline = true;
this["entry_clip" + h + "" + i].entry_text = entry_text.toString ();
//this.timelines_MC["plot"+h+""+i].entry_clip.entry_text.setTextFormat(this.myformat );
//

//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//
}

}
}




Any and all help will be greatly appreciated :-)
Thanks in advance
Scott

_height Property Stuck On 0
Hi folks,

I've dynamically created a MC, and then am dynamically loading a list of elements into this clip. I then trace the height of the clip and it is still 0 after adding all of these things into the clip at increasing y-values per element.

Can anyone tell me how to get the container clip to realize it is now quite tall?

Here's the method that is trying to make this happen:


Code:
public function createContentShell(holderClip:MovieClip, W:Number, scrollArea:MovieClip, decelFactor:Number, speed:Number):Void
{
trace("createContentShell fired");
//trace("instance passed is "+this._name);
trace("number of elements is "+numOfElements);
var i:Number;
holderClip.createEmptyMovieClip("menu_mc", holderClip.getNextHighestDepth());
holderClip.menu_mc._width = W;
holderClip.menu_mc._height = 500;
trace("the height of the menu_mc clip is "+holderClip.menu_mc._height);
var heightTotal:Number = 0;
for (i=0; i<numOfElements; i++)
{
trace("running element builder on i = "+i);
holderClip.menu_mc.createEmptyMovieClip("element"+i, holderClip.menu_mc.getNextHighestDepth());
with (holderClip.menu_mc["element"+i])
{
_y = i * 50;
createTextField("textTitle_txt", getNextHighestDepth(), 0, 0, W, 25);
createTextField("textDesc_txt", getNextHighestDepth(), 0, 25, W, 30);
textTitle_txt.wordWrap = true;
textDesc_txt.wordWrap = true;
textTitle_txt.autoSize = true;
textDesc_txt.autoSize = true;
textTitle_txt.text = "Test Title Here";
textDesc_txt.text = "This is a fictional description of some sort. I'm now going to try to make it really tall.";
trace("the height of the textDesc_txt field is "+textDesc_txt._height);

}
}
trace("the height of the menu_mc clip is "+holderClip.menu_mc._height);
holderClip.scroller_cust = new VerticalScroller(holderClip, "scroller_cust", holderClip.menu_mc, scrollArea, decelFactor, speed);
}
Both traces of the height report it at 0...

Thanks!!

[F8] Maximum _height Question
hey everybody,

just out of curiosity, what is the maximum height allowable for the TextField? I have one and no matter how much i resize it in authoring mode, during runtime it cuts off the rest of the content.

Scaling Using _height _width?
Whats the best way of scaling the _height and _width of a movieClip??

_width And _height Are A Percentage?
This is an excerpt from a loop I'm working on:

Code:
duplicateMovieClip ('photo', 'photo'+i, i);
loadMovie('photos/sample'+i+'.jpg', 'photo'+i);
this['photo'+i]._width = 500;
this['photo'+i]._height = 300;
It's a portion of a loop that is processing images as they load. Most of the images are considerably larger than I'd like them, so I wish to scale them down to 500 pixels by 300 pixels. I've attempted to do this via _width and _height, but Flash is treating the values as percentages rather than pixels (contrary to Flash documentation).

Any insight would be greatly appreciated. I've been up for quite some time now, so please don't be too harsh if I've overlooked something simple.

Thanks in advance!

TextField._height Problem
hey guys, I have a dynamic text field and html on
when i do
Code:

Code:
txt.htmlText = "my image: <img src="red.jpg">";
I see the image, but txt._height changes
I have my text field inside a movieclip so the movieclips height changes and thats bad for my project, is there any fix for this?

Position MC Depending On _height Of Another MC
How would I get the property of a movie clip and use it in the code shown in blue below. I seem to have a problem manipulating the MC all in one run because I can get these properties in other situations. Thanks in advance...

//Create Movie Clips
_root.createEmptyMovieClip("imageHolder1", 200);
_root.createEmptyMovieClip("imageHolder2", 201);
_root.createEmptyMovieClip("imageHolder3", 203);

loadMovie("krystal.jpg","imageHolder1");
loadMovie("billy.jpg","imageHolder2");
loadMovie("bradly.jpg","imageHolder3");

//Size Movie Clips
imageHolder1._xscale = 20
imageHolder1._yscale = 20
imageHolder2._xscale = 20
imageHolder2._yscale = 20
imageHolder3._xscale = 20
imageHolder3._yscale = 20

//Position Movie Clips
imageHolder1._x=135;
imageHolder1._y=5;
imageHolder2._x=135;
imageHolder2._y=(10 + _root.imageHolder1._height);
//imageHolder2._y=(10 + getProperty(_root.imageHolder1, _height);
imageHolder3._x=135;
imageHolder3._y=(10 + _root.imageHolder2._height);
//imageHolder3._y=(10 + getProperty(_root.imageHolder2, _height);

Designtime _height Different From Runtime. Why?
This is strange. My MC is 710 px tall in designtime and although no actionscript code touches it at all, the debugger shows that AS reads it as 697.6 px tall. Any ideas as to what is causing this?

Cheers,
Terpentine

_height & _width Problem
hmm...

guys, i just realise that even is within the mask the _height and _width is counted the whole mc(with some part exceed the mc but cannot be seen due to mask still take in account)

is that a way to make it just to get the appearence size, which was masked do not take in account when we get _height or _width???


Thanks guys.

Constraining _width And _height?
I have many movie clips. I have a box where they need to fit. Each movie clip is different in size both in width and height. Is there a way to apply a "_width" to the movie clip in ActionScript 2 and constrain the setting to the "_height" (just like in the transform tab has the "constrain" checkbox).

_height And _width Problem
Hi there, I've a attached an fla, pleaz have a look at it, cause I've some diffrent issues:


if I use resize(150, 600) for example there happens something which shouldn't happen. The width keeps shrinking :s


Code:


this.bg._width += Math.round((w - this._width) / speed);
this.bg._height += Math.round((h - this._height) / speed);
is this correct? (have a look at the fla)

Then my second question:
Is there a possibility to make the movements smoother?

Thx anyway grtz flax

TextField._height Problem When Using Img Src
I'm using css and xml content in a textField. I've built a scroller that sets itself based on the textField height (ie its not using lineheight to scroll). I've just started using <img> tags to load various images into the content, and when I retreive textField._height, i'm getting ridiculously high height numbers , which of course is causing the scroller to be inaccurate.

Anyone have this problem / found a solution?

thanks

TextField._height Problem
hey guys, I have a dynamic text field and html on
when i do

Code:

txt.htmlText = "my image: <img src="red.jpg">";

I see the image, but txt._height changes
I have my text field inside a movieclip so the movieclips height changes and thats bad for my project, is there any fix for this?

Can _width Or _height Have -ve Values?
I tried things like changing _width and _xscale. nothing works.
flipping vertically is possible by changing _rotation. but how do i flip the clip horizontally??
please please help

TextField._height = The Devil™
Dear friends/people who would like to prevent the hair on my head from meeting an untimely fate,
I can't tell you the # of times I've had to do this, but I can tell you it's the same # of times that I've given up on trying to solve it...

- textfield on stage (text_txt), height is whatever the default height is for the font size (let's say 16 pixels).
- XML loads, populates the textfield with some crap, and the textfield resizes vertically (let's say to 100 pixels).
- i trace out the height of the textfield (text_txt._height) *or* the height of the text (text_txt.textHeight) but get the default values (16 pixels or whatever). i rage.
- then i try text_txt.watch("text", checkHeight);
- checkHeight basically traces text_txt._height and text_txt.textHeight;
- same results, even though this is happening *after* the textfield's contents have changed! i rage.

my question: how on earth do i get the height of a textfield *after* it has been autosized (presumably this is what .watch above should be giving me?)?!? can this be done w/o resorting to some onEnterFrame madness to watch for an increase in height?

please oh please oh please help.

thanks and a good day to you.

- steve

_height And _width Problem
Hi there, I've a attached an fla, pleaz have a look at it, cause I've some diffrent issues:


if I use resize(150, 600) for example there happens something which shouldn't happen. The width keeps shrinking :s


Code:


this.bg._width += Math.round((w - this._width) / speed);
this.bg._height += Math.round((h - this._height) / speed);
is this correct? (have a look at the fla)

Then my second question:
Is there a possibility to make the movements smoother?

Thx anyway grtz flax

_height In For Loops Oddity
Hi guys

i once got it to work but i can't figure out how.
i blame tiredness atm but a job must be done.

Code:

var items:Array = new Array ("Weddings:
Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext Bodytext", "Portrait engagement", "Portrait child", "Portrait pregnancy", "Portrait headshots", "Portrait family", "Portrait senior", "Commercial", "Modeling portfolio", "Comp card", "Industrial", "Restoration", "Underwater", "Action", "Fine arts", "Manipulation", "Digital", "Black & white", "Color", "Travel", "Web work", "Design", "Photo journalism");
castMenu = function ()
{
   for (var a:Number = 0; a < items.length; a++)
   {
      trace ("a = " + items.length);
      var t = attachMovie ("button", "button" + a, a + 10);
      t.id = a;
      t.txt.autoSize = true;
      t.txt.text = items[a].toUpperCase ();
      t._x = 0;
      /* not sure about this part.   
      t.lineMC._y = t.txt._height + 5;
      t._y = (t.txt._height+10) * a;
      */
      t.onRelease = function ()
      {
         trace ("this is = " + items[this.id]);
      };
   }
};
castMenu ();



so my problem is that the line mc is perfectly 5 pixels under the total height of txt (txt is a straight on dynamic textfield)

but my actual buttons (t) are all jagged up; i'd love them to position
10 pixels underneath the last casted item. how can i best fix this? i am bit stunned atm.i thought autoSize was the trick right, it has multiple lines enabled

i tried putting the lineMc code & autoSize inside the button mc but to no avail.

could anyone point me out here? thank you.

TextField._height Problem
hey guys, I have a dynamic text field and html on
when i do
Code:

txt.htmlText = "my image: <img src="red.jpg">";

I see the image, but txt._height changes
I have my text field inside a movieclip so the movieclips height changes and thats bad for my project, is there any fix for this?

Copyright © 2005-08 www.BigResource.com, All rights reserved