ActionScript 3.0 :: Linking Flash Button To URL
Apr 29, 2011
I have created seven buttons using Flash version 9 following a tutorial on this site [URL]. The buttons function the way they were designed, however, when I attempt to link them with a URL or a unpublished website file (eg. contact.html or index.html) the button brings up the "TextEdit" application on my Mac.
The action script 3 code that I am using:
btn_6.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(event:MouseEvent):void {
navigateToURL(new URLRequest("contact.html"), "_same");}
I have even tried using action script 2 code after changing the publish settings to AS2:
btn_6.onRelease=function(){
getURL("[URL]", _same);}
The results are the same. When I test the buttons, they link to an application on my Mac. All of my buttons are on the same layer.
View 2 Replies
Similar Posts:
Apr 3, 2011
i have created a navigation bar for my website and i need to add a url to the movie clip, it has roll over and roll out but when i put the url on it cuts out the roll over and roll outs.. what do i do?
im using the coding...
on (rollOver) {_root.home.gotoAndPlay(2)
}
on (rollOut) {_root.home.gotoAndPlay(1)
}
View 5 Replies
Nov 21, 2011
I created a flash page which I'm having problems linking the buttons.I have 3 pages in scene 1("home page frame2", "music page frame3", "contact page frame4"), which all are set to movie symbols. I set buttons inside the home page and want one of the buttons inside the page to link to my music page (frame3) in scene 1
actionscript code "on (release){
gotoAndPlay("music")
}
and all it does is reload the home page as if it can't find it's way out of the home page back to scene1. I realize I created buttons inside the home page and not in the main scene1.
View 4 Replies
Oct 27, 2009
I am currently building a website in flash for a school project and it has to be on a timeline. I was wondering if you could help me i have buttons at the top of the page how would i link these to another frame so it can be used as a new page
View 6 Replies
Nov 23, 2010
I need to get the code to make a button link to a pdf located in the same folder on my host server as my flash movie and index.html file. (or should it be located differently?) I want the pdf to load in a new window..
View 3 Replies
Jul 20, 2009
After defining my button as a button and then going into the F9actionscripts menu, I don't know what code to input to make the button link to a specific file. I'm doing this as an autorun swf for a CD I am making.
View 1 Replies
Feb 18, 2009
I am having a problem linking an invisible button to a url. I have 3 invisible buttons that have an action script as follows:
button1.addEventListener(MouseEvent.CLICK,clickHan dler1);
button2.addEventListener(MouseEvent.CLICK,clickHan dler2);
button3.addEventListener(MouseEvent.CLICK,clickHan dler3);
function clickHandler1(event:MouseEvent):void{
navigateToURL(new URLRequest("mywebsite"));
[Code] .....
After I upload the files, I can see the hand icon when I mouse over them, but when I click on that spot nothing happens. I have two text links on the same page that do work. One is an email link and the other is a url link. I have check the button names to my code and they do match.
View 4 Replies
May 20, 2009
Here's my new question: What code I have to input in a button file in Flash, for that when I click it opens a site I've made, in a browser? I'm doing my website in Flash, and the other website I want to put the link was made in Dreamweaver. It's not hosted, it's in my pen, that's why I'm having problems with the code.
View 4 Replies
May 12, 2010
I have created mc's (movie clips) for each one of my pages and for pages within those pages, if you can understand that lol. The problem I am having is, linking from one mc to another.
Example: I am in my home page movie clip, and I have a "read more" button on one of the articles, when a user clicks on this button I want him to be redirected to the page that article is on.
In my case, I am making a website that gives users information on Paris, France. On my home page I have an article that speaks about Napoleonic and I have created a "read more" button. The information on Napoleonic is on the landmarks page(which is its own movie clip). When the user clicks on the "read more" button I want him to be redirected to the page thats in its own movie clip with the info.
View 6 Replies
Oct 12, 2010
how to link the button I made to say Scene 2 of my flash project. I'm not sure the actionscript required or where I put the action script.
Here is the file I'm using, trying to simply figure out how to make the open button go to scene 2. [URL]
View 2 Replies
Jul 19, 2011
I m building a website and lately i am facing a lil problem.i have placed a button from windows->components-> button with movie type button property now the issue is i am unable to link that to a pdf file.i want that button to open a pdf file.and how do i do that.
View 18 Replies
Aug 30, 2011
I have recently followed a Adobe Flash tutorial, which has helped me make MovieClip buttons which extend to the left when hovered over.
This tutorial can be found here: [URL]
An example and download link for the project is at the bottom of that page.
Everything on the tutorial went fine, but now I am trying to work out how to make these MovieClip buttons link to another URL.
What code do I need to do this, and where do I need to put it?
View 3 Replies
May 13, 2010
I am creating a website in flash and I need help linking to internal pages. I have created mc's (movie clips) for each one of my pages and for pages within those pages, if you can understand that lol. The problem I am having is, linking from one mc to another.
Example: I am in my home page movie clip, and I have a "read more" button on one of the articles, when a user clicks on this button I want him to be redirected to the page that article is on.In my case, I am making a website that gives users information on Paris, France. On my home page I have an article that speaks about Napoleonic and I have created a "read more" button. The information on Napoleonic is on the landmarks page(which is its own movie clip) and inside the landmarks page is the Napoleonic page(also its own mc). When the user clicks on the "read more" button I want him to be redirected to the page thats in its own movie clip with the info.
View 1 Replies
Oct 31, 2010
I am trying to link 5 buttons I have made in flash CS5 AS3 to 5 pages and I have made this code, but I keep getting error message 1061: Call to a possibly undefined method addEventListener through a reference with static type Class. My code is
stop();
function button1_clicked(e:MouseEvent):void{
gotoAndStop("page1");
}
[Code].....
View 9 Replies
May 3, 2005
I've converted a graphic that i imported into a button. And put this action script on it to go to a certain scene.
on (press) {
gotoAndPlay("2,1");
}
This button should make the movie go to scene 2, frame 1, but its just not workinBackground info:The first scene is jsut a short intro where a couple buttons finally come up in a keyframe. In the keyframe itself, I have a stop action so the main scene doesnt loop. And on each button I have the action that i wrote above, to go to certain scenes depending on which button i click. Am i totally setting this up wrong structurally? Do i need to put any kind of "Reset" action if i want to go back to a previous scene. Also, in each scene, I have a mouse hide and replace action, could this have anything to do with it?
View 1 Replies
May 11, 2009
I have a drop down movie button that shows the drop down when scrolled over but i cannot get the drop down buttons to link to the relevant frames.My current script on the dropped down button is
on (release) {gotoAndStop(6);
}
which does nothing.
View 1 Replies
Sep 6, 2008
I'm very new to Flash (using CS3). I created a button instance out of text but I don't know what to do next. I'd like for the button to link to a different place in the timeline of my website. Right now, when I click on the text link and go to actions, it says "current selection cannot have actions applied to it". I'malso not sure what the script should read and if all the script goes into one "actions" layer or separately. This is what I'd like for it to look like: [URL]
The button that I'm trying to create right now is the "print" button which would bring up the section with the clickable thumbnails that you see on top. It's my first time using flash. I already placed everything in the document. Should all the different links just be different places in the timeline? Sorry if this is a n00b question but I'm still trying to understand how flash works as a website (my previous experience is only web banners).
View 1 Replies
Jun 8, 2009
So 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/");[code].......
The problem is that this always opens the link in a new window. So what if I want it to open in the same window? Changing the line to:
var myURL:URLRequest = new URLRequest("http:url...); results in a compiler error.I am embedding this swf on a web page of my own, so there are no security concerns regarding giving flash access.
View 3 Replies
Dec 21, 2010
How do i link the items in the list to a button?
View 5 Replies
Mar 22, 2012
Decided to stick with AS2.0, i've got buttons that are working great, linking to certain frames in my timeline etc. The only problem I'm having is after they have been clicked and gone to their respected frame, they remain clicked. This is my code for each button
[Code]...
Could this be something in my code or something in the timeline i've possibly done wrong?
View 8 Replies
Jan 25, 2010
This post has been edited to clarify, so that should explain the answer above.I am sure this topic has been covered a million times, but for the life of me, I have been searching the internet for hours trying to find a simple solution to this problem. I am using Flash Cs4 with actionscript 3 and flash player 10 for publish settings. I have a button that I want to open a new webpage. When the button is pressed, I want the window to open so the user can see the original webpage they were on before, and I dont want the original webpage to close. In other words, I want to open a new webpage without closing the original webpage, and allow the user to see both webpages, at the same time doing away with the back button. Is this possible? Here is the script I am using. It is placed on a seperate layer called actions. :
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("https://mycw3.eclinicalweb.com/cent/jsp/login.jsp"));
}
It does allow me to open the window seperately as long as I am testing the movie in Flash, but when I publish the movie and imbed in into a Dreamweaver Html document (Xhtml), you have to use the back button to go back to the original page. I know this might not be the best way to navigate but the person I am doing this page for wants it this way only.
View 5 Replies
Mar 5, 2006
I have a button in a movie clip named "mc2" inside "mc1" and I want that button the link to a frame which is labled "circles" in "mc1".
View 1 Replies
Mar 6, 2006
I've got a dropdown menu in which i need to link to another scene on my site. The actionscript on the button i'm using is working if i put the link on the button on the main timeline, but when i nest the button inside the movieclip dropdown menu the actionscript on the button doesn't seem to work.url...The dropdown menu is on the left side, (actually a drop right menu,lol).And, also, the rest of the site still needs a lot of work so please don't comment on that.
View 14 Replies
Apr 14, 2006
I was ust wondering how I would go about linking a button to a keyword within a .jpg file, within a folder and making that .jpg appear within a window. The word that the button will search for will not be the full name of the .jpg, it will only be part of the .jpg file name.
View 1 Replies
May 7, 2010
I have a button in the scrollbar that has a mask.(scrollbar_mc, mask and content_mc) Now I stuck with HOW TO LINK IT to other pages that are in scene 1 ?
View 9 Replies
May 10, 2011
I'm trying to link a button to open shadowbox. I keep getting an 1120 Error "Access of undefined property button". My code is as follows:
button.addEventListener(MouseEvent.MOUSE_DOWN, myWork);
function myWork2(event:MouseEvent):void {
ExternalInterface.call("Gallery");
}
Where I put the images I want to use in my shadowbox? Currently I've copied all the files that came with shadowbox into my root folder. I'm not sure where else to go from there. I'm rather new to flash.
View 1 Replies
Feb 18, 2011
I'm trying to make an interactive video player where you have a choice of 3 buttons and each button links to a different frame that has a video player embedded in it. Once on of the frames are brought up, I have a button to take you back to the main screen. However, after clicking back to the main screen, I'm running into the following output error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at memorialsample_fla::MainTimeline/frame1()[memorialsample_fla.MainTime line::frame1:4]
at flash.display::MovieClip/gotoAndPlay()
at memorialsample_fla::MainTimeline/gotoMain2()[memorialsample_fla.MainT imeline::frame2:11]
Once the above output error occurs, the buttons are no longer active and no longer work. Here's a look at my code that I have going on:
Frame 1:
stop()//Link to Frame 2btn_MJ_Main.addEventListener(MouseEvent.CLICK, gotoMJ) function gotoMJ (e:MouseEvent){
//btn_Beach_Main.removeEventListener(MouseEvent.CLICK, gotoBeach)
//btn_MJ_Main.removeEventListener(MouseEvent.CLICK, gotoMJ)
btn_Cloud_Main.removeEventListener(MouseEvent.CLICK, gotoCloud)gotoAndPlay(2)
[Code] .....
If you want to see the actual SWF for a better visual at what I'm doing, you can see it here: [URL]. Scroll down to the Flash object, it says "Memorial Tribute Samples". I have the videos streaming, and am not sure how I could get the FLV videos to stop playing when I click the flash's "Return to Samples" button. Right now, the users would have to pause the video if they don't want it to play in the background as they go back to the first frame.
View 2 Replies
Mar 26, 2011
I'm sure I am missing something. I have created a scrollpane instance "Buttons_sp" and set the source in the properties panel to "SantaThumbs_mc" Set the symbol linkage property to Export for Actionscript and used the default assigned class name for the SantaThumbs_mc. On my main timeline I have another clip LargeSantas_mc that I want to access specific frames on when a button in the scrollpane is clicked.
The button listeners are on an actions layer in the SantasThumbs_mc and at this point I have only one button with active code so I know that the code is being seen when I test the movie, which it seems to be.
My button code is:
[Code]...
View 5 Replies
Nov 11, 2009
Drop Down menu with the buttons linking to different videos in the same frame...sounds really easy, but I can't seem to wrap my head around it. Now I've got the video and player down in AS2. I also have the drop down buttons created (using this tutorial: [URL]). How I get these two to work together?
View 0 Replies
Jul 6, 2010
I need help figuring out the code that will allow a button that is outside of an XML gallery to go to a specific image in an xml gallery. Specifically, i need to link a thumbnail, that is on a different frame then my xml gallery, to the corresponding image in that gallery.
View 0 Replies