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








How To Get Correct _height Value, Without The Hidden Mask Part


I have a movieclip, which I want to keep central on the screen. however, part of it is hidden using a mask, but it still includes the hidden bit in the _height reference.

Is there a variable that does not include the masked area, or am I just clutching at straws?

to see what I mean, look at this : http://toddish.co.uk/beta. notice how it is fine before the thumbnails load, then changes once you move the screen (as it is higher).




SitePoint > Design Your Site > Flash and Actionscript
Posted on: Sep 29, 2008, 04:17


View Complete Forum Thread with Replies

Sponsored Links:

[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 !

View Replies !    View Related
Actionscripted MC Hidden By Mask
I'm having a problem with a web header I am working on and need some help. I have an actionscript and movie clips set to make random rainfall. I have 1 movie clip (Rain drops) for the falling rain and splash, another one (Rain drops ripple) for the ripple effect and a third (Rain script) that has just the actionscript. The scene has 3 copies of the Rain drops MC. The script causes the 3 rain drops to spawn at different spots, fall then it links to the ripple MC to ripple at the end. I have some text that needs to go in the foreground with the rain splashing behind but I can't seem to get it to work. The rain always falls and splashes on top of the text. I have tried using mask layers and the .setMask command but that doesn't work or gives me an error when tested. Any help would be greatly appreciated.

*Rain script AS*

ActionScript Code:
//
for (i=0; i<2; i++) {
   
    n = Number(n)+1;
    drop1 = "raindrop1" add n;
    duplicateMovieClip("../:raindrop1", drop1, n);
    setProperty("_root." add drop1, _x, random(900));
    setProperty("_root." add drop1, _y, random(20)-175);
}
n = Number(n)+1;
drop2 = "raindrop2" add n;
duplicateMovieClip("_root.raindrop2", drop2, n);
setProperty("_root." add drop2, _x, random(900));
setProperty("_root." add drop2, _y, ((random(58))+300)*-1);
n = Number(n)+1;
drop3 = "raindrop3" add n;
duplicateMovieClip("../:raindrop3", drop3, n);
setProperty("_root." add drop3, _x, random(900));
setProperty("_root." add drop3, _y, (random(34) + 600)*-1);
//

*Rain drop AS*

ActionScript Code:
//
removeMovieClip("");
stop();
//

*Frame 1 AS*

ActionScript Code:
//
ifFrameLoaded (3) {
    gotoAndStop(3);
}
//

*Frame 2 AS*

ActionScript Code:
//
gotoAndPlay(1);
//

*Frame 3 AS*

ActionScript Code:
//
stop();
//

View Replies !    View Related
Mask Not Masking In The Correct Shape
I have a mask that is a borderles circle that expands that I'd like to use for a ripple effect. The way the mask showes up though is a filled circle that expands. Can someone take a look at my .fla and tell me what I'm doing wrong?
http://www.goatsgotohell.com/gnux/mask.fla

View Replies !    View Related
Bloody 'Ell What Part Of MASK Isn't Clear?
OK. So I have the following problem.

Up until tonight, I'd never done a mask in my life. I wanted to do a simple green-to-black radial gradient on a black background, pulsing inside the word "loading."

Following the tutorial in the Flash manual, I created three layers. One would house the green gradient, one would have the black background, and the third would hold the words "loading" in 45-point Papyrus.

I finished all the simple graphics, realized as symbols to simplify motion tweening. I added everything to layers, and properly attached them as masks. They showed up as masks. They tested in Flash as masks, looking just fine, but the minute I exported them to test the scene, it utterly forgot that masking existed. I got a big black blob with a green pulse in the middle, but no letters. The Mask layer had seemingly dropped off the face of the earth somewhere between my testing in-program and the export phase. Got any idea what might cause this? I've tried every which way, and it just ignores me.

View Replies !    View Related
Display Part Of Loaded Image (crop/resize Without Mask)
Ok. My first thread... Hope someone can help.

I'm trying to display thumbnails in an image gallery. The new thumbs I create are 37x37 pixels large and I load these dynamically into the movie using loadMovie().

I would like to be able to use the thumbs I've created for previous galleries (larger non-square thumbs). I know how to resize the thumbs to fit the area (37x37) but I don't want them to get stretched or squeezed. I would simply like to show the part of these thumbs that fits within the area.

I know I could use a mask of 37x37 pixels and apply it to the thumb but I would like to avoid this as I have a lot going on... Anyone know an easy/another way to do this?

/erik

View Replies !    View Related
Is It Possible To Use A Mask To Show Part Of Movie ? In Other Movie ?
is it possible to use a mask to show a part of a movie in another movie ?
like dragging the mask above a a certain movie and it takes like a mini screenshot and displays it on an other part..

a perfect example would be like say you have a magnifier movie and the part where the glass is shows a zoomed view in another
part of a movie somewhere else on the stage

View Replies !    View Related
Loop One Part Of A Movie For Ever And Stop Another Part
does anybody know how to make a bit of my flash movie loop continously but another bit of it stops

View Replies !    View Related
Play 1st Part, Preload 2nd Part, Play 2nd Part: Possible?
I've recently started with Flash development and I was wondering if the following was possible using only one Flash file?

- The first part is shown and the user can click a button here to continue.
- When he clicks the button, a preloader part is shown and the rest of the file is loaded.
- When it's done, the rest is shown.

I already have the parts seperated in movieclips and unchecked the "export in first frame" option on the movieclips for the second part, but that doesn't help.

If this isn't possible, how should I go about it then? Should I use a second .swf which I load with a loadMovie statement?

View Replies !    View Related
Trigger A Button In Work Part Of The Movie From Another Part Of The Movie
i did know how to do this but since forgot

i have my bav bar mc with all the button to load relevent sections
THe code for the buttons are on a keyframe

ActionScript Code:
b1.onRelease = function() {
    _root.win1._alpha = 0;
    _root.win1.loadMovie("blog.swf");
    _root.win1._x = 0;
    _root.win1._y = 25;
    ov1.gotoAndStop(15);
    b1.enabled = false;
    //
};
In the past i was abe to trigger this from elsewhere in my movie but i have since forgot how to do it. i did scan the help files but couldnt find anything of any relevenace.

Thanks for any help.
Paul

View Replies !    View Related
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

View Replies !    View Related
_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

View Replies !    View Related
_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

View Replies !    View Related
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

View Replies !    View Related
_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.

View Replies !    View Related
_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();
}

