Targeting an iFrame from Flash

  • severinsmith
  • Born
  • Born
  • No Avatar
  • Joined: 20 Nov 2006
  • Posts: 2
  • Loc: Boston
  • Status: Offline

Post November 21st, 2006, 7:37 am

Hi Graphixboy,
thanks for the input.

It looks like it was actually just an invisible character that remained in the code. (see h.kleinveld's post earlier in this conversation for code). I just keyed it in instead of cut/paste, and the syntax errors went away.

I am still having problems getting it too work, but at least the syntax errors are gone.

Thanks again.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 21st, 2006, 7:37 am

  • graphixboy
  • Professor
  • Professor
  • No Avatar
  • Joined: 11 Jul 2005
  • Posts: 752
  • Loc: Minneapolis, MN
  • Status: Offline

Post November 21st, 2006, 8:01 pm

Yeah Flash is touchy about how you write your code (as any good programming language should be). Glad that took care of everything.
  • mackmann
  • Born
  • Born
  • No Avatar
  • Joined: 28 Nov 2006
  • Posts: 1
  • Status: Offline

Post November 28th, 2006, 12:47 pm

Please tell me what am I doing wrong


on (release)
{
getURL("blueprint_if.html#4","bp");
}

Thanks

Post November 28th, 2006, 10:20 pm

don't know, what is bp? id of a iframe?
“All you need in this life is ignorance and confidence, and then success is sure. ”
  • greasymok
  • Born
  • Born
  • No Avatar
  • Joined: 01 Dec 2006
  • Posts: 1
  • Status: Offline

Post December 1st, 2006, 2:45 pm

OK, I have been trying to target iframes from flash on two different computers, and on only one of them does it work like it is supposed to. I have found however, that by using javascript, the flash getURL function can load a url into an iframe.

In the flash file, put:
getURL("javascript:loadPage('" + link + "','" + iframe + "')")

where link is the page you want to load and iframe is the name of the iframe

Make sure the iframe has a name defined in the html file:
<iframe name="mainBody" src="http://www.google.com" height=400 width=500></iframe>


Add the following code inside the html file's <head> tag:
<script language="javascript" type="text/javascript">
<!--
function loadPage(link, frameName) {
   frames[frameName].location.href = link;
}
// -->
</script>

This should fix the problem, I've gotten it to work on both my machines.
  • ChadReitsma
  • Born
  • Born
  • No Avatar
  • Joined: 01 Dec 2006
  • Posts: 1
  • Loc: Calgary Alberta Canada
  • Status: Offline

Post December 1st, 2006, 2:53 pm

+++ FIXED +++

I got it to work by simply replacing the double-quotes around the iframe name with single quotes! - Tested in FireFox and IE

doesnt work: getURL("mypage.html","myWindow");
WORKS! getURL("mypage.html",'myWindow');

Enjoy :)
<CR>
  • hercilio
  • Born
  • Born
  • No Avatar
  • Joined: 23 Dec 2006
  • Posts: 1
  • Status: Offline

Post December 23rd, 2006, 6:42 pm

Hi,

I tried all the ways that you talk here, and no one works. So i visited the macromedia website and update my Flash Professional 8 and it start working with the normal code:

on (release)

{

getURL("link","iframe");

}
  • niekdekker
  • Born
  • Born
  • No Avatar
  • Joined: 17 Feb 2007
  • Posts: 1
  • Status: Offline

Post February 17th, 2007, 4:17 am

I've spent a few hours finding the solution for this problem.

After a while I found out that if I published my buttons as flashplayer 7 instead of 8, the code worked. And this would mean that macromedia just didn't program flash 8 right, that with the initial install of macromedia flash 8 this code doesn't work.

So I went to macromedia.com and I updated a lot of stuff for flash 8, and now it works! I can't tell you which install fixed this problem, I installed about 5 updates. I suggest you try them all:

http://www.adobe.com/support/flash/down ... tml#flash8
  • wpanther
  • Born
  • Born
  • No Avatar
  • Joined: 04 Aug 2007
  • Posts: 1
  • Status: Offline

Post August 4th, 2007, 7:10 am

Hi to everyone!
The fallowing simple code works correctly:

on (press) {
getURL("YOUR_URL_ADD", " YOUR_IFRAME_NAME ");
}

The problem isn't from the code if the code doesn't work correctly (opening the url on a new window instead of the iframe)
Actually, the code works correctly, but you can see it just when you upload the files on your host.
When you test the flash file locally (on your pc) the browser can't open the url on the iframe and opens it on a new windows!
Don't worry, when you upload those, browser opens the url on the iframe. You can test it now! :)
  • am9e
  • Born
  • Born
  • No Avatar
  • Joined: 05 Sep 2007
  • Posts: 1
  • Status: Offline

Post September 5th, 2007, 9:20 am

Hello Everyone

I have tried everything as you guys said in here to open a link from flash in an iframe in the main page, my iframe name CONTAINER and the url is TEST.ASP, iam using Flash CS3 Pro, anyone can help me out with a working trick to get this page to be opend in the CONTAINER?

Thanks in advance!
  • Firemaster
  • Novice
  • Novice
  • No Avatar
  • Joined: 19 Apr 2008
  • Posts: 22
  • Status: Offline

Post April 21st, 2008, 2:08 pm

Hey everyone!

I know this is an old thread and I came across it this weekend. I have been looking for something like this for awhile for feature for one of the websites I run. I was wondering if put the flash in the same html document as the iframe does the flash know the frame is there? I don't all that much experience with flash so bear with me. Also by loading the iframe with flash is this only for if you are bring a iframe into the flash document? I am trying to do this for a fire department website where we are going to have the rigs (fire trucks) in the flash document and you will be able to click on the compartment to see what is in that compartment once it is clicked it will load an html file in an iframe. Every side of the truck will not be shown at once but there will be buttons to go to different scenes of the flash movie. I just want to get some advice and to see if I am on the right track.

Thanks,

Chris
  • mandee
  • Born
  • Born
  • No Avatar
  • Joined: 08 May 2008
  • Posts: 1
  • Status: Offline

Post May 8th, 2008, 4:15 am

Hi. I kinda have the same problem with loading html files using flash buttons. I have tried both the ajax method from another forum and this iFrameLoader. Neither of them have worked. Any other ideas please?

Basically, I have a main page "frames.html" which containes my iFrame and loads my "index.html" (flash aniamted file) into the iframe. That works fine.

Now on my "index.html" file, I have flash animated buttons. I would like to have other html pages load into my iframe when I click on the flash animated buttons. Any bright ideas????
  • Firemaster
  • Novice
  • Novice
  • No Avatar
  • Joined: 19 Apr 2008
  • Posts: 22
  • Status: Offline

Post May 8th, 2008, 9:13 am

Yea this would be great if one of flash experts out there can help us out. I also found a javascript I want to use for my iframe that will ajust the height of the iframe to the height of the html file so that there is no scroll. The thing I am wondering about is this they suggest doing this for the link markup:

  1. <a href="javascript&#058;loadintoIframe('myframe', 'external.htm')">Link</a>


Does anyone also have any ideas for this besides my last post above?


Thanks,

Chris

Post Information

  • Total Posts in this topic: 28 posts
  • Moderators: joebert, digitalMedia, UNFLUX
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2008. Driven by phpBB © 2001-2008 phpBB Group.

 
 
 
 

Need a pre-made web design for your website?

Check out our templates here: Ozzu Templates


400+ FREE Website Templates. Download Now!