This content has been marked as final. Show 4 replies
Why would you want to avoid using a preloader? You are correct you need to wait until the image is fully loaded before you can setMask(); And a preloader is the way to go.
If you are using Flash 7 or higher, you could look into using the MovieClipLoader class instead of loadMovie(); In that case you would use the onLoadInit event to do your setMask(); Simple as pie, really!
Thanks Rothrock... I'll try that. I've gotta' get up on the listener action. The reason i'm trying to avoid a preloader is because this is going to be a kiosk-like application and being the designer I am, I just want the image to 'pop' in place- my preference really on this one.
I think you are sort of misunderstanding the nature of what a preloader is. It is just some code that makes sure the external asset is loaded before you try and use it. Often they have little animations or other such things, but that is incidental.
I imagine this kiosk is going to be run off of a local harddrive or CD? In that case a preloader with "now loading/progress" won't work anyways. When playing from a local source, the Flash player loads all external assets in "one chunk." This can cause a little pause in your code. Especially if it needs to spin up the drive. So if you use the onLoadProgress event of the MovieClipLoader it won't execute either. But onLoadInit will fire when the loaded asset is "ready for my closeup Mr. deMille!" so to speak.
Too funny. Yeah, I suppose I was associating preloader with an animation clip which I *wouldn't have to use/show. This app will actually be executed by a projector file but will access a database online (hence 'kiosk-like') so... I *could use a preloader or look into using LoadInit...
What do you think of placing my image files into a seperate movie or movie clip and preloading this clip when the movie initially runs... I can just place it outside of the stage. Then when I need to place an image, I can use the button to load the movieclip at a specific frame to show the image I want... but it will already be loaded so the dynamic mask *should work?