Forum Moderators: open

Message Too Old, No Replies

Dynamic images in flash

Like dynamic text, but importing images

         

rich_b

10:56 am on Oct 28, 2004 (gmt 0)

10+ Year Member



A friend has asked me to knock up a art gallery page in Flash. There's a bunch of thumbnails and clicking on a thumbnail changes the main picture on display, along with a bit of descriptive text for each picture - simple stuff. He wants it so that he can change the text and pictures himself, without using Flash. I've worked out how to do the text changes using external text files and dynamic text, but I can't find a way to change the pictures. Is there a way in Flash or is it impossible? Thanks.

Edit: with some more searching I seem to have found two ways to do it in Flash MX. Either by converting the JPGs to SWFs at runtime and use Loadmovie (!) or by using the Loadimage function. I'll keep investigating but if anyone wants to suggest aanother good way then feel free! :-)

benihana

8:20 pm on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i *believe* you can use loadmovie and specify a path to jpeg - no need to convert.

One thing to be aware of - you cannot dynamically load progressive jpegs. Ive spent hours trying to figure out why my images wouldnt load, and this was the reason.

speedo

8:57 pm on Nov 17, 2004 (gmt 0)

10+ Year Member



Well, if you load your movie using a basic background and call all of your content (from a new swf file) onto level 2, then you can have your thumbnails or background buttons first unload any content on level1 and then load a new swf onto the same level (level1).

The content file can have all of the dynamic text you want on it, no problem. I can help you out with more info if you require it, and I will post examples if required.

speedo

9:33 pm on Nov 17, 2004 (gmt 0)

10+ Year Member



Alright guys, here is the fastest most simple way to show what I am talking about. Please download the rar file from: <snip>

It is pretty self explanitory but if you have questions my email address is in there.

[edited by: Woz at 12:40 pm (utc) on Nov. 18, 2004]
[edit reason] No URLs please, seet TOS#13 [/edit]

benihana

9:20 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Speedo - links to files are not nessecary.
Its much preffered to describe the solution and post code if applicable.
That way, it can serve as a future reference for others, long after the file has been deleted.

Cheers

speedo

8:01 pm on Nov 19, 2004 (gmt 0)

10+ Year Member



Ahhh... sorry about that. When I get the chance I will describe it in more detail when I get a little more time.

aspirin99

11:19 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



I've built several of these. If your friend is willing to name the images sequentially, e.g., 0.jpg, 1.jpg, 2.jpg, you can use the same flash file and just change the images that are in the folder.

The next thing you need to decide is whether you will preload all of the images in the beginning or load them one at a time when they are requested.

I recommend using a for loop to create empty movie clips that also have child emptyMovieclips. Then, make the parent movie clips invisible and load the jpgs into the emptymovieclips like _root.imageholder1.child.loadMovie("0.jpg");

The reason for adding the child empty clip is in case you want to fade the image in. It's a long explanation that I don't want to do if you don't need it.

Then, when you want to show the image, make it visible with _root.imageholder1.child._visible=1;

Obviously, there's a lot more to it, but that's the concept.