User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Graphics and Multimedia section within the Web Development category of DaniWeb, a massive community of 427,196 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,186 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Graphics and Multimedia advertiser: Programming Forums
Views: 817 | Replies: 4
Reply
Join Date: Feb 2008
Location: Rome, Italy
Posts: 10
Reputation: isotope is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
isotope's Avatar
isotope isotope is offline Offline
Newbie Poster

actionscript: selfcontained images' slideshow

  #1  
Mar 5th, 2008
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
IT goes green
(sustainable informatic development)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 5
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: actionscript: selfcontained images' slideshow

  #2  
Mar 5th, 2008
By self contained do you mean pictures embedded in flash, as library clips and dynamically load it?? Please be more clear.
Reply With Quote  
Join Date: Feb 2008
Location: Rome, Italy
Posts: 10
Reputation: isotope is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
isotope's Avatar
isotope isotope is offline Offline
Newbie Poster

Re: actionscript: selfcontained images' slideshow

  #3  
Mar 6th, 2008
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
IT goes green
(sustainable informatic development)
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 5
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: actionscript: selfcontained images' slideshow

  #4  
Mar 8th, 2008
>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.
Reply With Quote  
Join Date: Feb 2008
Location: Rome, Italy
Posts: 10
Reputation: isotope is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
isotope's Avatar
isotope isotope is offline Offline
Newbie Poster

Re: actionscript: selfcontained images' slideshow

  #5  
Mar 8th, 2008
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
Last edited by isotope : Mar 8th, 2008 at 11:44 am.
IT goes green
(sustainable informatic development)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Graphics and Multimedia Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Graphics and Multimedia Forum

All times are GMT -4. The time now is 10:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC