Groups | Blog | Home
all groups > flash (macromedia) > march 2006 >

flash (macromedia) : loader component sizing problem



athomas32
3/20/2006 10:12:19 PM
I am using the loader component to show images that are read in from an xml
file. the xml file has the width and height that the image needs to be set at.
I have used the setSize parameter to read in the width and height. When i trace
this it shows the correct numbers, but when i run the swf file it is not
showing the correct size. here is an example of what i am doing:

var obj:Object = createClassObject(mx.controls.Loader,"obj"+Cnt,Cnt+100);
objHeight = chNode.attributes.Height;
obj.setSize(chNode.attributes.Width, objHeight);
trace("width of the image: " + obj.width);
trace("height of the image: " + obj.height);
obj._x = chNode.attributes.X;
var TopAdjust = new Number(chNode.attributes.Y) + topOffSet;
obj._y = TopAdjust;
obj.scaleContent = true;
obj.contentPath = chNode.firstChild.attributes.FileName;


obj.scaleContent = true; - i have tried this as true and false, i believe
that true is what i want it to do. but it is just so small.

Does anyone have any ideas on this.
athomas32
3/20/2006 11:58:51 PM
update to my problem:

the loader is sizing my images with the correct width, but then it is
adjusting the height so it is constrained with the width. If i put in a width
and height of 400 by 400. it will size the width to 400 and make the height
what ever size so it looks the same as the original image.

so there must be some kind of restraint on the loader. PLEASE HELP i am going
crazy here.
Jim Foy
6/6/2006 3:38:52 PM
I believe that there is a problem with the Loader class. It's nothing you are
doing wrong, it has to do with the number of tries the class takes to check for
the complete event, I think. Someone came up with a fix by writing a new class
file that allows you to change the number of tries flash takes to find it.
Personally, I'd like to see Adobe fix this. It's a huge problem for my company
on lots of our projects. :(
AddThis Social Bookmark Button