Hi All,

 

I have two flash objects in form in htmlPage .I am using
externalInterface API to call and receive values from javascript.At each
refresh of my web page I receive weird error which says: "Out of memory
at line 56"; I read a blog from deconcept but the solution given there
didn't worked

Have anyone of u experienced such problem? This is the code which I m
using 

 

<html >

<head>

 

<script language = "Javascript">

 

function leave(){

 

var objects = document.getElementsByTagName("OBJECT");

 

  for (var i=0; i < objects.length; i++) {

    for (var x in objects[i]) {

      if (typeof objects[i][x] == 'function') {

        objects[i][x] = null;

      }

    }

  }

 

 

}

 

var count = 0 

var gBodyTextCount =1

function fnLoadingFinish()

 

                        {

                                    

                                    if(count == gBodyTextCount)

                                    {


                                                ValueToInsert = "I m
called"

                                                

 
window.testObj.fnGetValue(ValueToInsert);

 
window.testObj1.fnGetValue(ValueToInsert);

                                                            

                                                

                                    }

                                    else

                                    {

                                                 count++ ;


                                    }

                        }

 

 

                        function thisMovie(movieName) {

                                    if
(navigator.appName.indexOf("Microsoft") != -1) 

                                    {

                                                return window[movieName]

                                    }

                                    else

                                    {

                                                return
document[movieName]

                                    }

                        }           

</script>                                   

 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>

<title>TextEditor</title>

</head>

<body bgcolor="#ffffff" onUnload="leave()" >

<form name = 'Text' >

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=8,0,0,0" width="349" height="113" id="testObj" name
='testObj' align="middle">

<param name="allowScriptAccess" value="always" />

<param name="movie" value="TextEditor.swf" /><param name="quality"
value="high" /><param name="bgcolor" value="#ffffff" /><embed
src="TextEditor.swf" quality="high" bgcolor="#ffffff" width="349"
height="113" name="testObj" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"; />

</object>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl
ash.cab#version=8,0,0,0" width="349" height="113" id="testObj1" name
='testObj1' align="middle">

<param name="allowScriptAccess" value="always" />

<param name="movie" value="TextEditor.swf" /><param name="quality"
value="high" /><param name="bgcolor" value="#ffffff" /><embed
src="TextEditor.swf" quality="high" bgcolor="#ffffff" width="349"
height="113" name="testObj1" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"; />

</object>

 

 

 

 

</form>

<script language="Javascript">

window.testObj=window.Text.testObj;

window.testObj1=window.Text.testObj1;

 

</script>

 

</body>

</html>

 

 

And the code inside the flash is movie is as follows

 

import flash.external.*;

_root.maxCharacters = _root.maxChars;

function fnGetValue(str) {

            if (str == null or str == "null") {

                        main_mc.mytxt.htmlText = "";

                        

                        tatal_txt.text = 0;

            } else {

                        main_mc.mytxt.htmlText = str;

                        

                        var num = main_mc.mytxt.text.length;

                        if (Number(num)>_root.maxCharacters) {

 
} else {

                                                }

                        if (main_mc.mytxt.text.length>=1) {

                                                } else {

                                                }

            }

}

fnSetValue = function (id) {

            str = main_mc.mytxt.htmlText;

            var len = main_mc.mytxt.text.length;

            //getURL("javascript:fnValues('"+str+"')");

            ExternalInterface.call("fnTextValues", str, id, len);

};

var methodName:String = "fnGetValue";

var instance:Object = null;

var method:Function = fnGetValue;

var wasSuccessful:Boolean = ExternalInterface.addCallback(methodName,
instance, method);

/////////////////////////////////////////

var methodName1:String = "fnSetValue";

var instance1:Object = null;

var method1:Function = fnSetValue;

var wasSuccessful1:Boolean = ExternalInterface.addCallback(methodName1,
instance1, method1);

Stage.showMenu = false;

ExternalInterface.call("fnLoadingFinish");

stop();

 

 

Please help me out

 

Regards

Sumeet kumar

 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to