Adding a hyperlink to a flash movie

I have created a flash movie (.swf) in Macromedia Flash MX.  It's just a few of our products that fade from one to another and is featured on our homepage.

However, I cannot work out how to add a hyperlink to this movie so that the user can click on it and be taken to the products page.  I do not wish to have multiple links for each item shown, just one link regardless of which item is shown.

The code I have used to include the movie is:

<script language=JavaScript1.1>
          <!--
          var MM_contentVersion = 6;
          var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
          if ( plugin ) {
                    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
                   for (var i = 0; i < words.length; ++i)
                   {
                    if (isNaN(parseInt(words[i])))
                    continue;
                    var MM_PluginVersion = words[i];
                   }
               var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
          }
          else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
             && (navigator.appVersion.indexOf("Win") != -1)) {
               document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
               document.write('on error resume next \n');
               document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
               document.write('</SCR' + 'IPT\> \n');
          }
          if ( MM_FlashCanPlay ) {
               document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
               document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ');
               document.write(' width="330" height="380">');
               document.write(' <param name="WMode" value="Transparent">  ');
               document.write(' <param name="movie" value="flash/fadingallbrands.swf">  ');
               document.write(' <param name="quality" value="high">  ');
               document.write(' <embed src="flash/fadingallbrands.swf" width="350" height="406" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">');
               document.write(' </embed>');
               document.write(' </object>');
          } else{
               document.write('<div align="center"><img src="Images/noflash.png" width="315" height="200" border="0" usemap="#flash">');
          }
          //-->
                              </script>

Please can anyone point me in the right direction.

Thanks.
rvr_1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BillystyxCommented:
Inside the swf movie, in your .fla, write some text. Then convert it to a button (right-click then choose convert to symbol, and choose button).
Then click on the button you have created, open the action script editor and type this:
on(release){
getURL("www.mywebsite.com");
}
save your swf and use that in your page, it will then open the page you want, like a hyperlink(obviously change the address).
If you want it to change colour when mouse floats over, edit the button by rightclick on it and choose edit,
you should see 1 keyframe. rightclick in the space next to the first keyframe and choose insert keyframe.
In frame 2 change the colour of the text to a hyperlinky colour.
Is this what you are looking for?
another alternative is to add an actual hyperlink insde flash - it is possible.
Just can't remember how ... if you're still having trouble tomorrow I will look it up for you.
Billystyx
0
sam85281Commented:
You can make the whole movie a hyperlink like this:

1. Open your fla
2. draw a rectangle over your entir movie
3. Make sure that rectangle is highlighted(selected)
4. press F8
5. Click the button radio circle, name it anything
6. Right click the rectangle and choose edit from the menu.
7. On the timeline, selct frame 1 and then drag it to frame 4.  Frames 1-3 should be empty
8. Go back to the main timeline
9. Your new button will look like a transparent blue rectangle over the entire movie.
10. Select the button
11. In the action panel put:
on (release) {
getURL("YourLinkGoesHere");
}

Now if they click anywhere on the movie it will go to the link.

-Sam
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BuffonCommented:
you can also do it with html text:

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 22);
my_txt.html = true;
my_txt.htmlText = "<a href='www.google.com'>here</a>";

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

BillystyxCommented:
That's the other way - thanks Buffon:)
Billystyx

0
BillystyxCommented:
...and the more accurate method too (in terms of the fact that it is actually a hyperlink).

Billystyx
0
rvr_1Author Commented:
Got it working now - thanks for your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.