Go Premium for a chance to win a PS4. Enter to Win


getURL Javascript not working in frames

Posted on 2003-11-14
Medium Priority
Last Modified: 2012-06-21
I have a flash movie that has to be in flash 5 (ungh).

It is in a page with two frames.
The frameset and the content in each of the frames are generated by JSPs, to which I have little access.

I cannot get the movie to properly call a javascript function from one of the frames when I target it to any of the frames in that frameset.  If I target a new window like '_blank' it works fine.

for example, this does not work:
but this works fine:

When I hit the page by itself, outside of the frameset, it works fine.

When I view source, and take the HTML code generated by the JSPs, then save them locally on my machine, the flash and the javascript work fine, even in the frameset.

So, for some reason the javascript can't run javascript when targeted to the page it comes from, when they are built with the jsps.

Some wierd stuff that the site does:
The JSPs that build the frameset and the top frame are on one server, and the JSP that builds the frame with the flash is on a different server (both local).  There are 2 JSPs that build the frame with the flash, the first builds a session variable, then adds it as a parameter to the jsp that builds the actual page.

Well, that is a lengthy explanation, but I am sure that it still isn't sufficient info.

Has anyone ran into a similar problem and found what caused it?
Question by:ardivus
LVL 27

Expert Comment

ID: 9752253
this doesn't work, does it?


Author Comment

ID: 9752302
Nope.  In fact, it acts pretty funny,

When I try to target either of the frame names (the frame it is in, or the frame above it), it behaves just the same, like it can't do javascript.
Then, I broke it out of the frame, but kept the page open that had it in the frame.
When I tried it in the un-framed instance, it acted like it was framed still, until I closed the framed instance, then the same un-framed instance  started working.

I guess IE recognized that that frame name still existed until it was closed.

Another point of interest:
Everything works perfectly in Mozilla based browsers.  (I tried  Firebird, in Netscape 7.0, and in Netscape 4.7).
So far it is only a problem in IE.  I am running IE 6.0.2800.1106.
In IE I am using flash player 7.

Author Comment

ID: 9765171
Here's more info:

I am just using alert() for testing purposes.
The real js function I am trying to call loads a page, and does a couple other things.

The real function (doLogin()) behaves the same as I have described for alert().  It works fine when the page isn't in frames, and when I copy the generated HTMl and run locally on my computer, but when the pages are generated by the JSPs, it clicks, but acts like it can't run javascript.

now, if I build a similar URL to what the javascript is doing, and use getURL() in the flash, rather than calling the javascript, it works everywhere fine.

On one person's IE browser, when they clicked on the link, it pulled up a "page can't be displayed" error, with "javascript:doLogin()" in the address bar.  For everyone else that tried it, it just clicks and doesn't do anything.

So... I am sure that getURL is working like it should.  Just for some reason, under certain circumstances it can't call javascript.  Unfortunately, I really need to be able to call the JS, and not go to the URL straight from the flash.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Accepted Solution

troglo earned 2000 total points
ID: 10255033
I had the same problem (our frame page was in a different domain than our flash page) and I´ll tell you the way we solved it, is a bit strange (but it worked for us, so good luck). In brief, instead of using just 1 frame page, we made 2 frames pages (page 0 opened page 1, both were frame pages and each was in a different domain).

Page www.domain1.es/INDEX0.HTML
<FRAMESET rows="*,0" scrolling="no" border="0" frameborder="0" framespacing="0">
      <FRAME name="FR_Main" src="www.domain2.es/index1.html" scrolling="auto" border="0" marginheight="0" marginwidth="0" noresize>
      <FRAME name="FR_Nada" src="blank.html" scrolling="auto" border="0" marginheight="0" marginwidth="0" noresize>

Page www.domain2.es/INDEX1.HTML
<FRAMESET rows="*,0" scrolling="no" border="0" frameborder="0" framespacing="0">
      <FRAME name="FR_Main" src="index2.html" scrolling="auto" border="0" marginheight="0" marginwidth="0" noresize>
      <FRAME name="FR_Nada" src="blank.html" scrolling="auto" border="0" marginheight="0" marginwidth="0" noresize>

Page www.domain2.es/INDEX2.HTML
Is the page loading the flash, we didn´t change nothing here.

Hope this helps you, I was so frustrated with this problem (even more when I read your problem and I thought I´ll find the solution here :)

Expert Comment

ID: 10257262

how in heaven did you find that ? I have been looking for sooo long for that.
Ending up with new pages opening after the frameset, but that changed the domain name in the address bar.

I have been here many times, finding this post in Google.

You are my expert

Thanks soo much


Expert Comment

ID: 10257507
Don´t ask me...things you try before you get mad :)

Nice to know it works to other people too; I didn´t know if it was a solution or just luck

I supposed the problem was with the two domains and the frameset combination, because in any other circunstances it worked; so I tried things to deceive Flash about the two different domains (after failing to deceive Flash about the frames).

Thanks for tell me it worked for you.

Your expert :)

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question