Solved

Changing Movieclip frames from HTML

Posted on 2003-12-02
7
159 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now