A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: help help!!! preload dynamic jpegs from cd..

  1. #1
    Junior Member
    Join Date
    Jan 2004

    help help!!! preload dynamic jpegs from cd..

    Hi! I'm a php programmer who is trying desperately to work in Flash MX. I understand the basic concepts of programming but find myself stumbling over the way Flash itself works.

    I created a slideshow following a tutorial on kirupa.com (http://www.kirupa.com/developer/mx/photogallery.htm) and made my own edits to it - feeling very proud of myself... Basically the code names a directory (images/), sets an array with names of the jpegs in that directory, then when the user hits next or previous - it goes to the images/ directory and grabs the appropriate photo.
    I set up a main swf that calls 3 different photogalleries. It all works great and is very lightweight ...

    The problem is I want this to run off cd. I made it into an exe, burned it, and found a flaw. Every time it changes photos it goes back to the cd.

    My question is, can I dynamically load the photos into the cache? Or something? I want to be able to reuse this code by simply changing the name of the directory and jpeg names....

    I was told in tek-tips forum :
    "Flash cannot write files locally without a SSS (Server Side Script)because of macromedia's security sandbox. But, you can override this by getting some third party software, SWF2EXE Software. This will allow you to copy the images from the CD to a temp. directory on the computer."

    But it seems that in the "Easy Slideshow Component" by darshan preloads images...

    Basically - can I load these dynamically, without the exe going back to the cd and without using swf2exe software?
    I figure that I can put the pre-load in the main swf right before the loadMovie command.

    I'm guessing that I can load the images into the library dynamically but I can't find any tutorials on how to do that....

    Any help is so so so appreciated!!! I am afraid I'm spending hours attempting something that may not be possible.

    I'm desperate... I have been digging for the answer for a loonnnggg time.

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Whitehorse YT
    How many images are you talking about? Dozens? Hundreds? There's a practical limit to the number of images that can be compiled into an EXE using third party utilities, mostly because of the time it will take to load the initial EXE.

    With a little more work you can use these utilities to precopy the files to the users HD and avoid hitting the CD every time, you might even get clever and not have it copy all the images at once but copy some each time the app runs or when it's not busy etc. There are a lot of solutions you can try.

    To get you started you can check out this list of free and commercial third party projector (swf2exe) tools.

    $ SWF Studio http://www.northcode.com
    $ Flash Studio http://www.multidmedia.com
    $ Jugglor http://www.***********.com
    $ FlashAnts http://www.flashants.com
    $ Flash 'N Pack http://www.flashnpack.com
    $ SWFKit http://www.swfkit.com
    $ LPFlashEX http://www.logicplus.com.hk

    FREE Shared Object Parser (SOP) http://www.aritali.com

  3. #3
    Junior Member
    Join Date
    Jan 2004
    thank you so much for responding...! i'm practically in tears at this point.

    Not a huge amount of pics -- each gallery will have 60 max. Some only have 15.

    I guess to be more clear...

    this is my goal:
    create a swf photo gallery that easily can be reused. to change it to a new gallery - the only code needing to be altered is directory name and file names. all photos will be the same width and height...

    end result:
    on a cdrom ->
    main menu with 4 buttons - 1 exit btn and 3bts each to a different photo gallery.
    each gallery has 'next', 'previous', 'sound off/on' and 'back to main menu'

    The end result is done -- it's a main swf (exe) that calls 3 gallery swf's (those each calling the sound swf).

    It's really beautiful except for the "going back to cd" problem.

    Q: is the third party software the only way to avoid this?

    (at this point i dont care if i have to redo the whole thing.)

  4. #4
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Hi, download a copy of Flash Studio PRO and there are a number of ways you can then do this:

    1. You can use the flashstudio.copyfolder command to copy all of the images to the users TEMP dir and then load them directly from the HD (you can also delete them when the projector closes if you like!)

    2. You can pack the images into the actual Projector and then extract them to the users HD to use.

    3. You can load them directly into the Projector or into a seperate window with just a single command.

    Please visit http://www.mdmforum.com if you need any help with Flash Studio PRO or email support@multidmedia.com

    Also, check out the available downloads at http://www.multidmedia.com/downloads which provide open source examples.

    I hope this helps!

  5. #5
    Junior Member
    Join Date
    Jan 2004
    oh super... thanks!! i'm starting to see a ray of hope...

    as far as the ways you suggested...

    #1 - I looked over the mdm site... I'm going to give it a shot. Honestly I'm not 100% sure what it all means.

    #2 - Of course I have no clue, but this one doesn't sound like a good idea.

    #3 - So I use some function... and load them into a movie clip... no probably multiple MCs... or an array.... or an array of movie clips...
    Then they are actually IN the projector and I can call them depending on the onRelease and such...

    When you said there were 3 ways... did you mean I need Flash Studio PRO for all 3 or only the first one? Seems like I can keep my current code if I use the flashstudio.copyfolder and just change the "this.pathToPics = "images1/";" line of code to name the temp folder.
    But I have to be careful that slideshow 1 has diff. pic names than slideshow 2 -- because they all are in one folder.. or can i load them into temp/nyc2003/ and the next gallery into temp/sf2003/...?

    this is my code currently which is loaded from the mainmenu.exe with
    on (release) {loadMovieNum("nyc2003.swf", 2); }

    here's nyc2003.swf:

    this.pathToPics = "nycimages/";
    this.pArray = ["001.jpg", "002.jpg", "003.jpg", "004.jpg" ....];
    this.fadeSpeed = 20;
    this.pIndex = 0;
    loadMovie(this.pathToPics+this.pArray[0], _root.photo);
    MovieClip.prototype.changePhoto = function(d) {
    	this.pIndex = (this.pIndex+d)%this.pArray.length;
    	if (this.pIndex<0) {
    		this.pIndex += this.pArray.length;
    	this.onEnterFrame = fadeOut;
    MovieClip.prototype.fadeOut = function() {
    	if (this.photo._alpha>this.fadeSpeed) {
    		this.photo._alpha -= this.fadeSpeed;
    	} else {
    MovieClip.prototype.loadPhoto = function() {
    	var p = _root.photo;
    	p._alpha = 0;
    	this.onEnterFrame = loadMeter;
    MovieClip.prototype.loadMeter = function() {
    	var i, l, t;
    	l = this.photo.getBytesLoaded();
    	t = this.photo.getBytesTotal();
    	if (t>0 && t == l) {
    		this.onEnterFrame = fadeIn;
    	} else {
    MovieClip.prototype.fadeIn = function() {
    	if (this.photo._alpha<100-this.fadeSpeed) {
    		this.photo._alpha += this.fadeSpeed;
    	} else {
    		this.photo._alpha = 100;
    		this.onEnterFrame = null;

  6. #6
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Hi, yes you'll need Flash Studio PRO for all 3 options.

    if you choose to copy the files to the systems Temp Dir, your code can stay EXACTLY the same, you just need to change the folowing line to:

    this.pathToPics = fsp_temp+"nycimages/";

    "fsp_temp" is a reserved variable in Flash Studio PRO Projectors which automatically contains the path to the users TEMP dir. I hope this helps!

  7. #7
    Junior Member
    Join Date
    Jan 2004
    Would it be odd if I said I love you? Well I do.

    Now if I can only afford the cost for a commercial licence. I guess I'll check out the freeware ones... ?

    I'm not good with legal jargon... On the mdm site it says:
    Flash Studio PRO is 100% FREE to use for non commercial use. You only need to register your copy if you wish to distribute or sell your compiled executables"

    and it in the program "tips" says it will display a 'splash screen' -- does that mean I can sell my cd but it will get the splash screen?

    Sorry to add another question -- you answered the most important stuff!!! So thank you !!!!
    Last edited by dzr_rtw; 01-16-2004 at 09:20 AM.

  8. #8
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    No problem at all... always nice to be loved!

    You can use the Flash Studio PRO Trial completely free for as long as you like if it's for personal use only (ie. learning purposes or if you're creating an application for your own use only)

    For distribution, commercial or otherwise, you would need to purchase a licence. I hope this clears things up!

  9. #9
    Junior Member
    Join Date
    Jan 2004
    got it!

    not the program, the point
    i'm going to have to save up my pennies. Flash Studio PRO has a bunch of cool other stuff to play with!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center