Button link to HTML URL to open in the same window

If the following code allows us to open an HTML link with the click of a button:

function callLink(event:MouseEvent):void

{

var myURL:URLRequest = new URLRequest ("http://www.adobe.com/");

navigateToURL (myURL);

}

The problem is that it always opens the link in a new window. So if I want to open it in the same window? Change the line to:

var myURL:URLRequest = new URLRequest ("http://www.adobe.com/","_self");

causes a compiler error.

I'm embedding the swf in a web page of mine, so there is no problem of security regarding giving flash access.

Try:

function callLink(event:MouseEvent):void

{

var myURL:URLRequest = new URLRequest ("http://www.adobe.com/");

navigateToURL (myURL, "_self");

}

Tags: Adobe Animate

Similar Questions

  • Cannot get URL to open in the same window

    I use Flash ActionScript3 - my banner has 3 images, each poster for about 5 seconds. I have every picture is linked to a web page with more info about each image. The problem is that I can't get the URL to open in the same window! Every click opens another browser window. All attempts to solve this problem using suggestions found in my Google search for the answer results in error messages. Any help would be greatly appreciated!
    Here is my script for one of the images:

    Thanks for the help. I should have mentioned that I was not sure of the syntax as well. That's the answer I was looking for:

  • How to make HTML links open in the same window?

    Hello

    How the hell can I get the HTML links within a flash movie open in the same browser window where said film is incorporated in (as opposed to opening in a new pop up window)? Here is the code I have inside each of the buttons that I have inside my flash animation:

    ***********

    var link7:URLRequest = new URLRequest("videos/december.html");

    videos_btn.addEventListener (MouseEvent.CLICK, buttonClicked7);

    function buttonClicked7(event:MouseEvent):void

    {

    navigateToURL (link7);

    }

    navigateToURL (link7, "_self");

  • GetUrl does not open in the same window?

    Hello

    I created a website with a flash menu on each page. I use code getUrl to target each page but I can't seem to get the pages to open in the same window. If I use "_new" or "_blank" pages open in a new window as they should, but if I use "_self" or "_top" nothing happens.

    Any help is very appreciated. Thank you!

    Code: AS3

    aboutBtn.buttonMode = true;
    aboutBtn.addEventListener(MouseEvent.CLICK, callAbout);
    function callAbout(e:MouseEvent):void{
      var url:String = "about.html";
      var request:URLRequest = new URLRequest(url);
      try {
        navigateToURL(request, '_self');
      } catch (e:Error) {
        trace("Error occurred!");
      }
    }
    

    You test it locally or online?

  • NavigateToURL doesn't open in the same window and refresh of infinity

    I have a project that requires a "skip" button and to go to a url specified in the same window once the animation is complete. The button works, however the navigatetourl in the last image does not.

    Here is the code that I placed in the last picture:

    addEventListener (Event.ENTER_FRAME, fl_EnterFrameHandler);

    function fl_EnterFrameHandler(event:Event):void

    {

    Start your custom code

    This code example displays the words "Framework of entry" in the output panel.

    navigateToURL (new URLRequest ("http://www.student.nvcc.edu/home/amlayne/ite170/dreamweaver/graded_assignments/index.html"), '_self');

    ;

    Stop();

    Complete your custom code

    }

    I tried to move it to a previous setting, placing a stop in the previous framework, displacement of the order after stop and so on. No matter what I do, the new url opens in a new window and is in a constant state of refreshment. I also disabled loop but the animation begins to load the first image again anyway.  Help, please. I tried several fixed listed in the forums which are built around the same with no different results.  You can view my animation here: http://www.student.nvcc.edu/home/amlayne/ite170/flash/graded%20assignments/myintro.html

    NOTE: You must close the browser to get the update to stop.

    I have worked on this issue in two days and I am at a total loss.

    the enterframe event is dispatched repeatedly several times per second (equal to your pace) and this isn't what you want.

    Replace all the code with:

    navigateToURL (new URLRequest ("http://www.student.nvcc.edu/home/amlayne/ite170/dreamweaver/graded _ * ignments/index.html"), "_self");

    Stop();

  • Opening in the same window using CSS and Flash CS3/AS3?

    I'm working on a portfolio in Flash CS3 and AS3. I try to avoid making all in Flash, so the home page is a header CSS/HTML page that will house a piece looped flash under the heading and the portfolio of the Interior will be flash parts within the same framework of header CSS.

    I would like to know what kind of code I need to use flash portolio navigation so that the 'Home' link will open the CSS/HTML landing page in the same window, rather than launch another window. Is this something that can be done using AS3, or do I me javascrpt as well?

    Any information or suggestion for a tutorial that I can take for this would be really useful and appreciated.

    You should test online.  Local test can have varying results in the measure of targeting windows going.

  • I have the windows open again in a new option to the selected tab but it always opens in the same window.

    Firefox v28.0, Mac OS X 10.9.2, 3.5 GHz Intel Core i7.

    Running in safe mode. In the Preferences menu, I have the "open new window in a new tab instead" box checked but when I click on links the new page opens in the current window. If I order click on I have the ability to open the new window in a new tab

    The setting in tools > Options > tabs: "new pages should be opened in ': 'a new tab/window' is for links that specify a target window to open the link.

    This option allows to divert these links into a new tab instead of a new window.

    Links that do not specify a target still open in the current tab, unless you redefine with a middle or click Ctrl left click (new tab) or a left click UPDATE (new window) or via the context menu.

  • Need help to make the page Web to open in the same window

    Hello. I want to menu page load in the same window. Right now, if you click on the index page, it will open the menu page in a new window. I know I should use _self, _parent or. But I could not understand where to insert it. Help, please. Thank you.

    in the case of your mentioned function, it would be just like:

    inv_btn.addEventListener (MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler (event: MouseEvent): void {}
    navigateToURL (new URLRequest (" http://www.detailshardware.com/menu.html"), '_blank');
    }

    That's all.

  • All links that do not open in the same window now open a new window. CTRL + click and Middle click, as well as menu popup 'opens in a new tab' all open link in a new window. It started after the last (9.0.1) update. Thank you!

    The only method I found to open a new tab is to copy the URL, press Ctrl + T, and then paste the URL and go.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    You can also check the preferences of browser.link.open_newwindow on the subject: config page.

  • Whenever I click on a link, it opens a new window when it is just suppost to open in the same window.

    It started recently and all the other suggestions do not work. So I will try to get a solution more up-to-date for this problem please help.

    This affects all sites? If it affects only certain sites, could you give some examples?

    Note: for Google, you can disable this on and off in the search parameters. Click on the "gear" (Options) icon, then the search parameters, and then uncheck the box for "open each result selected in a new browser window."

  • Windows 7 laptop - files are open in a new window despite "open in the same window" is selected under "Tools" folder options

    This seems to have started randomly out of the blue and it's quite annoying. When you work with folders, I end up having a bunch of files that need to be closed and I usually don't want to close all; I usually have to sort numeorus files open to find what I'm looking for, as opposed to easily using the back button to return to a folder I want. I have not downloaded programs. The only thing I can think is deleting browser explore because I never use it (it is incredibly slow and slows down my computer laptop while each opening by mistake) and i ' LD fashioned just get rid of it.

    How I deleted the browser explore:

    -I went to control panel, then programs, then display the updates installed and then uninstalled IE from here

    I looked everywhere on the internet, but I can't talk about what most of these solutions. Some people are proposing the deletion of the registry files. I know that these files are really important and I don't want to delete anything and cause a big problem for me.

    Some of the solutions use language I don't understand; they give you a solution and a lot of people claim that it works, but how run the solution is not explained; If this is not enough. I assume that the solutions are designed for people who are good with computers, but I'm not, so if you are answering this, explain your solution in words that even a baby would be able to follow the instructions. Please do not automatically assume that I know where something is and leave out of your explanation, because chances are, I'm not.

    Problem solved: I reinstalled the browser explore the microsoft Web site. I guess they really want users to have the browser on their computer, to be used or not: s

  • Open link in the same window

    Hi, I found quite a few of questions on this but no work so far...

    I'm using AS3 course and this is my code so far...

    Link3.addEventListener (MouseEvent.CLICK, onClick3)

    function onClick3 (MouseEvent): void {}
    navigateToURL (new URLRequest ("
    http://mylink.com"), "_self" ' ");
    }

    I have three images that I want to link to three different html pages and I need them to open in the same window. I put this code on each image, change the names of occurrence of each image (link1, link2, and link3)

    When I click on the flash in pulish (f12) the link works but in a new window, not the same thing. This means the 'self' attribute does not? or is it another reason?

    Thank you, Jake.

    You should test the direct window on a server controls.

  • Open links in the same window, no news

    Help greatly appreciated!
    My links open in a new window, but I need them to open in the same window.
    What should I add to my code to make it happen.
    Here is my code-

    Stop();
    var arrLinks:Array = new Array();
    arrLinks [1] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027141/category.cgi';
    arrLinks [2] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027139/Harlequin-Historical.html';
    arrLinks [3] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027129/Silhouette-Desire.html';
    arrLinks [4] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027136/Silhouette-Nocturne.html';
    arrLinks [5] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027121/Harlequin-Intrigue.html';
    arrLinks [6] = ' http://www.diesel-ebooks.com/cgi-bin/category/FIC027123/Harlequin-Blaze.html';
    //
    var PC = 0;
    this.onEnterFrame = function() {}
    PC = Math.floor((_root.getBytesLoaded()/_root.getBytesTotal())*100);
    If (pc == 100 & &! isNAN (pc)) {}
    delete this.onEnterFrame;
    _root. Play();
    }
    };


    The project means this code is here-
    http://www.respond1.com/Harlequin/slider/slider_over_all2.html

    Thank you so much in advance.
    Dave

    Where your getURL action?

    have you tried _parent or _self as its target?

  • V29 Firefox to open links in the same window

    Since the installation of version 29, I found only two apparently related questions:

    (1) I find that links open in the same window as the source, instead of a new window.

    For example, I get a notification of a newsletter every day in my Yahoo email account. Before v29, when I clicked on the link in the email to go to the newsletter, it would open in a NEW window (my preference).

    With version 29, it opens in the SAME window (and replaces the window where I had Yahoo mail open).

    (2) in the same way, I do a lot of work where the links will appear in an Excel worksheet. Previously, whenever I clicked on one, it will open a new window. If I clicked on 6, I have 6 windows open. Now, every link I click REPLACES the last one that I opened.

    These two problems are very annoying and slow me down.

    Is there a setting where I can change this behavior?

    I found that after Firefox v29, a LOT of my settings and

    Add - ons have been changed / reset. Try this;
    Launch Firefox in Mode safe

    While you are in safe mode;

    Firefox Options > advanced > General.

    Find and stop using hardware acceleration.

    Then check ALL your settings. Browser and Add-ons. Then restart.

  • Links to social media in the same window of muse. I am trying to find a way to get them to open new tabs.  Someone knows how to fix this?

    I know that the settings of Muse are supposed to have links open in a new window but that is not happening.  I took off and links several times.  In fact, all external links open in the same window of Muse. Help please! I'm ready to connect to the domain, but cannot bring myself to do it until I fix this.

    Thank you

    Here's the link - PET PRODUCTS

    Please send me the file at [email protected] with my name in the subject with this forum link line.

    I'll take a look.

    Thank you

    Sanjit

Maybe you are looking for

  • Question aboput using the recovery disk

    If I use the recovery disk, it will remove the Toshiba assist installed on my pc? I don't have the tools and disk utilities. Thank you

  • Sluggish screen loading

    I noticed for some time now that the screen of my Defy gets really slow, even non compliant, the charger cable is plugged. I can't yet respond to calls because of it. Any ideas? I have not yet upgraded the OS to 2.2.

  • What is style constant ring?

    Hi, I am trying to create a constant program of the ring, but I can't find his style...No idea what is the style of constant of the ring?

  • SQL result

    If I use SqlDataAccess sda;QVariant result;result = sda.execute ("SELECT column FROM table where...");How to get I store the result in a table of QString? With c ++ to perform tests on this subject?Help, please

  • Checking for changes of SmartView Ad - Hoc

    HelloI am a new developer to Hyperion, have hit a bit of a snag and thought it might be a good idea to ask the community.My challenge is the audit of SmartView changes by using the connection of planning. I turned on all the auditing options for my p