ExternalInterface.available returns false on a Mac
hi there!
i'm triyng browsers back-button work flash site. general principle this:
there index.html page containing (not yet) hidden iframe , flash movie.
the iframe contains page a, starts javascript calling back-function on index-page.
the back-function triggers as-function in flash-movie activates own back-button, , changes url of iframe page b. causes new history added browser.
the flash movie contains 5 frames (labeled in middle of stage) , 2 navigation buttons: (terug) , forward (verder). buttons you'd expect them (prevframe , nextframe).
on pc (ie) seems work pretty well. on mac nothing seems work propperly.
i've got testpage at: http://www.multimediamatters.nl/test
here's code have on first frame.
stop();
_root.terug.onrelease = function(){
prevframe();
}
terugf = function(){
trace(_root._currentframe);
if (_root._currentframe > 1){
_root.terug.onrelease();
}
else {
_root.geturl("javascript::history.go(-2)");
}
}
import flash.external.*;
var isavailable:boolean = externalinterface.available;
var txtfield2:textfield = this.createtextfield("txtfield", this.getnexthighestdepth(), 300, 0, 200, 50);
txtfield2.border = true;
txtfield2.text = "externalinterface.available = "+isavailable.tostring();
var methodname:string = "gohome";
var instance:object = null;
var method:function = terugf;
var wassuccessful:boolean = externalinterface.addcallback(methodname, instance, method);
var txtfield:textfield = this.createtextfield("txtfield", this.getnexthighestdepth(), 0, 0, 200, 50);
txtfield.border = true;
txtfield.text = "externalinterface.addcallback = "+wassuccessful.tostring();
somehow externalinterface doesn't seem loaded. suggestions solve this?
thanks in advance.
yours,
andra
p.s.
the condition if (_root._currentframe > 1){ doesn't work on pc either. calls _root.terug.onrelease(). can't figure out why...
woops!! guess wasn't paying enough attention...
on mac using internet explorer, both externalinterface.available , externalinterface.addcallback return false. using button reload page iframe, doesn't execute as-functions.
using safari, both return true. however, using button reloads entire index.html instead of loading page iframe. means flash-movie reloaded aswell, you're automatically @ frame 1.
is there way working properly?
yours,
andra
on mac using internet explorer, both externalinterface.available , externalinterface.addcallback return false. using button reload page iframe, doesn't execute as-functions.
using safari, both return true. however, using button reloads entire index.html instead of loading page iframe. means flash-movie reloaded aswell, you're automatically @ frame 1.
is there way working properly?
yours,
andra
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment