You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by sanloflex <sa...@gmail.com> on 2014/12/08 10:57:32 UTC

How to get the content of the html while the flex iframe is loaded with html file?

Hi, 
   In my flex module, I'm loading a html in flex iframe component. The user
may click a link in the html to load another html within the same iframe. 

  How to determine when the iframe is loaded with the new html content?
Right now, I'm using *frameLoad* event and in the handler function, I'm
having an idea to analyze the content of the loaded html by using the iframe
object's *content* property.

  But, While the handler function is called upon the *frameLoad* event, the
iframe's content property is always gives 'null'. From the loaded html, I
need to get the title tag value and set it as the title of the flex module.

  Kindly, Please share your views.

<iframe:IFrame id="frame" 
							 left="0" right="0" top="0" bottom="0"
							 overlayDetection="true"
							 frameLoad="frameLoadHandler(event)">
		</iframe:IFrame>

protected function monitorIframe_frameLoadHandler(event:Event):void {
				trace(frame.content); // always gives null
		   }



  



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-to-get-the-content-of-the-html-while-the-flex-iframe-is-loaded-with-html-file-tp9009.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: How to get the content of the html while the flex iframe is loaded with html file?

Posted by Tom Chiverton <tc...@extravision.com>.
On 08/12/14 13:02, sanloflex wrote:
>        Am I trying to access the content so early before the iframe is
> completely loaded? I assume the *frameLoad* event is triggered only after
> the html is completely loaded in it. Do I need to have any setTimeout for
> accessing the html content in the iFrame?
Well, that's easy to try; can you access it from the JavaScript console ?

If so, you probably just want to observe the IFrame from the page that 
hosts your .swf, and send events into the .swf when the page changes ?

Tom

Re: How to get the content of the html while the flex iframe is loaded with html file?

Posted by Bruno Ramos <br...@yahoo.com.br>.
Hi sanloflex.

I'm having the same problem. Did you solve it?



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: How to get the content of the html while the flex iframe is loaded with html file?

Posted by sanloflex <sa...@gmail.com>.
Hey Tom, 
            I'm loading the html from the server of same domain. No issues
in that. But, I'm not getting the loaded html content from the iFrame's
content property. It gives null though the iframe is loaded with the html
file. Using the loaded html content, I have to change the flex page title.

      Am I trying to access the content so early before the iframe is
completely loaded? I assume the *frameLoad* event is triggered only after
the html is completely loaded in it. Do I need to have any setTimeout for
accessing the html content in the iFrame?

           

 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-to-get-the-content-of-the-html-while-the-flex-iframe-is-loaded-with-html-file-tp9009p9012.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: How to get the content of the html while the flex iframe is loaded with html file?

Posted by Tom Chiverton <tc...@extravision.com>.
On 08/12/14 09:57, sanloflex wrote:
>    How to determine when the iframe is loaded with the new html content?
> Right now, I'm using *frameLoad* event and in the handler function, I'm
> having an idea to analyze the content of the loaded html by using the iframe
> object's *content* property.
Depending on the URL of the IFrame, you may not be able to read the 
contents or even the URL because of the browser's cross domain security 
model.

What exactly are you trying to achieve ? If you are loading your own 
HTML content from a server, you may be able to signal these clicks back 
through a different method, for instance.

Tom