Adobe Flex - load Never complete problem

Hi,

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
Puneet
PuneetKSaxenaAsked:
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.

 
ChristoferDutzCommented:
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.
0
 
PuneetKSaxenaAuthor Commented:
HI

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

0
 
ChristoferDutzCommented:
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
ExternalInterface.call(methodName:String, [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:
http://www.adobe.com/devnet/flash/articles/external_interface_05.html

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.
http://www.actionscript.org/forums/showthread.php3?t=152069&page=2
0
 
PuneetKSaxenaAuthor Commented:
HI,

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
http://www.actionscript.org/forums/showthread.php3?t=152069&page=2.

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

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

Open in new window

0
 
ChristoferDutzCommented:
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.
0

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.