Adobe Flex - load Never complete problem


In my Flex Application, i'm using a IFrame and a button.
In IFrame i'm pasisng a URL and it displays that URL. on Clicking next button, it takes to next URL in the IFrame.

When i click on next button, I'm getting error:
error #2044: Unhandled IOErrorEvent:.  text=Error #2036: Load Never Completed

It seems that load of first Iframe didn't completed on clicking next Button and i get this error.

Could you please suggest any suitable solution  for this, either to completely remove this error or to just avoid the PopUp message .

Please suggest as this is very urgent in my project.

Thanks and Regards
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you "embedding" an Iframe in your Flex applictaion and the Button is a Flex button? At the moment it sounds as if this question would fit much better in a HTML or JavaScript zone.
PuneetKSaxenaAuthor Commented:

Yes. This is complete Flex Application which contains Iframe and Button.

This approach does nothing else than to use the Flex Externalinterface to make the browser create an IFrame and position it to fit the position and size of the virtual component in the flex application. As soon as this component is resized, moved, shown or hidden, these changes are relayed to the IFrame by usinf ActionScript to execute JavaScript in the page which then changes the Iframe.

I have no Idea of how your component is working in detail, but the message you are writing about lets me assume that it takes quite some control over a lot of features of the IFrame. Unfortunately it seems to be not that perfekt.

You could try using, [parameter1:Object])
To call a JavaScript function in your HTML page which does the url-changing for you instead of the flex component. You would sort of short-circut the component, but you would also avoid the error message.

Using the Externalinterface:

Another interesting thing might be this discussion handling your Problem exactly ... Read it to the end, there the guy seemed to have found out what the problem was ... something with page headers.
PuneetKSaxenaAuthor Commented:

This is the exact behavior which is used in Iframe in my application also.
I'm not sure how to use the code given in

But i'll try 1st Approach of External Interface.
Could you please specify in detail how to use the External Interface in my scenarion

var loader: Loader = new Loader ();
loader.load(new URLRequest("anyImage.jpg"));

Open in new window

Well the Component will create a dynamic IFrame. This will have an ID that is somehow related to the id of the Flex component. I'd suggest to find out which one manually by using Firebug or InternetExplorer Toolbar.

As soon as you have the Id Id suggest you create a JavaScript function in your embedding HTML file, which takes two parameters. The Id of the IFrame and the Url you want it to display.
In this function you do something like
var iframeElement = document.getElementById(iframeId);
And replace the url it should display:
iframeElement.location = newUrl;

Now all you have to do is to call this function using the external interface.

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.