Can I put a Javascript link in a flash file?
Moderator: General Moderators
Can I put a Javascript link in a flash file?
I've designed a small flash menu system. I want some ajax function to be called. I wanted to ask if I can put a <a href="javascript:void()" onClick="function();"/> as the link in that flash file? Will it call the function?
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I have never used javascript to do what you are doing... but I have used javascript and flash together many times. In my case, it was just to make popup windows with specified dimensions and such. But anyway, in my experience what works is to define the javascript function in your html page and then call it from flash. Hope that helps.
Code: Select all
JavaScript - http://127.0.0.1/css/index.html
Javascript URL thread: "javascript:void(0)" onclick="sendDetails('home');new Effect.Appear('bodycontent');"
Syntax error while loading: line 1 of unknown script :
void(0)" onclick="sendDetails('home');new Effect.Appear('bodEnter the URL:____________________________
target = _blank or _parent or _self or _top
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
Building on that, in your first post you used "javascript:void(0)" as your href, and "function()" as your onClick, as you may have some trouble using onClick within flash you can simply use "javacript:function();" as your href (or URL), if you didnt already know.superdezign wrote:Then there's your answer. Just use links.