Saturday, 31 August 2013

Using callIFrameFunction to send multiple args Flex

Using callIFrameFunction to send multiple args Flex

I'm using IFrame to load an gmaps page in my Flex application. I need to
pass latitude and longitude to my javascript function in the html loaded
by the Frame. These are my functions.
Flex:
private function createMarker(event:MouseEvent):void{
var position : Array = [-25, 130];
IFrame.callIFrameFunction('putMarker', position);
}
JS:
document.putMarker= function(latitude,longitude){
var myLatlng = new google.maps.LatLng(longitude, longitude);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}
When i send just one of argument the function works fine, but when i try
to send two or more arguments i fail.
Can anyone help me?

No comments:

Post a Comment