7 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
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?

3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 more
wickedpixel says
I googled for it and didn’t find a clue…. it seems impossible:(
That is true :D

116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Netherlands
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
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!!

3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Netherlands
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
trepn says

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

7 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
emphasis says

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

116 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Netherlands
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
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 .

205 posts
  • Australia
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 5-6 years
  • Most Wanted Bounty Winner
  • Referred between 100 and 199 users
+1 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

1160 posts
  • Author had a File in an Envato Bundle
  • Has been a member for 4-5 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
FlashTang says

Yes , tahadaf is right
LoaderInfo.width ;)

by
by
by
by
by
by