Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing Movieclip frames from HTML

Posted on 2003-12-02
7
Medium Priority
?
167 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 1200 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
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 the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

782 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