Groups | Blog | Home
all groups > macromedia flash flash remoting > april 2005 >

macromedia flash flash remoting : error calling a javascript function


zekazeka
4/22/2005 2:20:24 AM
i have a flash movie that calls a function in the html.. the function will set
a value in other flash movie also loaded in the html.

function SendVal(param){
window.document.GetInfo.SetVariable("val",param);
}

this function works well in a PC using IE, but on MAC browser's seem's that
SetVariable is invalid.
does anyone knows a substitute function that i can use in an html object, for
setting a value in a var inside a flash movie trough javascript? thnks

James Fee
4/22/2005 10:19:37 AM
this is probably because window.document.GetInfo is null on the Mac.

You would need to do something like the following:

var myMovie = document.getElementById("GetInfo");
if (myMovie != null){
myMovie.SetVariable("val",param);
}
--
Jim Fee
Viking Electronic Services
jfee (at) vikinges (dot) com


[quoted text, click to view]

kaeptn-q
4/25/2005 12:00:00 AM
Hi.

I?m trying to figure out the same thing all the day now it does not work with
both of the mentioned ways.

This problem with javascript occurs in several forums, but nobody seems to
have solution to this. even the example in the regarding technotes do not work
on mac.

IE produces an error message like "object doesn?t support method", but that
also doesnt help. i think that the flash-player-plugin should somehow extend
the methods of the object-object, but doesn?t do so.

frustrating...

tom
Cesar Mascarenhas
4/29/2005 12:00:00 AM
Sorry for the terrible english! I'm a Brazilian!
Try to make de function reload de swf file with the variable!!
like this:

Function reloadWithVariable(param){
document.getElementById("swf id here").src =
"swf_file.swf?variablename="+param;
}
works fine for me!
:-)
gaming2day
6/5/2005 8:52:21 AM
To pass dates into a .swf file I use this javascript and it works fine:

function flashDate() {

var now = new Date()

window.document.getElementById("calendar").SetVariable("myday",
now.getDate() );
window.document.getElementById("calendar").SetVariable("myorigmonth",
now.getMonth() );
window.document.getElementById("calendar").SetVariable("myyear",
now.getFullYear() );
window.document.getElementById("calendar").SetVariable("fromscript", 1); }

However, it does not work for netscape/mozilla. I've tried alternative such as:
document.getElementById("calendar").src="calendar.swf?myday="+mydate;
and
window.document.calendar.SetVariable("myday", mydate);

but no luck.

any ideas?
AddThis Social Bookmark Button