Solved

Changing Movieclip frames from HTML

Posted on 2003-12-02
7
162 Views
Last Modified: 2010-04-03
I'd like to be able to control which frame my movie clip is on based on the onmouseover and onmouseout functions of an href. Can this be done?

Thank you.

Ch@rlie
0
Comment
Question by:crazycharlie
  • 4
  • 3
7 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 300 total points
ID: 9860834
Surely.

<html><head><title></title>

<script language="JavaScript" type="text/JavaScript">
<!--
function FlashMethod(clip, frame)
{
      var IE = navigator.appName.indexOf("Microsoft") != -1;
      var movie = IE ? window.TARGET_MOVIE : window.document.TARGET_MOVIE;
      movie.TGotoFrame(clip, frame - 1);
}
//-->
</script>
</head>

<body>
<object
      classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
      width=400 height=300 id="TARGET_MOVIE">
      <param name=movie value="yourmovie.swf">
      <param name=quality value=high>
      <param name=bgcolor value=#FFFFFF>
      <embed
            src="yourmovie.swf"
            quality=high
            bgcolor=#FFFFFF
            width=400
            height=300
            name="TARGET_MOVIE"
            swLiveConnect="true"
            type="application/x-shockwave-flash"
            pluginspage="http://www.macromedia.com/go/getflashplayer">
      </embed>
</object>
<br>
<a       
      href="page.html"
      target="_blank"
      onmouseover="FlashMethod('_root.your_clip','10');"
      onmouseout="FlashMethod('_root.your_clip','1');">html link
</a>
</body>
</html>
0
 

Author Comment

by:crazycharlie
ID: 9861688
I have the id and name attributes set on the object and embed tags (id="targetMovie", name="targetMovie") and have the javascript called from an external .js file.  The javascript looks like this:

function FlashMethod(clip, frame)
{
     var IE = navigator.appName.indexOf("Microsoft") != -1;
     var movie = IE ? window.targetMovie : window.document.targetMovie;
     movie.TGotoFrame(clip, frame - 1);
}

This is what I have in the HTML portion:

<a href="javascript: void(0);" onmouseover="FlashMethod('_root.MovieClip','2');" onmouseout="FlashMethod('_root.MovieClip','1');" onfocus="this.blur();"><img src="../../images/information.gif" alt="Definition" width="12" height="12" border="0" /></a>

I don't get any errors, but for some reason, it's not incrementing the .swf.

Ch@rlie
0
 

Author Comment

by:crazycharlie
ID: 9861971
Actually, I just figured it out.  Since I'm only progressing the frames in _root, that's what I used for the clip variable call.

Thank you!

Ch@rlie
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:crazycharlie
ID: 9862319
negatyve,

This isn't working in IE on the Mac.  Do you know of a workaround for that?

Thanks.

Ch@rlie
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9862474
>Since I'm only progressing the frames in _root, that's what I used for the clip variable call.

perfect!

>This isn't working in IE on the Mac.  Do you know of a workaround for that?

actually, nothing. it's a known and unsolved issue: http://www.macromedia.com/support/flash/ts/documents/browser_support_matrix.htm
0
 

Author Comment

by:crazycharlie
ID: 9862549
Okay.. I thought it might have been, but wanted to be sure anyway.

I appreciate all the help and quick responses.

All the best,

Ch@rlie
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9862755
>All the best,

to you..

cheers!

nega
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

807 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