Copy link to clipboard
Copied
Hello,
I am still used to AS2 and this is resulting quite complicated.
I am trying to make it so that when the timeline stops, for a website to load within an iframe next to it.
This is my website:
http://www.shifumi-collections.com/beta/
I have the .swf on the left and I want to open up content on the right.
as an example, I want google.com to open up within the iframe. This is the code I have so far:
stop();
var url:String = "google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_self');
} catch (e:Error) {
trace("Error occurred!");
}
how do I make it so that it targets my iframe?
The code on my html is:
<div id="right">
<iframe name="content" frameborder="0" height="600" width="700" scrolling="no" allowTransparency="true"></iframe>
</div>
any ideas?
Copy link to clipboard
Copied
use:
stop();
var url:String = "google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
Copy link to clipboard
Copied
thank you very much kglad!
That worked!
May I ask one final question. It is related to the other buttons. I want it so that when on release of a button, a certain frame (lets call it frame #150) begins to play. Since I cannot place that unto the button itself, how can I do it so that it loads a certain frame or flag within the same timeline?
cheers
Copy link to clipboard
Copied
if your button is on the same timeline as the timeline you want to control, attached to that timeline, you can use:
/////////////////////
yourbutton.addEventListener(MouseEvent.CLICK,f);
function f(e:MouseEvent):void{
gotoAndPlay(150);
}
//////////////////////////////////
Copy link to clipboard
Copied
thank you once again.
That worked!
one problem though. I am trying to get the same code in the same layer at different frames.
stop();
var url:String = "google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
and
stop();
var url:String = "home.html";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
-----------------------------------------------------------------------------------------------
Basically I am adding these at the end of every frame, so that when one presses a button, it plays the certain frame and when it stops, the url opens up in the frame I spoke about before.
With only one it works, but when I put the second one, the following error appears:
Symbol 'menu', Layer 'btns', Frame 150, Line 1 1151: A conflict exists with definition url in namespace internal.
Copy link to clipboard
Copied
on your first keyframe that has your navigateToURL code, you can use:
////////////////////////////////////// stop();
var url:String = "google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
////////////////////////////////////////////
// thereafter use:stop();
request.url = "home.htm";
try {
navigateToURL(request, 'content');
} catch (e:Error) {
trace("Error occurred!");
}
Copy link to clipboard
Copied
thank you kglad!
indeed, I am all set to finish this website now thanks to you.
![]()
Copy link to clipboard
Copied
you're welcome.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more