Solved

Flash button for JavaScript OnClick event

Posted on 2004-04-28
10
982 Views
Last Modified: 2007-12-19
Hi,

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,

Tsiki
0
Comment
Question by:tsikiB
  • 4
  • 2
10 Comments
 
LVL 2

Expert Comment

by:SatanUK
ID: 10937255
change the onrelease event in the Actionscript to
GetURL("javascript:FunctionName(Params);")
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) ?
0
 

Author Comment

by:tsikiB
ID: 10938819
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,
0
 
LVL 2

Expert Comment

by:SatanUK
ID: 10938861
No, No take the onclick="MyFunction" out of the HTML

and put in the Actionscript of the button in Flash

OnRelease
{
GetURL("javascript:MyFuntion();")
}

you may need to get your funtion to return 0 or void I cant remeber which
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:tsikiB
ID: 10939581
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.
0
 
LVL 2

Accepted Solution

by:
SatanUK earned 25 total points
ID: 10939608
you need to use the GetURL fucntion
so to do an alert it would be
OnRelease
{
GetURL("Alert("my alert");")
}
0
 
LVL 19

Expert Comment

by:webwoman
ID: 10940906
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.
0
 
LVL 2

Expert Comment

by:SatanUK
ID: 10947103
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xml xsd validation free tool to download 10 76
Build and evolve an interactive experience 1 89
website content maintenance 3 80
API Soap Calls 4 91
When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now