Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Load random images with associated links in HTML5 Canvas

Community Beginner ,
Apr 03, 2017 Apr 03, 2017

I see lots of old examples of randomly loading images or URLs using ActionScript, but nothing recent for HTML5 Canvas. Can anybody help direct me how I could load random images (or movie clips), along with associated links, into a movie clip? I want to create a simple web banner that loads different product images with links to their respective product pages. Many thanks for any insight.

514
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 04, 2017 Apr 04, 2017

i can't think of anything easier than putting each product on a frame.  then display a frame selected randomly.

Translate
Community Expert ,
Apr 04, 2017 Apr 04, 2017

i can't think of anything easier than putting each product on a frame.  then display a frame selected randomly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 06, 2017 Apr 06, 2017

Thank you kglad for the great suggestion. I followed up with another thread to find the exact code needed (thanks Colincolinqawu6 re: Random Frame):

this.gotoAndPlay(15+Math.random()*10);

In this example it would jump to a random frame in the range of 15 to 24. Change the start frame number and the number of different frames, to match your case.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2017 Apr 06, 2017
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines