0

Hi everybody,
I would like to create a slideshow template through actionscript, loading images which are embedded in the same swf as the script.
I've tried creating an array and populating it with the names of the images, but I can't find a way to create movieclips containing those images: I know it can be done by loading files from a separate folder, but I would do this with selfcontained images.

Anyone can help?
Thanks in advance and bye all,
s

2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by isotope
0

By self contained do you mean pictures embedded in flash, as library clips and dynamically load it?? Please be more clear.

0

Hello Vishesh,
I meant exactly that: pictures embedded in the flash file, as library clips, to be dynamically loaded through actionscript. Sorry for having been inaccurate.

Apparently, I succeded using "BitmapData.loadBitmap()". This is the example I found on Flash Help:

import flash.display.BitmapData;
var linkageId:String = "libraryBitmap";
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
trace(myBitmapData instanceof BitmapData); // true
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());

What is annoying is that I have to set a Linkage manually, for each bitmap image I have in the library. I've tried selecting multiple files and right-clicking, but the command "linkage..." becomes unclickable. Let's say I have a slideshow with fifty images: I have to right-click and set linkage fifty times!
The new question is: can multiple files' linkage be done in an automated (smart) way? I would just say to Flash that all the bitmaps in the library must have a linkage name equal to the files'names.

bye,
s

0

>can multiple files' linkage be done in an automated (smart) way?
I think and am pretty sure that isn't possible.

But one thing I want to say is that you shouldn't put 50 images in one swf. If will increase file size, loading time. You should use a XML file to put links and captions of all images and load images dynamically.

0

Hi Vishesh,

I know (and agree) that my solution would be insane for a website, but I'm preparing swf files to be embedded in a pdf presentation, than I'd prefere not to have external link (neither I'm sure that connection via XML would work).

Thanks anyway for your reply.

p.s.
By the way I found a rough method not to have to reassign linkage every time:
1 - batch rename of the images: 0.jpg, 1.jpg, 2.jpg, ...
2 - replace a group of images with the same name, with pre-assigned linkage, in a template file.

Not that elegant, but it does the job :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.