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








Scaling Using _height _width?


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




ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 06-29-2006, 10:51 AM


View Complete Forum Thread with Replies

Sponsored Links:

_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
_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 & _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
_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
_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
_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
_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 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
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
_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
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
Can't Get _width/_height Of Loaded JPEGs
When I use the loadMovie() function to load a JPEG file into my movie, I'm then unable to get the _height and _width property values of the movie, and yet I can get all other property values such as _x, _y, etc with no problem at all. I can't figure out what the problem is. When I track the new movie clip in the debugger, the debugger lists the _height and _width property values just fine. They are just unavailable from within the reach of ActionScript...

Code:
trace('_visible = ' + getProperty(newjpeg._name,_visible));
trace('_x = ' + getProperty(newjpeg._name,_x));
trace('_y = ' + getProperty(newjpeg._name,_y));
trace('_alpha = ' + getProperty(newjpeg._name,_alpha));
trace('_focusrect = ' + getProperty(newjpeg._name,_focusrect));
trace('_name = ' + getProperty(newjpeg._name,_name));
trace('_height = ' + getProperty(newjpeg._name,_height));
trace('_width = ' + getProperty(newjpeg._name,_width));
trace('_xscale = ' + getProperty(newjpeg._name,_xscale));
trace('_yscale = ' + getProperty(newjpeg._name,_yscale));
trace('_quality = ' + getProperty(newjpeg._name,_quality));
trace('_target = ' + getProperty(newjpeg._name,_target));
trace('_rotation = ' + getProperty(newjpeg._name,_rotation));
trace('_soundbuftime = ' + getProperty(newjpeg._name,_soundbuftime));

This is driving me absolutely crazy, and I need some help before I pull out all my hair. MAN! ActionScript is so freakin' difficult! Why can't I program in Perl, Python, or some kind of useable language within my flash files?!?

Forgive the rant, and please have mercy on a poor, lost soul.

View Replies !    View Related
Giving An MC A Name Then Finding Its _width And _height
here is my code

code:
daTile="gtile";

bgFun = function () {
level = 0;
gtile = bg_mc.attachMovie(daTile, daTile, 0);
var mapWidth = Stage.width/gtile._width;
var mapHeight = Stage.height/gtile._height;
removeMovieClip(gtile);
for (var i = 0; i<mapHeight; ++i) {
for (var j = 0; j<mapWidth; ++j) {
level++;nt = bg_mc.attachMovie(daTile, daTile+level, level);
nt._x = (j*nt._width);
nt._y = (i*nt._height);
}
}
bg_mc._x = bg_mc._y=0;
};

Stage.addListener(bg_mc);



THIS IS WHAT I'M TRYING TO CODE CORRECTLY...

var mapWidth = Stage.width/gtile._width;
var mapHeight = Stage.height/gtile._height;

daTile changes with buttons... so how would i code the gtile text above to be the variable daTile makes?

I know this is a dumb question...
THANKS A MILLION IN ADVANCE,
manny

View Replies !    View Related
_width And _height Of Masked Area Only
I am trying to get the width and height of a movie clip's visible area only, which is masked, however, when I do a trace, I get the entire movie clip's dimensions. Is therea property that will only return the visible area's dimensions of a movie clip?

View Replies !    View Related
_width And _height Properties Of A LoadClip?
Hello again all,

I have a movie clip named movieContainer and i used MovieClipLoader.loadClip to load the image into the movieContainer. It works. however i can't get the _width of the loaded movie? when i trace movieContainer._width (in the onLoadInit function) it returns 0.

Thanks in advance!

View Replies !    View Related
Loaded Jpg's _width _height Properties
Hello!
I have a little question can't find answer for it. When I load pictures into a movie clip, I can test if they are completely loaded using getBytesLoaded and getBytesTotal. But sometimes even if it's completely loaded I cannot get the right _height and _width properties of the container movie it's loaded into. Is there a way that I can get these properties corectly? In other words, how can I make it posible to get these properties, I get 0 or much less now. (How can I know if these properties are available after picture is loaded?).
Thank you for your time and ideas, hope someone can help.

