simple flash problem
- Started
- Last post
- 7 Responses
- nRIK
hey, this may be a really simple problem, but i cant seem to get it.
my problem is, trying to get the height of an image, after loading it into a MC.. ive tried everything but nothing.. heres the source:
http://pastebin.coconut.se/?id=4…
help is much appreciated, thanks,
- randoman0
My first question would be, are you loading the images externally? If so, they have to finish loading before you can determine the _height and _width properties.
u might want to do something where it sets the visibility and location once the MC has finished loading it's data so you have sccess to the height property.
- nRIK0
yes they are externally loaded, hence the loadMovie
it just grabs say "image1.jpg" from the array, then loads
so how would i need to modify that code to set the _height?
would i need like a for loop to keep checking until the mc has loaded?
im sure its something simple but i just cant figure it out [im also very tired/sick atm] :(
- caseyc0
Try this:
http://pastebin.coconut.se/?id=4…
You have to wait until the image has been loaded to get it's proper _height. The code I posted will loop over all of your loading images and position them when they are done.
One thing to note, I'm guessing your images are all the same height? If they are not your "mc._height * i" is not going to work right.
Cheers,
- nRIK0
awesome thanks caseyc :D
learning new things everyday hehe
yea they are going to be the same height, but im just testing now for varying heights, would this be ok? it doesnt seem to work too well:
http://pastebin.coconut.se/?id=4…
(down the bottom)
- nRIK0
woops i think i see the problem there
- caseyc0
Hey, I posted a solution for varying heights:
- honda0
OT, but that's a cool site bro. Good resource tool you got there.