PDA

View Full Version : Javascript call not working in Safari



MDiddy
September 19th, 2006, 11:59 AM
I have a dynamic text field where I create an html link based on a couple of pieces of data.

Here's an example of the code for the link:

var aTag:String = "<p class = 'landing'><a href=\"javascript:openVidPlayer('/vidplayer.html?video="+sel.v_id+"&category="+sel.cat+"');\" target = '_parent'>"+sel.ttl+"</a></p>";

My problem is that the popup works fine in Windows IE, Mac/Win Firefox just fine. It won't work in Safari. It shows as link, but when you click, nothing happens. Can anyone think of a reason why this wouldn't work?

I also have an onPress handler on a movieclip that won't work in Safari:

main_mc.onPress = function() {
getURL("javascript:openVidPlayer('/vidplayer.html?video=" + sel.v_id + "&category=" + sel.cat + "');", "_parent");
};

Ordinathorreur
September 19th, 2006, 01:57 PM
I have experienced similair Javascript/Flash problems before and using the Flash/Javascript Integration kit is the only cross platform solution I know of.

I wrote a blog post (http://www.danieltodd.com/blog/?p=21) on it that you might want to read.

MDiddy
September 19th, 2006, 04:01 PM
I'm using Flash 8. Doesn't ExternalInterface deprecate this?

Sinister Rouge
September 19th, 2006, 08:35 PM
Yeah, I would check out the ExternalInterface class. You can then define the function on the html page or in a .js file and call it from within flash.