This content has been marked as final. Show 5 replies
You could try Buddy API which will permit you to obtain a listing of
filenames with wildcard matching.
For example, if your first 12 characters happened to be "abcdefghijkl"
you could obtain a list of similarly named files with something like:
tChars = "abcdefghijkl"
lFiles = baFileList(_movie.path & "Images", tChars & "*.*")
Buddy API is free for the first 2 functions used any number of times in
a single session: < http://www.mods.com.au>
Try the following (replacement) handler:
-- example call:
lFiles = getFileMatchList(aFilename.char[1..12],_movie.path&"Images","jpg")
on getFileMatchList aMatchFilename, aFolder, aFileType
-- validate parameters
if ilk(aMatchFilename, #string) = 0 then return 
if ilk(aFolder, #string) = 0 then return 
-- set default if file type not passed
-- (handler expects something like: "jpg", "bmp", "html", etc.)
if voidP(aFileType) then aFileType = "*"
-- return list of files matching search criteria:
return baFileList(aFolder, aMatchFilename & "*." & aFileType)
i have another question, i put the files in diferent folders, and i need put with bafilelist a variavle but a i try LFiles = baFileList(_movie.path & "images " & namefolder, "*.*" ) the variabel "namefolder" is the name of the point of the map, and is the nema of de subpath of images. but don`t work. how put a variable in the path string???????.
thank for the heelp
> i have another question, i put the files in diferent folders, and i need put
> with bafilelist a variavle but a i try LFiles = baFileList(_movie.path &
> "images " & namefolder, "*.*" ) the variabel "namefolder" is the name of the
> point of the map, and is the nema of de subpath of images. but don`t work. how
> put a vaiavle in the path string.
It should work as you've posted (assuming the web forum has removed the
folder delimiter from what you posted)
Could you try something like the following:
tPath = _movie.path
tPath = tPath & "images" & tPath.char[tPath.length] & namefolder
lFiles = baFileList(tPath, "*.*")
hi, tanks for the help.
look at this, this is my script, this work very good, now i need use preloadthing for precargin the images, because are very large and i need show a progress bar, but i don no how use this with this dinamic script..., found a script http://www.lingoworkshop.com/Articles/Shockwave_Preloader.php and is is i like to do, but, with this script..
property spriteNum, nombre , imagen, Lfolder, alt, carpeta,netID
global tPath, lPath, itemText
on mousedown tPath,
Lfolder = baFolderList( _movie.path & "Archivos" )
pointClicked = _mouse.mouseLoc
currentMember = sprite(spriteNum).member
itemNum = sprite(spriteNum).pointToline(pointClicked)
itemText = currentMember.line[itemNum]
pos = member(9).rect
alt = itemText.char.count
if itemText.char ="_" then
carpeta = itemText.char[1..12]
if itemText.char = "_" then
carpeta = itemText.char[1..13]
if itemText.char = "_" then
carpeta = itemText.char[1..11]
tPath = _movie.path & "Archivos\" & carpeta & "\"
member(9).filename = tPath & itemText
member(13).filename = tPath & itemText
i have another quiestion, i think that put evrything in mousedown handler not is the best way, whish are?