*Originally posted by Phil Jayhan *
**marz why not?
pj
that is pretty cool lost-
pj **
Thanks Phil.
*Originally posted by Phil Jayhan *
**marz why not?
pj
that is pretty cool lost-
pj **
Thanks Phil.
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.
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?
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
<?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
then open up the text fileā¦
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ā¦
_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]
SWEEET!!! Thanks man.
I canāt test it at this moment either, but I will be testing that later⦠W00t!!!
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
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
100% Excellent!
You rock man! You saved me
:: Copyright KIRUPA 2024 //--