View Replies !    View Related
_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.

View Replies !    View Related
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

View Replies !    View Related
[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();
}

}

View Replies !    View Related
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("

View Replies !    View Related
_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.

View Replies !    View Related
_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?

View Replies !    View Related
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!

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
_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

View Replies !    View Related
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

View Replies !    View Related
_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.

View Replies !    View Related
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.

View Replies !    View Related
_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

View Replies !    View Related
_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!!

View Replies !    View Related
[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.

View Replies !    View Related
Scaling Using _height _width?
Whats the best way of scaling the _height and _width of a movieClip??

View Replies !    View Related
_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!

View Replies !    View Related
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?

View Replies !    View Related
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);

View Replies !    View Related
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

View Replies !    View Related
_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.

View Replies !    View Related
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).

View Replies !    View Related
_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?
Cheers







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

View Replies !    View Related
_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

View Replies !    View Related
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

View Replies !    View Related
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?

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
_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

View Replies !    View Related
_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.

View Replies !    View Related
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?

View Replies !    View Related
LoadMovie _width And _height Problems
Been struggling with this for too long now...

I have newmovie.swf (1438px x 975px) that I loadMovie in to a target (mcTarget) that is 555px x 400px.

I use the code below in an attempt to resize newmovie.swf so all it's contents are visible and contained in mcTarget (555px x 400px).

wInit = mcTarget._width; // 555
hInit = mcTarget._height; // 400
xInit = mcTarget._x - (mcTarget._width / 2);
yInit = mcTarget._y - (mcTarget._height / 2);

/****
tried putting loadMovie in it's own statement block (if (true)) so it's width and height properties are accesible directly below - this doesn't seem to help however
****/
if (true) {
mcTarget.loadMovie("newmovie.swf");
// loadMovie("newmovie.swf", "mcTarget"); <-- same results
}

/****
I also tried putting the code below in the next frame with the same results
****/
mcTarget._x = xInit; // this works
mcTarget._y = yInit; // this works
mcTarget._width = wInit; // this does not
mcTarget._height = hInit; // this does not

What I end up with is newmovie.swf being loaded in to mcTarget, but it's width and height retain their original values (in that their width and height appear on-screen to be 1438x975). However, if I trace _width and _height, Flash tells me they're 555 and 440 respectively.

I hope I explained this enough.

Anyone have any ideas on this?

Thanks

View Replies !    View Related
_width And _height Of Loaded Movies
Let's try a different tack. Is it possible to discover the height and width of an swf loaded into and empty dummy movie clip using:

dummy.loadMovie("example.swf");

When I try dummy._width and dummy._height they are both set to zero. Is that just the way it is or can I get round it?

View Replies !    View Related
Problem GetProperty _width _height
I am loading autogenerated pictures(swf) into a flashmovie. Their size can vary, so I have to rescale them. To get the dimentions I do this:

orgw = getProperty (loadname, _width);
orgh = getProperty (loadname, _height);

loadname contains name of clip

Works ok in plugin 4 with all properties except width and height! Works in 5.

Can anybody please help me?

View Replies !    View Related
Problem W. _width/_height Of Ext. Loaded Swf
hi i load a swf from inside a movie and want to place it within the mainmovie according to its size(_height).

for (m=0; m<myArray2.length; m++) {
if (myArray2[m][0].substr(0, 1) == "0") {
if (myArray2[m][0] == "01" && a<="6") {
_root.admin.modul01.duplicateMovieClip("00"+a, 100-m*2);
mennam1 = "00"+a;
_root.admin[mennam1].loadMovie(myArray2[m][1]+".swf");

wid1 = _root.admin[mennam1].object.wid;
hig1 = _root.admin[mennam1].object.hei;

_root.admin[mennam1]._y = _root.admin[oldnam1]._y-hig1-55;

Widthin the external SWF i have the following function to make sure i allways get the right size where .object is the main grafic that contains everything inside the cip

onClipEvent (enterFrame) {
_parent.wid = this._width;
_parent._parent.wid = this._width;
hei = this._height;
}

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved