Targeting an iFrame from Flash

  • severinsmith
  • Born
  • Born
  • No Avatar
  • Joined: Nov 20, 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
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • 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: Nov 28, 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
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post November 28th, 2006, 10:20 pm

don't know, what is bp? id of a iframe?
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • greasymok
  • Born
  • Born
  • No Avatar
  • Joined: Dec 01, 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:
Code: [ Select ]
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:
Code: [ Select ]
<iframe name="mainBody" src="http://www.google.com" height=400 width=500></iframe>


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

This should fix the problem, I've gotten it to work on both my machines.
  • ChadReitsma
  • Born
  • Born
  • No Avatar
  • Joined: Dec 01, 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 :)
  • hercilio
  • Born
  • Born
  • No Avatar
  • Joined: Dec 23, 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: Feb 17, 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: Aug 04, 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: Sep 05, 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: Apr 19, 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: May 08, 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: Apr 19, 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:

Code: [ Select ]
<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
  • bozboz
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 13, 2007
  • Posts: 31
  • Loc: Brighton
  • Status: Offline

Post September 6th, 2008, 3:14 pm

Ive just been nededing to do this and simple getUrl worked fine in AS3
  • caiva
  • Born
  • Born
  • No Avatar
  • Joined: Sep 26, 2008
  • Posts: 3
  • Status: Offline

Post September 26th, 2008, 12:53 pm

I have a problem wiht Flash 8!!
I write:

myclip.onPress = function(){
getURL("pageToLoad.htm","iframe");
}

but it doesn't load into iFrames properly. It tends to open the file in a new window.

i did what h.kleinveld said, but dosen't work!!

i need help!!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 26th, 2008, 12:53 pm

Post Information

  • Total Posts in this topic: 33 posts
  • Users browsing this forum: No registered users and 33 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.