dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loading images

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    4

    Wink


    I was wondering if it was possible by Action script
    to load images from the outside, like loading variables
    from text files.

    What I have in mind is to just add jpg images into a folder and for the flash to automatically recognize it and display it, rather then to keep updating the flash file everytime I produce a new image.


  2. #2
    Member
    Join Date
    Jan 2001
    Posts
    49
    Well, you have two options to solve that:

    1. (and easiest)

    Create your swf without the Pictures in it.

    write a allPictures.txt file with the names of the pictures in, formated like this:

    allnames=picturename1.picturename2.picture-name3......&loaded=a; (picturename should be the name of the file before .jpg)

    and save that in the same directory as your swf

    add an empty movieclip to the _root. and name it container

    add this code to the object:
    onClipEvent(load){
    _root.actualpicture=0;
    loaded=b;
    loadVariables("allPictures.txt", this);
    }
    onClipEvent(enterFrame){
    if(loaded=="a"){
    theURL=allnames.split;
    loaded="b";
    }}

    create a button in your swf-file
    add the action "on(release){loadMovieNum(_container.theURL[_root.actualpicture] add ".swf", 1);
    _root.actualpicture++;}

    after that create single swf files containing one jpg file on the right position on the screen an name it after the .jpg-picture and save them to the same directory as the main swf.

    (note that the code is not perfect, bu you should get the idea....)

    2.Option

    use Generators......

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    if you are dealing with jpeg baseline images only, there are a few tools around that can automate the conversion to swf - either on your own computer or on the server

    Musicman

  4. #4
    Junior Member
    Join Date
    Nov 2001
    Posts
    4
    Thanks for the tips!!
    I've managed to make it work just like badbadzmaru instructed. And I'll look into the tools Musicman.


  5. #5
    Member
    Join Date
    Jan 2001
    Posts
    49
    no pob

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