| Author |
Message |
Oded Tal
Guest
|
Posted:
Wed Mar 02, 2005 3:39 pm Post subject:
attachEvent and passing parameters |
|
|
Hi,
I used a function seen in this newsgroup (by Neil) to attach a click event
to a function.
the function is in a seperate js file:
---------------------------------------------
function showClickCoords(playerid) {
alert("X: " + " Y: ");
}
---------------------------------------------
and is working fine.
But I need the fX and fY parameters.
when using this
---------------------------------------------------------------------------------
<SCRIPT FOR="Player" EVENT="Click( iButton, iShiftState, fX, fY )" >
alert("X: " + fX + " Y: " + fY);
</SCRIPT
---------------------------------------------------------------------------------
I can use the parameters.
How do I pass the parameters to the function in the js file?
Thanks,
Oded
|
|
| Back to top |
|
 |
Neil Smith [MVP Digital M
Guest
|
Posted:
Wed Mar 02, 2005 8:16 pm Post subject:
Re: attachEvent and passing parameters |
|
|
This is only available for media player 9 or later.
Change the alert(fX+" "+fY) to call your function which then becomes
showClickCoords(fX, fY) {
alert(alert("X: " + fX + " Y: " +fY);
}
So you call it when the event is fired, from the event handler :
<SCRIPT FOR="Player" EVENT="Click( iButton, iShiftState, fX, fY )" >
showClickCoords(fX, fY);
</SCRIPT>
Cheers - Neil
On Wed, 2 Mar 2005 02:39:03 -0800, "Oded Tal" <Oded
Tal@discussions.microsoft.com> wrote:
| Quote: | Hi,
I used a function seen in this newsgroup (by Neil) to attach a click event
to a function.
the function is in a seperate js file:
---------------------------------------------
function showClickCoords(playerid) {
alert("X: " + " Y: ");
}
---------------------------------------------
and is working fine.
But I need the fX and fY parameters.
when using this:
---------------------------------------------------------------------------------
SCRIPT FOR="Player" EVENT="Click( iButton, iShiftState, fX, fY )"
alert("X: " + fX + " Y: " + fY);
/SCRIPT
---------------------------------------------------------------------------------
I can use the parameters.
How do I pass the parameters to the function in the js file?
Thanks,
Oded
|
|
|
| Back to top |
|
 |
Oded Tal
Guest
|
Posted:
Mon Mar 07, 2005 8:17 pm Post subject:
Re: attachEvent and passing parameters |
|
|
Thanks, I thought there was another way.
Oded
"Neil Smith [MVP Digital Media]" wrote:
| Quote: | This is only available for media player 9 or later.
Change the alert(fX+" "+fY) to call your function which then becomes
showClickCoords(fX, fY) {
alert(alert("X: " + fX + " Y: " +fY);
}
So you call it when the event is fired, from the event handler :
SCRIPT FOR="Player" EVENT="Click( iButton, iShiftState, fX, fY )"
showClickCoords(fX, fY);
/SCRIPT
Cheers - Neil
On Wed, 2 Mar 2005 02:39:03 -0800, "Oded Tal" <Oded
Tal@discussions.microsoft.com> wrote:
Hi,
I used a function seen in this newsgroup (by Neil) to attach a click event
to a function.
the function is in a seperate js file:
---------------------------------------------
function showClickCoords(playerid) {
alert("X: " + " Y: ");
}
---------------------------------------------
and is working fine.
But I need the fX and fY parameters.
when using this:
---------------------------------------------------------------------------------
SCRIPT FOR="Player" EVENT="Click( iButton, iShiftState, fX, fY )"
alert("X: " + fX + " Y: " + fY);
/SCRIPT
---------------------------------------------------------------------------------
I can use the parameters.
How do I pass the parameters to the function in the js file?
Thanks,
Oded
|
|
|
| Back to top |
|
 |
|
|
|
|