Targeting an iFrame from Flash

  • chimiwaza
  • Novice
  • Novice
  • No Avatar
  • Joined: 25 Jun 2004
  • Posts: 19
  • Status: Offline

Post August 19th, 2004, 2:32 pm

hey guys, was wondering if i can link a flash button to a <iframe> ? thanx in advance :oops:
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 19th, 2004, 2:32 pm

  • joebert
  • Packaging Tape
  • Genius
  • User avatar
  • Joined: 10 Feb 2004
  • Posts: 8654
  • Loc: Clearwater, FL
  • Status: Online

Post August 19th, 2004, 10:24 pm

Sure, In your HTML give your Iframe a name like,
<iframe src="defaultPage.html" name="frameName"></iframe>


Then just target that frame with your button in flash with getURL() like so,
button.onPress = function(){
     getURL("pageToLoad.html", "frameName");
}


Of course replace pageToLoad.html with your page & frameName with the name of your Iframe. :)
Error: 0xC0FFEE is empty
  • chimiwaza
  • Novice
  • Novice
  • No Avatar
  • Joined: 25 Jun 2004
  • Posts: 19
  • Status: Offline

Post August 20th, 2004, 1:56 pm

heheheheh thanx BRO! heee im advance in html so i knew the iframe stuff thanx for that anyways :roll: .... Thanx in advance for the flash part :lol:

Post March 1st, 2006, 1:11 pm

wow thanks this is just what im after, i need an frame to load when the movie loads, does any one know how to change this code from a button press to load the iframe when the flash loads?

Post March 2nd, 2006, 12:16 am

in the first frame of your flash, put this code:
onEnterFrame = function()
{
  if (getBytesLoaded() >= getBytesTotal())
  {
      delete onEnterFrame;
      getURL("pageToLoad.html", "frameName");
      gotoAndPlay(2);
  }
}
stop();

Post March 3rd, 2006, 9:24 am

:D thanks very much IceCold!
  • URanimEnigma
  • Born
  • Born
  • No Avatar
  • Joined: 30 Aug 2006
  • Posts: 3
  • Status: Offline

Post August 30th, 2006, 8:09 pm

I came across this forum by using google. I thought I should join seeing that it could help my website development issues. I noticed that this particular topic was created in the year 2004. But, this is two years later. I'm trying to say that, I have a similar problem but, with flash pro 8. I'm a bit new to it. Well, the code that is posted here to target an iframe using flash doesn't work with flash 8. I was wondering if someone could help me. The following code was given to me by a moderator but, it doesn't work either. I thought I'd give it for reference.

on (press) {
loadInFrame("page.html")
}
function LoadInFrame (html) {
getURL(html, "main")
}
  • h.kleinveld
  • Born
  • Born
  • No Avatar
  • Joined: 29 Sep 2006
  • Posts: 1
  • Status: Offline

Post September 29th, 2006, 7:10 am

Something I see everywhere on the web now: Flash 8 doesn't load into iFrames properly. It tends to open the file in a new window. Here is what you do:


Step 1
create a Flash file with publish settings for flash player 6, actionscript 1. Put this in the first frame:

_level0.loadIFrame = function(urlTarget, iframeTarget){
   getURL(urlTarget, iframeTarget);
};   


Step 2
load this movie into your original flash file:
loadMovieNum("iframeLoader.swf", 1);


Step 3
you can now use this function from anywhere in your file, for example:
_level0.loadIFrame("pageToLoad.html", "targetIFrame");


greets

Hein Kleinveld
newspectives.com
  • chrisrff
  • Born
  • Born
  • No Avatar
  • Joined: 30 Oct 2006
  • Posts: 1
  • Status: Offline

Post October 30th, 2006, 4:16 pm

Could I make a box with Iframe(a webpage/site) in it?

Post October 30th, 2006, 10:23 pm

yes, from html
“All you need in this life is ignorance and confidence, and then success is sure. ”
  • seza
  • Born
  • Born
  • No Avatar
  • Joined: 10 Nov 2006
  • Posts: 1
  • Status: Offline

Post November 10th, 2006, 6:53 am

Didn't work!
It still opens in a new browser window
And I can't seem to find another solution on the web
Geez, haven't anyone noticed that version thing yet? There aren't any other threads that mention it. No other possible solutions...
  • webpepier
  • Born
  • Born
  • No Avatar
  • Joined: 14 Nov 2006
  • Posts: 1
  • Status: Offline

Post November 14th, 2006, 6:38 am

I have a problem a little bit more complicated...I have a menu made with flash embedded in an html page where I have inserted also an iframe made up by a frameset with 3 frames. I want to know how it's possible to have that when the button in flash is pressed the page is loaded in the correct target frames into the iframe....

on (release) {
getURL("page.html", "mainFrame*");
}

*mainFrame is the name of a frame into the iframe


This is the javascript I have written in flash. It works only with Firefox but it doesn't with Internet Explorer! I don't know why....
  • samedakira
  • Born
  • Born
  • No Avatar
  • Joined: 19 Nov 2006
  • Posts: 1
  • Loc: Hungary
  • Status: Offline

Post November 19th, 2006, 3:21 pm

Hi

I am using flash 8, but have no problems to load into an iframe
Iam using the simple geturl action:
getURL("http://www.somesite.com", "traffic");
  • severinsmith
  • Born
  • Born
  • No Avatar
  • Joined: 20 Nov 2006
  • Posts: 2
  • Loc: Boston
  • Status: Offline

Post November 20th, 2006, 9:16 am

Hi,
thanks so much to h.kleinveld. This problem has been a real thorn in my side, and your solution seems to have solved it. I do have one question; when I publish the iframeloader.swf, I get syntax error warnings. I am a novice at Flash, and wonder if this is an actionscript version issue, and whether or not it will cause any problems at runtime. The application seems to be runnning fine. I am using MX 2004 on a Mac, but have also seen the error on Flash 8 Pro. The error message follows.

Thanks again for this solution, and any input you might have on this message.

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: Operator '=' must be followed by an operand
   getURL(urlTarget, iframeTarget);

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Unexpected '}' encountered
};

Total ActionScript Errors: 2 Reported Errors: 2
  • graphixboy
  • Professor
  • Professor
  • No Avatar
  • Joined: 11 Jul 2005
  • Posts: 752
  • Loc: Minneapolis, MN
  • Status: Offline

Post November 20th, 2006, 8:38 pm

severinsmith Your error has nothing to do with the version of Flash. This warning means you have malformed code and Flash doesn't know how to parse it.

If you post your code we can probably figure out the problem.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 20th, 2006, 8:38 pm

Post Information

  • Total Posts in this topic: 28 posts
  • Moderators: joebert, digitalMedia, UNFLUX
  • Users browsing this forum: No registered users and 30 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!