View Replies !    View Related
_width And _height On A Rotated MovieClip
This seems like basic Flash, and I consider myself well versed, but can anyone shed some light on this for me. I have a movieClip rotated 90 degrees and when I set the _width and _height, it's not represented correctly. I realize that I can easily set them prior to rotating it, but I was just curious why this happens. Is it some bug built into Flash early on and has to stick for compatibilty or something? I'm publishing to Flash 7 and it the same in the Flash 8 player. I've attached an example.

Thanks,

- James

View Replies !    View Related
Getting A Loaded Image _width And _height ?
Hello all,

I am creating a photo gallery but i have to resize my loaded images into a certain size after loading them into an empty movie clip on stage.

I am resizing my images now through multiplying the _xscale and _yscale of the empty movie clip after loading the image by a certain coefficient, but this implies that i have to know the loaded image size before knowing the right coefficient to use.

Is their anyway to get the _width and _height of the loaded image or the empty movie clip after loading the image into it, since i am getting a 0 for _height and _width for empty movie clip before and after loading the image.

Thanks

View Replies !    View Related
Image._width/._height Returning 0
I am having a problem with images. I am loading them from XML. No prob. They load, they display. The problem is when I try to get their height or width, it just returns 0.

I've tried using an onEnterFrame that checks if all the bytes are loaded, but it never fires. I must be doing something wrong but I can' figure it out.

here what I have so far for my code:

Code:
function createContent(){
this.createEmptyMovieClip("mainContent",this.getNextHighestDepth());
mainContent.createEmptyMovieClip("imgHolder",mainContent.getNextHighestDepth());
mainContent.createTextField("mainTxt",mainContent.getNextHighestDepth(),0,0,300,400);
mainContent.imgHolder.loadMovie(contentXML.firstChild.childNodes[0].attributes.i);
mainContent.mainTxt.text = contentXML.firstChild.childNodes[0].attributes.t;
mainContent.imgHolder._x = 100;
mainContent.imgHolder._y = 15
mainContent.mainTxt._x = mainContent.imgHolder._x + mainContent.imgHolder._width + 50;
mainContent.mainTxt._y = 15;
mainContent.mainTxt.wordWrap = true;
trace(mainContent.imgHolder._height);
}
As you can see I'm simply creating some clips and filling one with a pic and the other with some text both take from XML. The xml is working because it loads the text and image. It's just when I try to get the height or width of the loaded image that I encounter a problem.

Any help would be very useful since I have this problem across a few files I am working on at the moment.

View Replies !    View Related
Adjust _width, _height, _x And _y Dynamically
Ok I'm perplexed...

I'm trying to adjust the above mentioned properties of a simple movie clip. It just contains a fill and I'm using it as a mask. I can't get it to change it's dimensions or position:


actionscript Code:






Original
- actionscript Code





tile_diff = (200 - _root.city.map_tile_size);

trace("Mask _X = " + _root.maskClip._x);
trace("Mask _Y = " + _root.maskClip._y);

trace("Mask _width = " + _root.maskClip._width);
trace("Mask _height = " + _root.maskClip._height);

// Adjust mask
_root.maskClip._x += tileDiff;
_root.maskClip._y -= tileDiff;

_root.maskClip._width -= (tileDiff * 2);
_root.maskClip._height -= (tileDiff * 2);

trace("Mask _X = " + _root.maskClip._x);
trace("Mask _Y = " + _root.maskClip._y);

trace("Mask _width = " + _root.maskClip._width);
trace("Mask _height = " + _root.maskClip._height);

