swf hyperlinked self in actionscript 3

  • Numetale
  • Born
  • Born
  • No Avatar
  • Joined: Feb 02, 2011
  • Posts: 1
  • Status: Offline

Post February 2nd, 2011, 1:18 am

Hello, to see if I can help, but look not understand why I have this problem as specifically:

I have a logo in the header of a website (klancstudio (DOT) com) that is supposed to lead to the main page. It is a swf created with Flash and ActionScript 3.

The code I have is:

ACTIONSCRIPT Code: [ Select ]
BotonInstancia.addEventListener (MouseEvent. CLICK, Hyperlink)
 
Hyperlink function (e: MouseEvent): void
{
var url: String = "http:// (W) klancstudio (DOT) com";
var iraURL: URLRequest = new URLRequest (url);
try
{
navigateToURL (iraURL, "self");
}
catch (e: Error)
{
trace ("Failed!")
}
}
 
BotonInstancia. buttonMode = true;
  1. BotonInstancia.addEventListener (MouseEvent. CLICK, Hyperlink)
  2.  
  3. Hyperlink function (e: MouseEvent): void
  4. {
  5. var url: String = "http:// (W) klancstudio (DOT) com";
  6. var iraURL: URLRequest = new URLRequest (url);
  7. try
  8. {
  9. navigateToURL (iraURL, "self");
  10. }
  11. catch (e: Error)
  12. {
  13. trace ("Failed!")
  14. }
  15. }
  16.  
  17. BotonInstancia. buttonMode = true;


"Self" does not underscore the thing done, was a suggestion I read in a forum through which I went as much to what I want. If I put "_self" direct link does not work, if I put "_blank" works but always opens new browser and do not want that.

The problem is that when you open the first time the web and click on the logo opens a window / tab new addition (which is not sought and does not understand why) but in this new window / tab you Click again on the logo and it works well and reload the page on the same browser.

If anyone has any suggestions will be very grateful.

Greetings!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 2nd, 2011, 1:18 am

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post February 18th, 2011, 3:44 am

yea, i have a sugestion.
When everything else fails, use javascript (of course if you can hanlde it) :)
http://www.ozzu.com/flash-forum/externalinterface-class-t81957.html
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post February 18th, 2011, 6:08 am

Numetale wrote:

The code I have is:


navigateToURL (iraURL, "self");



In your code you did not use "_self" you used "self" without the preceeding underscore. Add in the underscore and it should work. If not try "_parent"
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 112 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.