Image in specialFolderPath("resources") - Can't put into Image

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Image in specialFolderPath("resources") - Can't put into Image

Post by Googie85 » Sat Mar 19, 2022 11:23 am

Hi Guys

I have an image file in specialFolderPath("resources") and I am trying to put it into an Image element. I have tried a lot of things and I know it is probably a simple fix but I have tried everything that I can think of and nothing will work. Any help is welcomed!!

Many Thanks,

Googie.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by Klaus » Sat Mar 19, 2022 11:38 am

Hi Googie85,

what did you try so far?
This should work:

Code: Select all

...
set the filename of img "name of your LC image object" to (specialfolderpath("resources") & "/your image.jpg")
...
Best

Klaus

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by Googie85 » Sat Mar 19, 2022 11:48 am

Thanks Klaus!!

It works fine, but I am trying to load in a .GIF image. The problem I am having is the image will not animate, rather appears as a still image. Any ideas on how to fix that? I have tried disable and enable image and set the vis of image to true/false.

Thanks!

Googie.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by Klaus » Sat Mar 19, 2022 12:28 pm

Hm, that should work. :D

Try to "start" the animation of the GIF:

Code: Select all

set the repeatcount of img "your gif image" to -1
To stop it use:

Code: Select all

set the repeatcount of img "your gif image" to 0
If that does not work, I am out of ideas...

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by Googie85 » Sat Mar 19, 2022 12:38 pm

Thanks for your reply Klaus!!

It didn't work. I will try something else.

Cheers,

Googie.

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by SparkOut » Sat Mar 19, 2022 2:35 pm

I don't know, but maybe the gif needs to be somewhere in a writable location in order for it to be addressed by LC and maintain knowledge of the frame to display.
Try copying the gif image to specialFolderPath ("documents") on first run, then assign it from there.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Image in specialFolderPath("resources") - Can't put into Image

Post by jacque » Sat Mar 19, 2022 5:47 pm

You may need to import it directly into the stack. Images called by reference don't always behave the same way.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”