/*
Displays:

Mask _X = 19
Mask _Y = 41
Mask _width = 397
Mask _height = 397

Mask _X = 19
Mask _Y = 41
Mask _width = 397
Mask _height = 397

*/






 tile_diff = (200 - _root.city.map_tile_size);                trace("Mask _X = " + _root.maskClip._x);trace("Mask _Y = " + _root.maskClip._y);                trace("Mask _width = " + _root.maskClip._width);trace("Mask _height = " + _root.maskClip._height);                // Adjust mask_root.maskClip._x += tileDiff;_root.maskClip._y -= tileDiff;                _root.maskClip._width -= (tileDiff * 2);_root.maskClip._height -= (tileDiff * 2);            trace("Mask _X = " + _root.maskClip._x);trace("Mask _Y = " + _root.maskClip._y);                trace("Mask _width = " + _root.maskClip._width);trace("Mask _height = " + _root.maskClip._height); /*   Displays:Mask _X = 19Mask _Y = 41Mask _width = 397Mask _height = 397Mask _X = 19Mask _Y = 41Mask _width = 397Mask _height = 397*/



The Help indicates that _width and _height are read-only but I'm sure I could change them at some time. _x and _y can definitely be changed. Hmm.

View Replies !    View Related
._width ._height Newly Loaded JPGs
I've been having some problems with newly loaded jpgs. They load fine to the screen. But when I assign their ._width, and ._height, they start acting weird. They wont resize right most of the time, and sometimes they wont even appear (their height is set to 0, or their width). I'm assigning them the following values.

LoadingMovie._width = 128;
LoadingMovie._height = 85;

If I do one, or the other, it works more frequent then having both. But every once and a while, it is still being set to 0.

I tried assigning the values right after it was finished loading, and every frame to see if it was a matter of scope/timing. Nothing.

I also tried the following code:

LoadingMovie._xscale = (128 / LoadingMovie._width) * 100;
LoadingMovie._yscale = (85 / LoadingMovie._height) * 100;

Any help would be greatly appreciated.

Thanks in advance.

View Replies !    View Related
_width & _height Make MC's Wrong Size
This is completely doing my head in, brain's about to burst..

I'm trying to do a simple (i thought) animation, with a panel scaling down from the top of the movie to the bottom using actionscript in MX.

I have my MC (simply a box, w770xh550) sitting in the main timeline. It fills the full movie (770x550).

So I click it and add this code :

onClipEvent (load) {
setProperty(this,_height,0);
}

Which makes it invisible on loading.

Then I go into the MC and create a new layer above the box and add this script to the frame :

accel = 0;
speed = 10;
this.onEnterFrame = function () {
if(this._height<550){
this._yscale += speed+accel;
accel += 5;
}
}

Which makes it grow downwards across the page. The "accel" variable makes it increase in speed (easing out almost). K, this all works fine.

But if I try the same trick on a smaller bar (my nav bar - 770x15)moving in from the left BUT slower, using this code :

accel = 0;
speed = 5;

// Note the speed change.

this.onEnterFrame = function () {
if(this._width<770){
this._xscale += speed+accel;
accel += 5;
}
}

The nav bar ends up 855px wide..? Anyone got any ideas why?

I've tried using this._width += speed+accel; instead of this_xscale += speed+accel;. But this produces the same problem, all be it at a different length - 808 or so instead of 855.

Is there a full proof way to animate and scale something to an exact pixel size? Or is it easier to just script a mask across the page to simulate the actual scaling?

I'll post the fla if u need it..

View Replies !    View Related
Crop Image And Reflect The New _width & _height.
After searching the boards, I'm not so sure that this is possible... but I thought I'd ask anyway!

So I have a movieclip named "mainclip". The _width is 50, and the _height is 100.

Within it is a picture on layer 1, and a mask layer above that. When I shrink the size of the mask layer, the _width and _height of "mainclip" remain the same, even though most of the picture inside is now invisible.

Is there a way to make the _width of the "mainclip" be identical to the mask and forget about what we cant see? If not with a mask, can it be done a different way?

Thanks!
Ralgoth <- a newb of many sorts

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

