# Work in progress Experiment

**URL:** <https://forum.kirupa.com/t/work-in-progress-experiment/10068>\
**Category:** Uncategorized\
**Created:** [December 23, 2002, 7:28pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068 "2002-12-23T19:28:20Z")\
**Posts on this page:** 9\
**Page:** 4

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 6:41pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/61 "2003-03-04T18:41:56Z")

</div>

> \*Originally posted by Phil Jayhan \*  
> \*\*marz why not?

pj 😠

that is pretty cool lost-  
pj 😛 \*\*

🙂 Thanks Phil.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 6:43pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/62 "2003-03-04T18:43:08Z")

</div>

OH yeah, and Marz, I know Flash can only load in non-progressive .jpg images, but I had to add .gif in there because the only images I had up in that folder are .gif format, so for testing reasons I used that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 6:46pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/63 "2003-03-04T18:46:20Z")

</div>

Yeha man… That’s cool… I’ll see what I can whip up here.

You said you wanted it to load up the file name, width and height right?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 6:47pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/64 "2003-03-04T18:47:59Z")

</div>

Yep:)

You have no idea how much that would help me.

If I were in a class for server-side FLash I would get an F-- and I am not talking about a decrementing F variable 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 7:30pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/65 "2003-03-04T19:30:43Z")

</div>

```php

<?php
$dir = opendir(".");
$packet = "images=";
while($file = readdir($dir))
{
   if($file=="." or $file=="..") continue;
   $dotposition = strrpos($file, ".");
   $filename = substr($file, 0, $dotposition);
   $extension = substr($file, 1 + $dotposition);
   if($extension == "jpg" || $extension == "gif")
   {
      $size = getImageSize($file);
      $height = $size[1];
      $width = $size[0];
      $temp = $temp . "$filename.$extension::$height::$width::";
   }
}
$final = $packet . $temp;
$filePointer = fopen("imagedata.txt", "w");
fputs($filepointer, "$final");
fclose($filepointer);
?>

```

This should print out the This should display the following.

[http://www.fantom-stranger.com/~mentalconcepts/pics/images.php](http://www.fantom-stranger.com/~mentalconcepts/pics/images.php)

then open up the text file…

[http://www.fantom-stranger.com/~mentalconcepts/pics/imagedata.txt](http://www.fantom-stranger.com/~mentalconcepts/pics/imagedata.txt)

Check it out… That’s the way it should display. Then you just need a function in flash to read it… Which would be…

```php

_root.onLoad = function()
{
   imgVars = new LoadVars();
   imgVars.load("url/imagedata.txt");
   loaded = FALSE;

   fileNames = new Array();
   imgHeights = new Array();
   imgWidths = new Array();
}

_root.onEnterFrame = function()
{
   if(loaded == FALSE)
   {
      if(imgVars.loaded)
      {
         index=0;
         imgList = imgVars.images;
         temp = imgList.split("::");
         for(i=0; i<(temp.length-1); i+=3)
         {
            fileNames[index] = temp*;
            imgHeights[index] = temp[i+1];
            imgWidths[index] = temp[i+2];
            index++;
         }
         loaded = TRUE;
      }
   }
}

```

See how that works out for you… I tested the php script but couldn’t test the flash script out yet… Tell me if it works sufficiently or not… It should load all the filenames, heights and widths into their appropriate arrays. I made the length of the array - 1 because my php script adds an extra :: at the end of the file that could be mistaken as real data 😉

[EDIT]Screwed up the Flash Code a tiny bit… lowercase l instead of uppercase L _lol_[/EDIT]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 7:33pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/66 "2003-03-04T19:33:58Z")

</div>

SWEEET!!! Thanks man.

I can’t test it at this moment either, but I will be testing that later… W00t!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 7:41pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/67 "2003-03-04T19:41:32Z")

</div>

_cough_… By the way… I did test this out and it works like charm… Lemme upload the .swf to my server here really quickly to show you 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 7:55pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/68 "2003-03-04T19:55:28Z")

</div>

[http://www.fantom-stranger.com/~mentalconcepts/pics/datatextexample.swf](http://www.fantom-stranger.com/~mentalconcepts/pics/datatextexample.swf)

There ya go man… AND NO laughing at my button… I put all my heart and soul in that baby… hehehe

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 4, 2003, 7:57pm UTC](https://forum.kirupa.com/t/work-in-progress-experiment/10068/69 "2003-03-04T19:57:06Z")

</div>

100% Excellent!

You rock man! You saved me 🙂

[Previous page](https://forum.kirupa.com/t/work-in-progress-experiment/10068.md?page=3)
