|
|
| [ActionScript] haXe: Scaling External Image to Fit? |
|
Billybob
Member #3,136
January 2003
|
I'm loading an external image into a new, empty MovieClip and it isn't scaling to fit the size of the flash player.
I've tried and tried to get it to scale by setting xscale and width and so forth, but every time I do the image just disappears. Any ideas? Thank you. EDIT: Setting the scale works (apparently it's 50 == 50% instead of 0.5), but I don't know the size of the image to begin with so I can't scale it properly.
|
|
bamccaig
Member #7,536
July 2006
|
Why do you need to know the size of the image to scale it? ** EDIT ** Without knowing exactly what I'm looking for I found this post* on another forum that claims to know how to get image dimensions... SteveMania@forums.macrumors.com said: I know this is an old thread, but I am sick of reading posts that i personally want answers for and there not being one after all of that reading! Below is how you should load images and gain access to their height/width and so on... The answer is onLoadInit(); onLoadComplete will not work because all of the variables and things are not initialized until the onLoadInit(); Hope this saves someone some time! Use the MovieClipLoader object (with a Listener):
- Source ** EDIT ** I didn't get a chance to read through it, but this (Flash MX) or this (Flash MX 2004/8) might help as well. * I formatted the code for readability and prettiness. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
|