# Image width and height

**URL:** <https://forum.kirupa.com/t/image-width-and-height/119183>\
**Category:** Uncategorized\
**Created:** [August 12, 2004, 5:35am UTC](https://forum.kirupa.com/t/image-width-and-height/119183 "2004-08-12T05:35:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmd](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cmd](https://forum.kirupa.com/u/cmd)\
**Post date:** [August 12, 2004, 5:35am UTC](https://forum.kirupa.com/t/image-width-and-height/119183/1 "2004-08-12T05:35:09Z")

</div>

hello,

is there a way to get a jpg’s image and height (before dynamically loaded) within flash? the only way i could do it was to load the image into a containerMC, but i would like to do it before the image loads. the only other way i could think of was to send the image link to a php script and returning its height/width to flash.

thanks,  
chris

---

<div class="post-metadata">

**Author:** ![ViNc3](https://avatars.discourse-cdn.com/v4/letter/v/b487fb/32.png) [@ViNc3](https://forum.kirupa.com/u/ViNc3)\
**Post date:** [August 12, 2004, 12:22pm UTC](https://forum.kirupa.com/t/image-width-and-height/119183/2 "2004-08-12T12:22:09Z")

</div>

You can always check the dimentions in Windows Explorer (if you’re using windows of course)

---

<div class="post-metadata">

**Author:** ![cmd](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cmd](https://forum.kirupa.com/u/cmd)\
**Post date:** [August 12, 2004, 6:34pm UTC](https://forum.kirupa.com/t/image-width-and-height/119183/3 "2004-08-12T18:34:55Z")

</div>

i can also do that in photoshop or fireworks, but that’s not what i meant, i meant if i could get the dimensions within flash without loading them first into a container. storing the info in xml or getting dimensions through php could do it, but is there another way within flash?

chris

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 12, 2004, 7:35pm UTC](https://forum.kirupa.com/t/image-width-and-height/119183/4 "2004-08-12T19:35:35Z")

</div>

> [@cmd](#):
>
> i can also do that in photoshop or fireworks, but that’s not what i meant, i meant if i could get the dimensions within flash without loading them first into a container. storing the info in xml or getting dimensions through php could do it, but is there another way within flash?
> 
> chris

Sorry Chris but i don`t have any answers either. What i did when this was necessary was just put the names/dimensions in a textfile.  
in textfile/  
var1=movie1%2Eswf%2C220%2C120%7Cmovie2%2Eswf%2C120%2C220%7Cmovie3%2Eswf%2C220%2C220%7Cmovie4%2Eswf%2C330%2C260%7Cmovie5%2Eswf%2C420%2C340%7Cmovie6%2Eswf%2C170%2C120

inflash/  
lv = new LoadVars();  
lv.onLoad = function() {  
arr1 = lv.var1.split(“|”);  
for (var n = 0; n != arr1.length; n++) {  
arr1[n] = arr1[n].split(“,”);  
}  
};  
lv.load(“mytext.txt”);

output/  
Variable \_level0.arr1 = [object #6, class ‘Array’] [  
0:[object #7, class ‘Array’] [  
0:“movie1.swf”,  
1:“220”,  
2:“120”  
],  
1:[object #8, class ‘Array’] [  
0:“movie2.swf”,  
1:“120”,  
2:“220”  
],  
2:[object #9, class ‘Array’] [  
0:“movie3.swf”,  
1:“220”,  
2:“220”  
],  
3:[object #10, class ‘Array’] [  
0:“movie4.swf”,  
1:“330”,  
2:“260”  
],  
4:[object #11, class ‘Array’] [  
0:“movie5.swf”,  
1:“420”,  
2:“340”  
],  
5:[object #12, class ‘Array’] [  
0:“movie6.swf”,  
1:“170”,  
2:“120”  
]  
]

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [August 12, 2004, 7:39pm UTC](https://forum.kirupa.com/t/image-width-and-height/119183/5 "2004-08-12T19:39:12Z")

</div>

There’s no way in Flash, except for retrieving the dimensions **after** the pic is fully loaded…

scotty(-:

---

<div class="post-metadata">

**Author:** ![cmd](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cmd](https://forum.kirupa.com/u/cmd)\
**Post date:** [August 13, 2004, 12:19am UTC](https://forum.kirupa.com/t/image-width-and-height/119183/6 "2004-08-13T00:19:18Z")

</div>

stringy: i’m gonna have to do it your way, im just gonna add some info in the xml file i am reading from.

scotty: yah i was afraid of that, ah well a few extra lines of code won’t hurt.

chris
