7 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says
I googled for it and didn’t find a clue…. it seems impossible:(
That is true :D

116 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 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
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
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
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
trepn says

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

7 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
emphasis says

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

116 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+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 .

210 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 100+ members
  • Located in Australia
  • Has sold $40,000+ on Envato Market
+6 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

1161 posts
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Had an item featured in an Envato Bundle
+4 more
FlashTang says

Yes , tahadaf is right
LoaderInfo.width ;)

by
by
by
by
by
by