Dawn Spears Posted September 29, 2017 Share Posted September 29, 2017 Hi, 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 More sharing options...
Graham Quince Posted September 29, 2017 Share Posted September 29, 2017 When I wanted a sound effect to play for the activity timer, i ended up using: var baseURL=Frog.Utilities.getBaseUrl(); baseURL+'/app/package/widgets/022366172001B9898DBD5FE54860D700F04FF87C3C44A0A7/assets/rf_alert.mp3'; 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now