Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
v-Jay #1
Type Error with ExternalInterface.call();
Hi...
I am calling javascript function of wrapper from flex. The funcation is
called but when it return a value , the value is not returned to flex.
The same value if i print using alert in javascript its value is printed.
my javascript code is like this...
function readCookie() {
var nameEQ = "user=";
if(document.cookie!=""){
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
var decript_data="";
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) {
var temp = c.substring(nameEQ.length,c.length);
alert("temp="+temp);
decript_data=des("validation",temp,0,1,"name",0);
alert("user="+ decript_data); // it prints value of decript_data
return decript_data;
}
}
}
return null;
}
i am calling this function from flex as;
private function userSession():void{
var usrData:String;
usrData=ExternalInterface.call("readCookie");
}
when i run the application , i am getting this error:
TypeError: Error #1085: The element type "string" must be terminated by the
matching end-tag "</string>".
at flash.external::ExternalInterface$/call()
at builds/userSession()
at builds/LoadFilterVal()
at builds/___Application1_creationComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()
..returning a simple string from javascript is returned well to flex , but wen
a variable containing string is returned the above error occurs..
Please any one can help me to solve this problem.
v-Jay Guest
-
Problem with ExternalInterface.call and InternetExplorer
Hi, I´m developing a site, (http://www.gen-studio.com/avelart2/), and I´m using a swf to display a set of thumbs that when clicked show an item and... -
Return value from ExternalInterface.call method
Hi people, I can not achieve to get any return value from javascript other than null. In th HTML container I have a functions like this: ... -
ExternalInterface.call performance question
Hi, I'm using Flash 8, using XML.Load to get some data from another site and returning it to the browser world thru a callback using... -
Error: Webcontrol must have items of type X. SubLinks is of type Y
Hi, I have made a web control that has two sorts of items. The first is the Links property that has a persistence attribute of InnerProperty, the... -
Cast from type 'DBNull' to type 'String' is not valid error
Trying to add an insert button Sub btnAddRow_Click event for adding a row to the datagrid and dataset back to SQL. Had it working per the... -
slaingod #2
Re: Type Error with ExternalInterface.call();
It may be that you are returning something to Flex that isn't being converted
to Object nicely, like something xml-ish. What does your alert show? You
might want to try escaping the string with > < or something to see if the error
stops, then go from there.
slaingod Guest



Reply With Quote

