Thanks Matt, I understand I can work out the height manually but I'm trying to write a function into the main stage that can read the height of any child swf. The names and locations may vary so its not that attractive of a solution. There has to be some way of reading the bounds. Like in as2, if you create an empty movieclip, then attach another 20x20 clip to it at a y of 10, that new movieclips height comes back as 30. I'll be seriously pissed to find out adobe dropped yet another useful feature with as3.
On Sun, Jan 25, 2009 at 1:51 PM, Matt Gitchell <m...@moonbootmedia.com>wrote: > It measures the height of the actual content. > You'd have to have something onstage at (0,0) for it to start measuring > there. > > If you need it, write something that retrieves the Y value of the item plus > the item's height, where item is the DisplayObject in the loaded SWF. > > var functionalHeight:Number = item.y + item.height; > > --Matt > > On Sun, Jan 25, 2009 at 10:30 AM, Joel Stransky <j...@stranskydesign.com > >wrote: > > > *height not right* > > ------------------------------ > > Create two .fla's called SizeParent.fla and SizeChild.fla. > > In SizeChild draw a square of 20x20 and set it's y to 10. > > > > Publish SizeChild.swf and place this code on frame 1 in SizeParent > > Code: > > > > import flash.display.*; > > import flash.events.*; > > import flash.net.URLRequest; > > var l:Loader = new Loader(); > > l.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); > > l.load(new URLRequest("SizeChild.swf")); > > > > function onComplete(e:Event):void{ > > addChild(l); > > trace(l.content.height); > > } > > > > > > Shouldn't height be 30? I keep getting 20. > > > > What gives? > > > > > > -- > > --Joel Stransky > > stranskydesign.com > > _______________________________________________ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- --Joel Stransky stranskydesign.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders