I’ve used asfunction before to call functions from the html, but in my current project it is not working. I am trying to use one frame for my entire project for the first time and think this may have something to do with it. Here is whats happening:
I have a menu system, that when clicked goes to a frame on the content movieclip and runs a function for that frame. i.e. you click “about”, it goes to content_mc.gotoAndStop(“About”) and runs a function called LoadAbout (from the main timeline). The LoadAbout loads an external textfile, and in the textfile there is the following <a href=‘asfunction:ClickHere’> Click Here </a>, the Click here is then clickable but the function is not working. Within LoadAbout, after the external text loader, there is a function ClickHere():Void {
trace(“clicked”);
here is the actual code, on the first frame of the main timeline:
//About Page
function LoadAbout():Void {
loadMovie("Images/About/Owner.jpg", "content_mc.ownPic_mc.picLoader_mc");
loadMovie("Images/About/Techno.jpg", "content_mc.techPic_mc.picLoader_mc");
ownerLoadVars = new LoadVars();
ownerLoadVars.onLoad = function() {
content_mc.owner_txt.htmlText = ownerLoadVars.ownerData;
};
ownerLoadVars.load("Data/About/owner.txt");
technoLoadVars = new LoadVars();
technoLoadVars.onLoad = function() {
content_mc.techno_txt.htmlText = technoLoadVars.technoData;
};
technoLoadVars.load("Data/About/techno.txt");
function ClickHere() {
trace("Clicked");
}
}
the asfunction tags are in the techno.txt file, again i’ve used this before but can’t determine why its not working.
Thanks