attachEvent and passing parameters
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
attachEvent and passing parameters

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web
Author Message
Oded Tal
Guest





Posted: Wed Mar 02, 2005 3:39 pm    Post subject: attachEvent and passing parameters Reply with 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
Neil Smith [MVP Digital M
Guest





Posted: Wed Mar 02, 2005 8:16 pm    Post subject: Re: attachEvent and passing parameters Reply with 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:

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 Reply with quote

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
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB