-
navigateToURL problem
I'm trying to get the link to open in the same window instead of a new window, it's currently set to _blank. I tried _top, _self, _parent. When it's set to anything other than _blank the link doesn't work.
Code:
import flash.display.*;
import flash.events.*;
hyperlinkbutton3.addEventListener(MouseEvent.CLICK, hyperclick3);
function hyperclick3(event:MouseEvent):void {
var url:String = "http://google.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank'); // second argument is target
} catch (e:Error) {
trace("Error occurred!");
-
"_self" is the one you need
if you running the swf in the html file you should be able to see the effect of that
-
are you sure? I use "_top" in that situation pretty regularly and it works for me.
-
it works fine with me when i'm using "_self"
-
Originally Posted by kakashi807
"_self" is the one you need
if you running the swf in the html file you should be able to see the effect of that
See i've already tried that. I thought maybe my joomla was messing with it somehow but even in a simple html embed it still won't open the link at all with _self. Is there something else I might be doing wrong? Nothing else wrong with the code I provided?
-
mmm..that's weird, i never got that problem before but then..i never had to use the try and catch for that. try removing the try and catch
-
If you're actually testing this in a browser, and it's not working according to the livedocs documentation:
* "_self" specifies the current frame in the current window.
* "_blank" specifies a new window.
* "_parent" specifies the parent of the current frame.
* "_top" specifies the top-level frame in the current window.
then I'd start by testing in some other browser setups and see if there's something in he browser settings overriding this target request. As I said, you're not doing anything functionally different than I usually do, and _top has always worked fine for me.
Do the double/single quotes matter? I usually use double. Also, I assume you have a closing brace on your catch{} block?
-
or try puttin back the http://www.google.com instead of http://google.com, not sure if it's gonna make a difference.
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
|