View Replies !    View Related
Trouble Getting/using _width/_height Of A Loaded Jpeg
Hi,

I'm having trouble getting the _width & _height of a jpeg loaded using loadMovie.

I'm trying to reposition it (pseudo-registration point) for rotation in a container movie clip.

If I use hard-coded numbers, it works fine. However, if I try to position it based on its _width and _height properties, it's no go... in fact, it doesn't even show up on stage.

Are there problems getting those properties from loadMovie clips?

View Replies !    View Related
_width And _height Not Working After LoadMovie Command
i'm working on a map file and i have several different maps that can be loaded into my file by clicking tabs

they're loaded as external .swf files via the loadMovie command

when i have a static map as a part of my .fla the controls work fine ... pan, zoom etc.

when i perform the loadMovie and the map changes ... suddenly my bounds are no longer respected by the pan function's limits

it's like it removes the width and height ... but if the w and h were 0 i would think the pan functions would not work at all so it must be something else

anyone have any ideas?

View Replies !    View Related
Detecting _width / _height Of Loaded Image
MX04

Is there a way to detect the _height and _width of a incoming image?

I'm going through a loop, duplicating movie clips with mask, loading an image, and squeezing it down to 100 x 100 for thumbnails. The client wants the thumbnails to be actual proportions but I used so many tweens and setup functions based on the 100 pixel width it's going to be a nightmare.

Thanks!

Aaron

View Replies !    View Related
HitTest Only The Content Of Movieclip And Not From 0,0 To _width, _height?
Hey guys

This is probably just a brainfart but when I publish the code below, my hitTest is triggered by the entire movieclip from 0,0 to _width, _height and not by it’s content.

The “fwa” movieclip contains some txt that I broke apart, and I only want the hitTest to run when the “mc” hits the txt within the “fwa” movieclip!




ActionScript Code:
var i:Number = 0;var count:Number = 0;var colorArr = ["0x99cc33", "0xff0066", "0xffcc00", "0x33ccff"];this.onEnterFrame = function(){        mc = this.createEmptyMovieClip("mc"+i, this.getNextHighestDepth());    mc.attachMovie("circle", "circle", mc.getNextHighestDepth());    mc._x = Math.random()*Stage.width;    mc._y = Math.random()*Stage.height;    mc._xscale = mc._yscale = Math.random()*150;    mc._alpha = 20+Math.random()*80;        var my_color:Color = new Color(mc);        if(mc.hitTest(fwa))    {        my_color.setRGB(0xFFFFFF);    }    else    {        my_color.setRGB(colorArr[count]);    }    count++;    i++        if(count == colorArr.length){ count = 0 }    }




Hope somebody can give me a hint here

View Replies !    View Related
Trouble Getting/using _width/_height Of A Loaded Jpeg
Hi,

I'm having trouble getting the _width & _height of a jpeg loaded using loadMovie.

I'm trying to reposition it (pseudo-registration point) for rotation in a container movie clip.

If I use hard-coded numbers, it works fine. However, if I try to position it based on its _width and _height properties, it's no go... in fact, it doesn't even show up on stage.

Are there problems getting those properties from loadMovie clips?

View Replies !    View Related
_width & _height VS. _xscale & _yscale - The Wierdness Continues
Hi,

I had a problem which I've just "fixed" (quotes used for emphasis as I have NO idea why the "fix" works!).
I found a whole bunch of similar threads but none exactly like the issue I was facing.

