Adding a hyperlink to a flash movie

Posted on 2005-03-09
Medium Priority
Last Modified: 2008-02-01
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])))
                    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">');

Please can anyone point me in the right direction.

Question by:rvr_1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Assisted Solution

Billystyx earned 800 total points
ID: 13501499
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:
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.
LVL 16

Accepted Solution

sam85281 earned 1200 total points
ID: 13502154
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) {

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

LVL 11

Expert Comment

ID: 13503776
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>";

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 18

Assisted Solution

Billystyx earned 800 total points
ID: 13503982
That's the other way - thanks Buffon:)

LVL 18

Expert Comment

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


Author Comment

ID: 13536234
Got it working now - thanks for your help!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question