Attempting to load an image from a file that a global function finds:
function GetCityInfo(cityname)
--Remove the Button text from the end of the button name
local strCityName = String.Replace(cityname, " Button", "", false);
-- Check to see if a text file exists within that folder
local bCityFound = File.Find("AutoPlay\\citys\\"..strCityName, strCityName..".txt", false, false, nil);
-- If it exists then jump to the citys page and return the string with the City Name
if bCityFound then
--Page.Jump("citys");
return strCityName, "citys";
else
return strCityName, "false";
end
end
Now, I need to pull up a pic called citypic.png that’s in the folder that the global function had already found. Here’s what I attempted to use:
Image.Load("city_Image", "AutoPlay\\citys\\".. strCityName .."citypic.png");
I’m sure I jacked this up!
function GetCityInfo(cityname)
--Remove the Button text from the end of the button name
local strCityName = String.Replace(cityname, " Button", "", false);
-- Check to see if a text file exists within that folder
local bCityFound = File.Find("AutoPlay\\citys\\"..strCityName, strCityName..".txt", false, false, nil);
-- If it exists then jump to the citys page and return the string with the City Name
if bCityFound then
--Page.Jump("citys");
return strCityName, "citys";
else
return strCityName, "false";
end
end
Now, I need to pull up a pic called citypic.png that’s in the folder that the global function had already found. Here’s what I attempted to use:
Image.Load("city_Image", "AutoPlay\\citys\\".. strCityName .."citypic.png");
I’m sure I jacked this up!
Comment