all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

Loading an Image with AS



Loading an Image with AS Stressed_Simon
5/29/2006 2:09:11 PM
flash actionscript: Any ideas why this does nothing? Not even throw an error?



init();

// intialise the swf
function init() {
// load in main image
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
_root.logo_mc.loadMovie("../images/Title_logo.png");

_root.logo_mc._width = 187;
_root.logo_mc._height = 31;
}
Re: Loading an Image with AS kglad
5/29/2006 2:29:33 PM
Re: Loading an Image with AS Stressed_Simon
5/30/2006 12:00:00 AM
Re: Loading an Image with AS Peter Blumenthal
5/30/2006 12:00:00 AM
What version of Flash are you using? Dynamic PNG import is only possible in
Flash Player 8 and above...

--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------

Re: Loading an Image with AS kglad
5/30/2006 2:17:51 PM
oops, my bad. i thought you were calling init() using setInterval().

Re: Loading an Image with AS Stressed_Simon
5/31/2006 12:00:00 AM
<b>Peter Blumenthal</b> - Thanks I didn't know that, I am using Flash MX 2004
Pro. I have changed the image to a .gif and it still wont load in or error. I
know my path is correct as if I change it, it will error. But no image.

<b>kglad</b> - I tried manually setting the depth of the empty movie clip but
still no joy.

Does anyome have any ideas?

Thanks.
Re: Loading an Image with AS Peter Blumenthal
5/31/2006 12:00:00 AM
[quoted text, click to view]

Yes. The same idea as last time ;)

The only image type that Flash MX 2004 (or Flash Player 7) can load
dynamically is a non-progressive JPEG. No GIFs, no PNGs.

--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------

Re: Loading an Image with AS Stressed_Simon
6/9/2006 6:08:19 AM
OK,
If I use a jpg it still doesn't work. However, I have got it working but not
how I wanted to. Instead of using createEmptyMovieClip, I created one on the
stage myself. This dodn't work either, but as soon as I drew some content in
the movieclip it worked straight away.

Why is this?
Re: Loading an Image with AS Peter Blumenthal
6/9/2006 9:54:39 AM
Can you show your current code please. Are you *sure* the path to your image
is correct?

--
-------------------------------
Remove '_spamkiller_' to mail
-------------------------------

Re: Loading an Image with AS kglad
6/9/2006 1:21:00 PM
path has to be correct if it works with target created in the authoring
environment. which means the problem is the createEmptyMovieClip() part of the
code.

and that means you're publishing for flash 6 or less or you've done more than
we're able to detect in this forum. you need to be publishing for flash 7 or
better to use getNextHighestDepth() and if you think you are doing that, post a
link to your fla.
AddThis Social Bookmark Button