Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading a jpeg in a movie

Status
Not open for further replies.

Stoemp

Programmer
Sep 25, 2002
389
BE
Hi,

I'm kind of new in the whole flash mx actionscripting. I'm trying to load a jpeg dynamically in my scene using actionscript. According to some tuts I read the code is quite simple:

this.createEmptyMovieClip("pic", 50);
loadMovie("wolken.jpg", "pic")

When I put this in a brand new flash file and save the file in the same directory as the jpeg, there's nothing happening when I run the movie. Does anyone have a clue how I can solve this?

Thanks,
Steven
 
easiest way

create an empty movie manually

insert>new symbol>movie clip

back to the main mivie

open the library...drag a copy of the clip you created onto the stage, placing it where you want the jpeg to be, and give it an instance name. pic is fine

then in the frame add

loadMovie("wolken.jpg", pic)

 
The fact is I have to create movieclips dynamically because the images are loaded from an xml file. Then number of images is variable. I'm making a portfolio and some topics have more images then others. The whole site is mostly situated on 1 frame where everything is loaded dynamically.

 
ok but you still need an movie clip on stage or in the library as createmptymovieclip creates a child of an existing clip

so if you had one called pic

pic.createEmptyMovieClip (pic1, 1);
loadMovie("wolken.jpg", pic1);

for loops of course you would replace 1 with a variable (i)
 
normally you don't need a child movieclip to create an empty one. You can do this on the _root too I think. I have some examples here that only use scripting. No graphics, movieclips or anything involved... and it works. But when I try to use this in something I made, it doesn't work :-(
 
yes it can work like this

_root.createEmptyMovieClip("myClip", 1);
myClip.loadMovie("wolken.jpg");

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top