Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

navigateToURL inside HTMLLoader

Community Beginner ,
Feb 07, 2014 Feb 07, 2014

Hello guys,

I need help on this.

An HTMLLoader is loading a SWF.

Inside that SWF at some point the user can press a button to invoke a navigateToURL.

That navigateToURL is opening an URL to a report.

If the loaded SWF is used directly inside a browser it works (opens a new window in the browser), but when loaded in the HTMLLoader it doesn't work.

How can I call with success a navigateToURL inside HTMLLoader?

The loaded SWF could be not compiled in AIR (because it is also used in browser).

TOPICS
ActionScript
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2014 Feb 07, 2014

If you are loading an swf you can just use the Loader class.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2014 Feb 07, 2014

Thank you Ned for your reply.

I think I can't use a loader.

My hierarchy is:

Native Window -> HTMLLoader -> SWF -> open link

In some situations is:

Native Window -> HTMLLoader -> SWF -> SWF -> open link

I want to open the link on a browser, but it looks like since the SWF is HTMLLoader wrapper I can't do that.

The link I'm trying to open is somethink like: http://domain.com/docs//docprint.aspx?id=01&year=2014

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2014 Feb 07, 2014

I do not see/understand how your hierarchy prevents you from using a Loader.  HAve you tried it?  Normally an HTMLLoader is used for loading an HTML page into an swf, but I don't see that in what you describe.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2014 Feb 09, 2014

Hello again Ned.

The SWF is loaded with the HTMLLoader because the SWF needs some session vars to work.
That variables are passed using URLVaribles on the URLRequest.

Case 1

The user can access SWF1 using a browser.

Imagine SWF1 embed on a ASPX. SWF1 needs a token to validate a session login and some other data, to run.

The login was made on the APSX page. The SWF1 is embed with SWFObject and the vars passed as parameters on the SWFObject.

Case 2

The user can access SWF1 using an AIR application.

Now the same situation must happen on a AIR application. The same  SWF1, needs to be loaded and the vars passed to SWF1, but the vars now came from the AIR application.  Native Window -> HTMLLoader -> SWF1 -> open link (navigateToURL)

Right now everything is working fine, with one exception.

SWF1 needs to open a new tab/window at some point. When the SWF1 is embed on the ASPX everything works. To accomplish this a call to navigateToURL is used.

When SWF is on the AIR application the the navigateToURL doesn't work.  It makes sense, since it is loaded is inside the HTMLLoader... and what a really wanted to happen is the browser to open  with the link provided on the navigateToURL.

I think I can fix this if the navigateToURL is called on the NativeWindow. But I don't know how to communicate from SWF1 to NativeWindow with the HTMLLoader between then.

Any solution for this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2014 Feb 10, 2014
LATEST

I friend at work helped me out on this one...

I order to open links on the browser HTMLoader needs to have navigateInSystemBrowser set to true;

htmLoaderInstance.navigateInSystemBrowser  = true;

Now, the link inside SWF1 opens on the browser.

Just need to pass the session data...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines