ActionScript 3.0 :: Link Button Without A New Window?
Jul 8, 2009[code]...
I want to link through my button but without opening a new window.
[code]...
I want to link through my button but without opening a new window.
I created a button and linked it using this code:
[Code]...
But it keeps opening the link in a new window, how do I stop it from doing that so it opens in the same window the swf will be in? Where do I add target=_self?
I am using Flash Cs4 and I want to open a website window with a button click, but I want the window to open seperately without closing the first webpage. When the button is clicked, I want the user to see both pages open and in order to navigate back to the original, have them click the open window of the page instead of using the back button. It would be perfect if the second window would open smaller than the original webpage, sort of minimized, so that they can still see the original pages content. I can use either actionscript 3, or actionscript 2. Whichever will acomplish the task. I am having the damdest time finding the correct code to do this. I have Flash Cs4, currently set to publish as actionscript3 with Flashplayer 10. I can change that to actionscript2 and Flashplayer 8 if anyone can give me the actionscript2 code to accomplish this task. Here is the code I am currently using to navigate to the second webpage, and yes I know it is currently actionscript 3, and this an actionscript 2 forum: Either code will work for me as long as it does the job.
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("https://mycw3.eclinicalweb.com/cent/jsp/login.jsp"));
}
It does open in a second window with no back button as I want, as long as I am testing the movie in Flash. When I publish it to the web on a server, you still have to use the back button to go back the original page which is not what I want.
I work with 3d animation. Im have a problem with a personal website Im doing, I have a link in a button inside a flash movie to open a new window and play a youtube movie:
on (release) {
var jscommand:String = "window.open('http://www.youtube.com/v/b0L4XLODhAA&hl=en&fs=1&','win','height=344,width=4 25,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);");
}
This works fine in Firefox but in IE it doesnt work, I then change the /v/ in the youtube link with /p.swf?video_id= and now I have the window open showing the small youtube thumbnail of my video but once a click play, nothing happens, I check it and is not loading anything.
this is what I have as code but it opens in a new tab when i click the button
futureBtn.addEventListener(MouseEvent.CLICK,goFutu re);
function goFuture(e:MouseEvent):void
{
[code].....
Right now I have everything set up and linked correctly except when you click the button it opens up a new tab rather than just going straight to the suggested URLHere is the code I have now...
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
function fl_ClickToGoToWebPage(event:MouseEvent):void
{
[code].....
I have a datagrid with different types of columns, like I have checkboxes, combo boxes and text Inputs as the column types. Now I want one of the column type to a link, with the label "view". All the rows in that column are link with the same label "View" and on clicking it, I want a Pop up window to be opened?
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
<mx:Script>
<![CDATA[
[code]....
I didn't know how to bring a link in the datagrid. So used the Text control to display the "View" label. Now If I click this item, "View" in the datagrid, I want the Pop up function, i.e.,defectCommentsPopUp() to be called.
ACTUALLY i just thought of another one so now i have two. sorry. hope you don't mind. i get sidetracked rather easily. before i start, a quick nota bene. i'm a complete newcomer to flash so my questions are very simpleminded. not much of a challenge i'm afraid.
1. can i put a link in my movie that will close the window?
2. can i put a link in my movie that will open a new window of a specific size, and without the menu-buttons of explorer?
i have a flash site that links to PDF's with the navigateToURL function which works etc But now i would like Link to rather open up a download window instead of just a new browser window?
View 3 RepliesI'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]....
i created my subMenu buttons fine, however i only know how to link them to a picture/url address, my goal is to have the user click the subMenu button and open the image or page right below the menu bar in the "stage" area of flash. I read about IFrames but i'd rather create the whole site in flash .Here is the code for my subMenu...
btn_34th.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("images/34th.jpg"));
trace("I'm Clicked!");
Again, this works fine, i just want to have the image take up the "white" space on the stage area, very similar to an IFrame.
i've download this gallery made by kirupa, if you do click on the image the url appear in a new window...
my question is ...how i can get the link appear in the same window? i don't know if xml allow the target="_parent" code....
this gallery use xml file...
<images>
<image>
<path>images/angel.jpg</path>
[Code]...
i would like that my window opens and closes (opens: scale out; closes: scale in) not by clicking on the button but on the window itself.here are 3 applications of mine (schuifwindow, scroll and fotoalbum).
Grtz,Jan the man
here are 3 applications of mine (schuifwindow, scroll and fotoalbum).
schuifwindow www.truevision.be/other/btn_home.flascroll www.truevision.be/other/scroll.flafotoalbum www.truevision.be/other/foto_album.fla only picture one (left up corner) has a X button (i dont want to use this button)
how to make the URL open in the same window. I am using flash CS3, Is there anyone who can edit the script below to allow this. The instance name is Button6
var getnextpage5:URLRequest = new URLRequest ("http://www.yokubou.co.uk/digitalart.html");
Button6.addEventListener(MouseEvent.CLICK,b5Click) ;
function b5Click(event:MouseEvent):void{
[Code]....
I've been using this code, which, when i click on a button it sends me to a new link, but when I put the .swf on my website and click the button, it sends me to a new tab *BUT* the url is instead ofI also want it in a new window instead of a new tab.here's the code (All in the first frame)
Actionscript Code:
button31BTN.addEventListener(MouseEvent.CLICK, clickButton31);function clickButton31(event:MouseEvent):void{ var url:String = "www.theurl.com"; var
[code].....
I have an asp link which is calling a server tracking counter and it is not supposed to open a new window when it is called from a button using on release. How can I do this without getURL which always opens a window? Also I don't need to send or receive any data just I want to call the URL without opening a new window.URL...
View 2 RepliesI've trawled the web, everyone with different ideas on how to call up a mailto link in AS3. What I'm looking for is this: I have a box, that is coverted to a button symbol given the name 'mailto'I have another layer for the actionscript I have imported 'flash.net.navigateToURL' and 'flash.net.URLRequest'
I know I need to create a function or a variable to link in the already created button. Do I also need to import the MouseEvents?
I created this FLA to get used to CS4 (i was previously using8)Everything works wonderfully, I would just like to know how to use AS3 properly, without having to call defeat and create the FLA again using AS2.
I have a simple link in my flash movie. The code attached to the button click goes like this[code]...
View 3 RepliesIm new in flash.I have a link in my flash menu "Home" section. The code attached to the button click goes like this [code]...
The link works fine, but it dont open in the same tab. It keeps opening in a new tab. I need it to open in same tab in my browser. wat i have to do to open it in same tab/window?
how to make the URL open in the same window. I am using flash CS3, Is there anyone who can edit the script below to allow this. The instance name is Button6
var getnextpage5:URLRequest = new URLRequest ("http://www.yokubou.co.uk/digitalart.html");
Button6.addEventListener(MouseEvent.CLICK,b5Click) ;
function b5Click(event:MouseEvent):void{
[code]....
Pretty simple- just trying to have a link in my .swf open in a new window, with a specified size.
I have done this before but can't seem to remember/find a tutorial... well besides one on kirupa that didn't seem to work for me.
I believe the method I used before involved putting some code on the page you were linking to...
I have l a flash file in my pages that links to other pages within my web site but when clicked they automatically open in another window. How can I link them without opening a new window as would happen with a normal web page link?
Here is my current Action Script code: index.addEventListener(MouseEvent.CLICK,indexbuttondown);
function indexbuttondown(event:MouseEvent):void {
var bbcURL:URLRequest = new URLRequest("index.html");
navigateToURL(bbcURL);
}
I'm primarily an HTML/CSS girl. I'm pretty new to Flash, and until recently have only worked from the timeline without using any action script other than stop(); and simple goto commands like gotoAndPlay(49);
This week, I needed a nav button to take the user into the site from the Flash intro; it's live at [URL]
Flash CS4, Action Script 3. Since I don't write Action Script - yet - and needed the link in a hurry, I Googled for the code. As you can see, it works fine, but the site opens in a new window, and I don't want it to do that, I want it in the same window.
The code is as follows:
clickToEnter.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.deppimpersonator.com/cms"));
}
I thought it might be the use of "new" in front of URLRequest, but of course when I took that out the link didn't work at all.
Blind experimentation produced two attempts that simply broke the link (don't laugh ):
[Code]...
What do I need to add (or remove) from this code? And is this the most efficient way to code an internal link?
In case this is browser-specific: I've only tested this in the latest versions of Firefox and Safari for Mac, OS X 10.6.2 (Snowleopard). It's the same in both browsers.
Does anyone know how to make the URL open in the same window. I am using flash CS3, Is there anyone who can edit the script below to allow this. The instance name is Button6 var getnextpage5:URLRequest = new URLRequesthttp://www.yokubou.co.uk/digitalart.html");Button6.addEventListener(MouseEvent.CLICK,b5Click) ;function b5Click(event:MouseEvent):void{navigateToURL(getnextpage5);}
View 1 RepliesIm using AS3 obviously, and this is my code so far.[code]...
I have three frames that i want to link to three different html pages and i need them to open in the same window. I have put this code on each frame, changing the instance names for each frame (link1, link2 and link3)
When i click the flash in pulish (f12) the link works but in a new window, not the same. Does this mean the 'self' attribute is wrong? or is it for some other reason?
I'm using an XML file to load all my images and text, but would like an image to link to a website, but open in a new window.So far, here's my relivant code;
In the .XML ;
Code:
<page name="Picture_Image_1">
[code].....
I can't seem to get a link to open in a new window, no matter what I try. I thought this was a problem with firefox, but I'm not sure. I'm simply using getURL like this... the link is loaded from an XML file
mainBtn.onRelease = function():Void {
if (this.gallery == "yes") {
logo_mc.unloadMovie("MD_imagefader.swf");
[Code].....
Basically, firefox just says "transferring..." on the bottom when clicked forever, and never loads anything nor does it open a new window. When I test it on my local hard drive, firefox returns a security error that it's trying to communicate with a web source.
[URL] how I could make it so when clicking on one of the pictures I got a big picture in a new window?
View 2 Replieslink opens up a new window rather that the same window?
PHP Code:
//listen for mouse click on" button"
button,addEventListener(MouseEvent.CLICK, navigatetoURL);
[code].....
We have Flash movie in one domain and accessed from other Domain. The links in Flash movie was not working and with security restricitions we cannot use 'allowscriptaccess'.
So, we used System.security.loadPolicyFile [URL]; and included the XML in our assets. This worked for the links to open in New Window. But, when the links were changed to open in the same window, the links are working in Flash Player versions till 9.2XIn the versions, 9.4X+, it is not working.