Solved

Changing Movieclip frames from HTML

Posted on 2003-12-02
7
160 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.

911 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

20 Experts available now in Live!

Get 1:1 Help Now