-
[F8] Linking correctly
Hi all,
For many of you this will be real easy, however for me it isnt. I would like to make a link on a flash button open the page inside an IFrame which is on my page. Is this possible.
my IFrame is called simply frame and I have tried what I thought was correct but it didnt work, it just opened in anew window.
My actionscript is as follows
PHP Code:
b1.onRollOver = over;
b1.onRollOut = out;
b1.buttText.buttonText.text = "Home";
b1.onRelease = function(){
getURL("thepage.php", "target=frame");
}
b1 is the button name
I am stuck and not even sure if you can do it.
Hope someone can help
Many Thanks
-
Flash Incompetent
have you tried getURL("thepage.php", "frame");
maybe this thread can provide further support:
http://www.actionscript.org/forums/s...d.php3?t=92680
p.s. I know nothing about this, I just googled "getURL target frame actionscript"
-
Flash/Flex Developer
Very good question....
Yes you can do it, but not with Flash alone. If I understand this correctly, when a button in Flash is clicked, you want a web page to appear in an iFrame. This is similar to driving content to a DIV. You're required to use javascript to bridge the connection between Flash and the html page and IFrame.
What version of actionscript are you using? This is kind of important and you'll use two different calls to perform the task. Regardless of the version, you'll first need a javascript function...something like this:
In HTML Page include:
Code:
<iframe name='somename' width='100' height='100 src='blank.htm' />
In javascript document:
Code:
function openPage(url){
document.getElementById('somename').src = url;
}
In Flash document:
Code:
//Actionscript 2.0
b1.onRelease = function()
{
getURL("javascript:openPage('thePage.php');");
}
//Actionscript 3.0
b1.addEventListener(MouseEvent.MOUSE_CLICK, function(){ExternalInterface.call("openPage", "thePage.php");});
Hope that makes sense.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
Linking correctly
Hi Samac,
I kind of follow you. As I am using actionscript 2 i assume i use the first bit of code.
Struggling as to where to put the javascript code and also what do I put where you have put 'somename'
Thanks for the assistance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|