getURL Javascript not working in frames

Posted on 2003-11-14
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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.
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now


Accepted Solution

troglo earned 500 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).

<FRAMESET rows="*,0" scrolling="no" border="0" frameborder="0" framespacing="0">
      <FRAME name="FR_Main" src="" 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>

<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>

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

734 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