7 posts
  • 7 Years of Membership
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
emphasis
says

Hello guys! I’m having a hard time figuring this out: I can’t find a way to get the original width and height inside a fullscreen site with AS3 .

I googled for it and didn’t find a clue…. it seems impossible :(

Can anyone please help?

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says
I googled for it and didn’t find a clue…. it seems impossible:(
That is true :D

116 posts
  • 8 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Collector Level 2
+2 more
trepn
says

You must wait till the object is placed on the stage before you can get the height.

check the code here

@flashden: plz start supporting code paste!!

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

hmm.. i thought that .. original width & height are the values that are set for width & height from flash cs editor for stage…

you can’t read those values with actionscript…
Same thing with the origin… the coordinate x=0,y=0 starts where the flash finds the first clip in the swf…

7 posts
  • 7 Years of Membership
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
emphasis
says
hmm.. i thought that .. original width & height are the values that are set for width & height from flash cs editor for stage…

you can’t read those values with actionscript…
Same thing with the origin… the coordinate x=0,y=0 starts where the flash finds the first clip in the swf…

you’re right! thats exactly what i wanted…

i tryed the code from trepn but it can only get the boundaries of the added display objects! I’m i doing anything wrong?

It really looks like a dead end…

@Adobe, one more thing to add to christmas-list! :D

116 posts
  • 8 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Collector Level 2
+2 more
trepn
says

why don’t you store the width and height before going into fullscreen?

7 posts
  • 7 Years of Membership
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
emphasis
says

the problem is that my html is loading the swf with 100% for width

116 posts
  • 8 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Collector Level 2
+2 more
trepn
says

Then there is no original stage width. The stage width and height always display the current size. There is no way of retrieving your FLA dimensions, the FLA is only a grahical environment representing your Main Class and childs. The dimensons of the swf alre always defined by the HTML .

212 posts
  • 6 Years of Membership
  • Affiliate Level 4
  • Australia
  • Author Level 6
+7 more
tahadaf
says

Hey guys,

I know this is a two year old thread but as no answer was given, thought to share my finding here. maybe someone can find it useful! :)

objective is to find swf width and height from ActionScript >>

so, imagine you’re loading an swf file dynamically using the flash.display.Loader class:

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.load("your.swf");

    function onLoadComplete(e:Event):void
    {
        trace(loader.loaderInfo.width);
        trace(loader.loaderInfo.height);
        trace(loader.loaderInfo.actionScriptVersion);
        trace(loader.loaderInfo.swfVersion);
    }

As you see, we’re able to find out the AS version and SWF version of the loaded swf file also!

Hadi

1163 posts
  • Affiliate Level 2
  • Author Level 6
  • Collector Level 3
  • Top Monthly Author
+6 more
FlashTang
says

Yes , tahadaf is right
LoaderInfo.width ;)

by
by
by
by
by
by