Jump to content
Dawn Spears

Using files within the assets folder

Recommended Posts


I'm not sure of the best way to access the assets within my widgets assets folder. For example, if I have an image that I want to display on a canvas, I can use the following:

imageObj.src = "https://disraeli-bucks.frogos.net/app/file/resource/10E354602003064E38AADFB27ECC0A08B6D928AC51D3E2CA?1506677717";

To reference the image and it will display correctly. However if I use something like

imageObj.src = "assets/rhino.jpg";

nothing will display.


Is it necessary to use the full URL each time or am I being a bit daft?

Link to comment
Share on other sites

When I wanted a sound effect to play for the activity timer, i ended up using:


var baseURL=Frog.Utilities.getBaseUrl();


to point to the file.  I also had to publish the widget once, so get the file in the correct location.   Once there, i was able to continue editing my code and use the file.

@Chris.Smith knows more about it than I do though

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...