Avatar of sgoldhar
sgoldhar asked on

Disjointed Rollover using Flash

I have a web page that contains 3 flash rollover buttons (the stopwatches:  http://www.sundanceglobalmedia.com/sci/homepage_new.aspx). When the mouse is over the stopwatch, I also want it to change the text in the cell below. Can this be easily done?
Adobe DreamweaverAdobe FlashJavaScript

Avatar of undefined
Last Comment
sgoldhar

8/22/2022 - Mon
BongoMoose

Hello,

You can always change the text using javascript and call the javascript function from your flash file.

to set you on your way: http://www.spoono.com/flash/tutorials/tutorial.php?id=20

great tut on this subject

kind regards,
Bongomoose
ASKER
sgoldhar

This first part is very helpful, thank you! But what is the actionscript or Javascript which would change the text in the cell underneath when the mouse rolled over the Flash? I'm stuck because the rollover is setup in the flash file and I don't know how to reference the disjointed text rollover part from within the file or what that would look like in Javascript in the html document. Also adding to the confusion is that we are rolling over an image but changing text in the other cell.
ASKER
sgoldhar

Doing some additional research, I think that what I need to do is to trigger a rollover event from within the flash file that targets a different cell outside the flash file.
You can see what I need to acheive by rolling over the stopwatches here:
http://www.sundanceglobalmedia.com/sci/homepage.aspx
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
BongoMoose

Hello,

for example you can put the text at the bottom ( underneeth your flash movie ) in a div called dvInfo
and the following script in your header.
After this from flash you can call the function showText with a parameter partID (the button you hovered over 1,2 or 3)

<script>
function showText(partID)
{
    if (partID== 1 ){
          document.getElementById('dvInfo').innerHTML="text1"
    }
    else if  (partID== 2 ){
    document.getElementById('dvInfo').innerHTML="text2"
    }
    else if  (partID== 3 ){
    document.getElementById('dvInfo').innerHTML="text3"
    }
}
</script>
ASKER
sgoldhar

Hi! I'm still a bit confused and not able to get it working. Here is what I had in my flash file before:
on (rollOver) {
      this.gotoAndPlay("MouseOver");
}
on (rollOut) {
      this.gotoAndPlay("MouseOut");
}
on(press) {
      getURL("javascript:sqq()");
}

How would I add the variable statement to this? Would it be :
on (rollOver) {
      this.gotoAndPlay("MouseOver");
      var partID:Number = 1;
        getURL("javascript:showText()");
}
on (rollOut) {
      this.gotoAndPlay("MouseOut");
}
on(press) {
      getURL("javascript:sqq()");
}


I've added your showText function to the header but I'm uncertain as to what the correct syntax for the div tag would be? Could you show me an example using my code below? Thanks again for your help!
        <td width="24%"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','220','height','325','src','flash/30secSQQ','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','flash/30secSQQ' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="220" height="325">
          <param name="movie" value="flash/30secSQQ.swf" />
          <param name="quality" value="high" />
          <embed src="flash/30secSQQ.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="220" height="325"></embed>
        </object></noscript></td>
        </tr>
      <tr>
        <td><div id="dvInfo">Rollover text goes here!</div>
		</td>

Open in new window

ASKER CERTIFIED SOLUTION
BongoMoose

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
sgoldhar

Thx! I have one more question. If the flash file was being called from within an iframe, how would I modify the actionscript so that the mouseover effect and javascript link still work on the parent page? FYI - I am trying to
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
BongoMoose

Should be something like this in your actionscript.

window.parent.myfunction();
window.frames[0].myFunction();

Forgive me if i'm wrong, but it's outta the back of my head ;)
ASKER
sgoldhar

Thank you for all your help!