Selteco.com > FlashDesignerZONE.com > Tutorials > T1015

How to invoke JavaScript function from a Flash file.

Define JavaScript function in HTML page:

function coloritem(itemname,itemcolor)
{
	itemname.style.color = itemcolor;
}

Assign ID to the object:

<h3 id="t1015" style="color:#000000;">How to invoke JavaScript function from a Flash file.</h3>

Call JavaScript function in Flash using OnClick action:

javascript:coloritem(t1015,'#FF0000');

Export Flash file ("File" > "Export Flash SWF File") to the same folder where HTML page is placed, and embed Flash animation in HTML using OBJECT and EMBED tags (generate the code with "File" > "View HTML Code" command)

Products | Purchase | Downloads | Support | Flash Tutorials | Contact
Copyright © 1999-2017 Selteco Software, Inc. www.selteco.com, ph: +1 810 377 5778