Jump to content


Photo

Flash menu/buttons to control iframe


  • Please log in to reply
4 replies to this topic

#1 cng

cng

    Young Padawan

  • Members
  • Pip
  • 55 posts

Posted 17 March 2005 - 10:08 PM

How to use Flash menu/buttons to control the content within an iframe? Like I want to make it so it changes the source of the iframe so the iframe will show another page. To know what I am talking about look at this.

Also, related but not to Flash, how do I make it so when I put an iframe inside a table it leaves no cellpading? In Dreamweaver I cannot seem to get rid of a tiny gap. Is there a way to use normal buttons (non flash) to control iframes too?

#2 PizdusInc

PizdusInc

    Young Padawan

  • Members
  • Pip
  • 37 posts
  • Gender:Male
  • Location:Southern California

Posted 18 March 2005 - 12:25 PM

To control the iframes from flash, I believe that you would use the getURL function and specify the target you would like to open the content in... The format for getURL is as follows:

getURL("http://www.yoururl.com", "target window");

Where the "target window" could equal either _self, _blank, _parent, _top, or the html iframe you create where you want the content to load.

As for the cellpadding, you would use the following to get rid of any spaces,

<table border="0" cellpadding="0" cellspacing="0">

Lastly, yes you could use normal buttons to control iframes all you do is add a target="your frame name" to your link (a href...) code.

If you have any questions, let me know!

Good luck!

#3 cng

cng

    Young Padawan

  • Members
  • Pip
  • 55 posts

Posted 18 March 2005 - 08:48 PM

Thanks for your help. Im using Flash MX 2004. How would my whole code look given the following information:

<iframe id="content 1" name="content 1" src="news.html"</iframe>

Would my target be src, frame id or name?
I know _self, _blank, _parent but for iframes is it _iframe id?

Please show me a sample code, thank you.

#4 PizdusInc

PizdusInc

    Young Padawan

  • Members
  • Pip
  • 37 posts
  • Gender:Male
  • Location:Southern California

Posted 19 March 2005 - 09:46 AM

Your target would be either id or name, either should work. However, you should avoid using spaces in id's and/or name's. If you modified your iframe code to the following (just removing spaces from names):

<iframe id="content_1" name="content_1" src="news.html"</iframe>

Then, inside flash you would use the following code to open a page in the iframe you created:

getURL("http://www.yoururl.com", "content_1");

If you would like to do the same on a normal button you would use the following code:

<a href="yoururl.html" target="content_1">link</a>

Please let me know if it works or if you have any other questions.

#5 cng

cng

    Young Padawan

  • Members
  • Pip
  • 55 posts

Posted 19 March 2005 - 02:46 PM

Thanks for your help. I got the code working now. :blink:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users