I'm working on a class which creates a TextField within a container MovieClip. The class has an Object called destination which store's "destination" properties of the MovieClip - _x, _y, _height, _width, _rotation etc.
The class also has a function called resetState() which copies all the properties in the destination object to the MovieClip (thus reseting the MovieClip's state to that of the destination object).

Everything worked fine. I'd set destination._x to 200, call resetState() and as expected the MovieClip's _x property would be set to 200.
However, if I set destination._height or destination._width and call resetState() nothing happens!?!
After much hair pulling I tried destination._yscale = 200 and magically the MovieClip's _yscale property changed to 200!

Now, here's the really strange part. Below is the code for resetState() all pretty simple stuff:


Code:
public function resetCurrentState() {
for( var prop in _dest)
_mc[prop] = _dest[prop];
}
And here is how I got resetState() to change the MovieClip's _width and _height:


Code:
public function resetCurrentState() {
for( var prop in _dest)
_mc[prop] = _dest[prop];

_mc._width = _dest._width;
_mc._height = _dest._height;
}


I understand that loading dynamic data (images/MovieClips etc.) can cause a similar problem if time is not allowed for the data to be fully loaded, however this is a simple MovieClip with no external data used - hell I'm not even trying to access the _width and _height property's until some time after the MovieClip has been created!?

If anyone has any idea's as to why the _width and _height propertys have to be implicitly set I'd really like know!


:theory

View Replies !    View Related
Setting _height And _width Kills My Loaded Image
I have a clip with nothing in it nest inside another movie clip.

In the first frame of the outer movie clip I have the line:

loadedMovie.loadMovie("pictures/picture.png");
loadedMovie._x = 20;
loadedMovie._y = 20;

This works. However, when I try to set the height and width...

loadedMovie._width = 500;
loadedMovie._height = 500;

The image disappears.

It does this because it tries to set the height and width before the movie is loaded (height and width changes fine if I put it in a button). Does anyone know a work around for this?

View Replies !    View Related
_height And _width Values Of Newly Loaded Jpeg's
hello.
Im loading a jpeg into a blank MC, but if I try to determine the _height and _width of that jpeg after (getBytesLoaded() == getBytesTotal() ) value returned for both is 0... except for a couple MC, for which it returns the correct value.
So thinking that there's a small time delay while the flash player determines the size of new data I added a timeout mechanism but most clips still dont return the new _height and _width values even if I set the timeout to more than a sec, which should be enough time.
Can anyone point me in the right direction?
Thanks

View Replies !    View Related
How To Receive The Original _width And _height Of An External Image
Hello,
When i load an external image (.jpg) how can i trace the original height and width of
this image?

I already made a MoveiClip loader, so i can fire a function when the image is loaded completely.
But i don't know how to get this value of the original image size, because i placed this
image in a container_mc.

Does someone know how ?

Regards,
Micheal

View Replies !    View Related
No Resize/scaling A Movie Clip On The Scaling Stage...
I know this has probably been answered here already, but I've search through all the threads with "scaling" and "resizing" and can't find the solution.

Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.

I think I need to add a listener of some sort to the stage, but I'm not sure how to do this. If you can point me to a thread where this has already been answered, great! Otherwise I would be grateful for any help you could provide here.

View Replies !    View Related
Scaling Images In Flash To The Scaling Of The Browser Window - Anyone?
Does anyone know how they are scaling these images to the size of the browser window but keeping all of the graphics the same scale?

Check out the portfolio section of this site to see what I mean.

Any Help??

http://www.paprika.com/

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
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
_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
[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
[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
Scaling Dynamic Textfield Without Scaling Font
the titel sys it...
if you create a dynamic textfield...you drag it but you can not see the prcise idth value...so lets say i have a field and the width is 198,5 and i want it to be 200...the problem is if you scale...the fonts also scale...any ideas...

View Replies !    View Related
[9-slice Scaling] Not Scaling At Correct Size ?
Hi people,

I found something strange with the 9-slice scaling option.
My MC with that option is simply smaller than the one without it !
You can see an example here (fla in attachement).
with the simple code on the green button :

Code:
on (release) {
_root.i += 10;
this.scroller._height = _root.i; // the left one with 9ss
this.bar._height = _root.i; // the right one without 9ss
}
Does someone have any explanation ?

thanks

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
Copyright © 2005-08 www.BigResource.com, All rights reserved