Jump to content


Photo

onmouseover question


  • Please log in to reply
5 replies to this topic

#1 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 25 September 2006 - 06:51 AM

I'm just wondering, is it possible with javascript to write a function, call the function

flashexec() or whatnot, so when someone 'onmouseover' over an image, a flash movie is called, and the position of the flash movie is depended on the x & y value of the mouse?

Just curious about this, any help?

#2 FrOzeN

FrOzeN
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 25 September 2006 - 11:38 AM

Yes.

Example:

<html>

<head>
  <title>page title</title>
  <script type="text/javascript">
    function example($number) {
      alert("The number is " + $number + ".");
    }
  </script>
</head>

<body>
<img src="some_image.jpg" alt="Some Image" onMouseOver="javascript:example('10');" />
</body>

</html>



#3 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 25 September 2006 - 11:44 AM

So it is possible,

I've been searching for hours with no results,

so when someone 'onmouseover' (mouseovers) the image, a flash movie can be called to the current browser without window.open?

Do you have any links to tutorials? Ive been trying to find some information about this for about three hours :S

#4 FrOzeN

FrOzeN
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 25 September 2006 - 11:56 AM

Yeah,

There's a few different ways you can call the flash movie depending on where you want it to show (page, frame, new [popup] window):

document.window.location.href = "flash_move_location.swf";
-or-
frames['name_of_frame'].location.href = "flash_move_location.swf";
-or-
document.window.open ("flash_move_location.swf", "mywindow", width="500", height="500");

(Reference how to use the window.open() function.)

I've only just started JavaScript recently, and basing my knowledge off what I've seen done before, and googling for certain functions. The best place to start is at w3schools, then I find searching for something in wiki to get a basic knowledge of what it is, and at the bottom of the page (in wiki) it contains external links with some tutorials which are generally very good. :)

#5 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 25 September 2006 - 12:13 PM

hrmm ok, i don't think frames would work with my idea, as my idea is based around a search that results in images.

Apon mouseover of each image a small flash movie should pop up near the image it's self (the flash movie localtion would be set depending on the x and y axis of the cursor of the user)

this would give a small description, on mouseout would stop the flash movie and take it away from the page.

Apon clicking either the flash movie will apparent or the image you would go into further page with a more detailed description.

Have everything down pack, but by the sounds of things my idea of this with javascript may come to an end?

#6 FrOzeN

FrOzeN
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 25 September 2006 - 12:23 PM

No, your idea of this is perfectly feasible with javascript. Though, personally, depending on the size of your flash movies, and what they are, it may not be the best idea to have them running on a mouseover, maybe just a small screenshot and then they'll play when viewed (clicked on).

This would be done with a combination of HTML/CSS/JavaScript (thus, DHTML).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users