This content has been marked as final. Show 4 replies
not with as2. you can find the maximum dimensions used by graphic assets throughout the loaded swf's timeline (not just those on frame 1), but if there's nothing on-stage in any main timeline frame, the loaded swf's width and height will be reported as zero.
thanks kglad. I had pored over everything I could find and couldn't think of another way to do it, so its reassuring (although disappointing) to hear that there is none.
I just used frame1 because the 'player' prevents the loaded clip from playing unless someone clicked..so its in a 'pause' state on frame one.
Out of curiosity what is the method to check the dimensions of an arbitrary frame... can you do that without moving the clips playhead or do you just move the playhead and then check _width and _height, then move it back again for example?
and when you say 'not with as2' I presume that means you can with as3? I really need to start working in as3. thanks again.
to check the dimensions of the frame with the largest bounding rectangle you can use the code below. and yes, you must move the playhead to find it.
and yes, in as3 you can determine the stage dimensions using stageHeight and stageWidth properties of the stage class.
Thanks again. Its good to know that approach for measuring a clip if I ever need it.
I guess I'll have to check out the as3 option. I just had a quick look at the docs.
The livedocs suggest otherwise (that all stage properties - even for loaded swfs- refer to the main Stage object or to null if they are not in the display list). What I was hoping for was some property related to the original dimensions of the stage when the swf was published. But I know for a fact that all the as2 documentation is not always correct and I haven't tried it in as3 yet, so I will.
I found an encouraging comment at the bottom of the livedocs page for "Stage" in as3. If the docs are correct for Stage, then LoaderInfo width and height properties look promising for what I want to do.