Flash button for JavaScript OnClick event


My web site use some buttons for search activities: 'Search', 'Clear' and such.
Each button runs JS follow OnClick event.

For new grafical and functional capabilities I replaced those Input buttons with Flash (*.swf) buttons.
Result: It looks & fill as flash element but the OnClick event does not do anything.
I add to my function some alerts to see where the problem is but it does not work as well.

Do I have to change my JavaScript functions to support Flash button?

Pls. your assistance,

Who is Participating?
you need to use the GetURL fucntion
so to do an alert it would be
GetURL("Alert("my alert");")
change the onrelease event in the Actionscript to
then it should call your javascript functions

when you refer to the onclick event do you mean the onclick in flash or in javascript(IE) ?
tsikiBAuthor Commented:
Unfortunately it doesn't work.
I don't have much experience on HTMLs so I add new flash button by using Dreamweaver
and I configure it through Tag editor for OnClick event: OnClick="MyFunction()" same as used by Input button

MyFunction() is local on same HTML

Following your advice I changed it in two ways
1. Through dreamweaver Tag editor to execute:  GetURL("javascript:document.MyForm.MyFunction();")
2. By replacing on HTML the OnClick expression with the above

Pls. advice,
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

No, No take the onclick="MyFunction" out of the HTML

and put in the Actionscript of the button in Flash


you may need to get your funtion to return 0 or void I cant remeber which
tsikiBAuthor Commented:
Still no change.
Alert message is working for MouseOver event but the same command does not work for either OnClick or OnRelease { Alert("my alert"); }

I put same alert in the beginning of MyFunction and it seams like it never get to that point.
You have to include the ENTIRE javascript in the FLASH piece, not in the HTML page.

Flash doesn't talk to the page that way. It's a self-contained thing. You can load text from an external text or xml file, but you can't call anything else on the page.
No you can Call javascript fuctions from the HTML page using GetURL("javascript:MyFuntion();")

its not as self contained as you might think it can post details back to a server page and get results and call functions from javascript they just need to return either 0 or void
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.