Solved

Changing Movieclip frames from HTML

Posted on 2003-12-02
7
165 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
[X]
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
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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 use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

617 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