Hello to All!
JS can access my SWF without problems but
I'm having trouble to go to my JS Calback swf,
My JS:
<script language="JavaScript" type="text/javascript">
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function sendToJavaScript(value) {
var teste = value;
thisMovie("aplicativo_1").foo();
}
</script>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="aplicativo_1" width="600" height="500"
codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab">
<param name="movie" value="http://joaocarlos.com.br/reliase/
aplicativo_1.swf" />
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="http://joaocarlos.com.br/reliase/aplicativo_1.swf"
quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="aplicativo_1" align="middle"
play="true" loop="false" quality="high"
allowScriptAccess="sameDomain" allowFullScreen="true"
allowScriptAccess="always" type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
And my ActionScript:
public function onFrame2():void {
ExternalInterface.marshallExceptions = true;
isAvailable = ExternalInterface.available;
availTxt = new TextField();
availTxt.text = isAvailable.toString();
addChild(availTxt);
var texto:String = "opss!!!"
try{
ExternalInterface.addCallback("foo", foo);
}catch (e:SecurityError) {
trace(e)
}
try{
ExternalInterface.call("sendToJavaScript",
texto );
}catch (e:SecurityError) {
trace(e)
}
}
public function foo(t:String = null):void {
try {
availTxt.text = "hahahahahah" + t;
addChild(availTxt);
}catch (e:Error) {
trace(e)
}
try {
throw new Error("exception from
actionscript!!!!")
}catch (e:Error) {
trace(e)
}
}
I'm a few days suffering from this, please if they have a solution
thanks for your help.
--
You received this message because you are subscribed to the Google Groups
"Orkut Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/opensocial-orkut?hl=en.