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

Load random images with associated links in HTML5 Canvas

Community Beginner ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

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.

Views

405

Translate

Translate

Report

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.

Votes

Translate

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

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