Solved

getURL Javascript not working in frames

Posted on 2003-11-14
6
672 Views
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:
getURL("javascript:alert('TEST!')","_self");
but this works fine:
getURL("javascript:alert('TEST!')","_blank");

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?
0
Comment
Question by:ardivus
6 Comments
 
LVL 27

Expert Comment

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

getURL("javascript:function(params)","frame_name");
0
 

Author Comment

by:ardivus
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.
0
 

Author Comment

by:ardivus
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.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Accepted Solution

by:
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).

Page www.domain1.es/INDEX0.HTML
<HTML>
<HEAD>
</HEAD>
<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>
</FRAMESET>
</HTML>

Page www.domain2.es/INDEX1.HTML
<HTML>
<HEAD>
</HEAD>
<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>
</FRAMESET>
</HTML>

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 :)
0
 

Expert Comment

by:epowder
ID: 10257262
troglo

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

0
 
LVL 1

Expert Comment

by:troglo
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 :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now