Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Linking A Url To A Button, How to Link a URL using getURL()
andrewsmithy
post Mar 26 2005, 06:04 AM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 19
Joined: 16-March 05
From: United States
Member No.: 4,570



Linking a URL to a Button in Flash

This seems to be a problem for beginners to Flash, and I thought I'd address it. When building a Flash-navigated site, you need to link one page to another through the flash interface, just like you would a <a href="otherpage.html">my link</a> in HTML/XHTML.

Once you've created your button on the page, you can link the button very simply. Right-click it, and select "Actions" from the menu. This will open the ActionScript editor, in which you can right ActionScript code. Don't worry. It's not detailed to put this link in.
Make sure you are in Expert Mode, by clicking the arrow in the upper-right hand corner and selecting "Expert Mode". Now type the following code into the editor.

CODE

on (release) {
getURL("the_linked_page.htm","_self","GET");
}


The button you created will now go to that link when the mouse clicks it. The getURL function has a prototype that is like this:

getURL(url [,window [, method]])

The window and the method are optional parameters. The url define the resource you want to access. This could be an absolute address, such as "http://www.somesite.com/" or relative to the page that contains the flash movie such as "myotherpage.htm". The window parameter defines the window that you want the url to load in. This could be one of the following:
"_self" - Targets the window that the movie is in.
"_new" - Opens url in a new window
"_top" - Only useful in a framset, targets the top frameset
"_parent" - Targets parent window in a framset
"myWindowName" - where "MyWindowName" refers to the name of a frame in a frameset

The last parameter is one in which the method in which the url is requested, and is either "GET" or "POST". For most of your projects, you will normally use "GET". "POST" is for posting form data, but you usually use the loadVariables function to to this.

That wraps up the tutorial on adding a link to a button in a Flash Movie. I hope this helps everyone. If you have any questions or comments, please reply to this post.
Go to the top of the page
 
+Quote Post
nickmealey
post Mar 26 2005, 06:08 AM
Post #2


Premium Member
********

Group: Members
Posts: 156
Joined: 14-March 05
From: Washington, USA
Member No.: 4,520



thanx, thats always nice to know. biggrin.gif
Go to the top of the page
 
+Quote Post
hulunes
post Mar 26 2005, 06:46 AM
Post #3


.::UniCorN::.
*********

Group: Members
Posts: 973
Joined: 19-September 04
From: Dalian CHN
Member No.: 1,192



well,good post.this one must to be helpful to somebody who are new at making flash.using this kind of function at webpage ,could looks nice and professional.hope more and more grafics fans master this skill... biggrin.gif
Go to the top of the page
 
+Quote Post
iGuest
post Sep 27 2007, 06:07 PM
Post #4


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



I am very new at using flash and i tried all that i know and more but whenever i open my button in ma web page n click it using the code that you just gave i keep getting this notice that my settings do not allow the button to interact with that particular site..plzz tell me how i should change the settings??

-Prashanth
Go to the top of the page
 
+Quote Post
iGuest
post Aug 19 2008, 09:18 PM
Post #5


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



The actionscript
Linking A Url To A Button

Thanks, the script was straight to the point

-reply by Emmanuel Mtimba
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. ZELDA and LINK(31)
  2. Button To Print Current Web Page(16)
  3. Radio Button(4)
  4. How To Create Java Button Or Frame(14)
  5. Linking To Mysql From Vb(7)
  6. Refresh Page After Back Button Hit(11)
  7. Multiple Drop Down Menus W/ Submit Button(7)
  8. Trap17 Link Exchange Script Introduced(28)
  9. Check Referrer To Prevent Linking Yours From Other Sites(8)
  10. The Link Building Nightmare…(3)
  11. Giving A Flash Button A Link(4)
  12. Link-building Services In 3 Languages(2)
  13. Php Linking(4)
  14. Flash Problem(9)
  15. Cd Drive Eject Button Problem(3)
  1. Suitable Forum(0)
  2. Dreamweaver Cs3: How To Link Content To Layers/apdivs(5)
  3. Need Help With My Database [resolved](6)
  4. Vb 2008 Linking To Another Form..(0)
  5. Soa Architecture(0)
  6. How To Make Image Buttons Act As Submit Button(8)
  7. Php Linking(2)
  8. An Error Thought I'd Let The Admins Know About.(4)
  9. Destination Address For "submit" Button(5)
  10. [req & Suggest] -[news Link]-(3)
  11. How To Change Href Link In Whole Page And All Page In Same Directory(1)
  12. Link Exchange(0)
  13. Affiliate [resolved](5)


 



- Lo-Fi Version Time is now: 23rd November 2008 - 12:56 AM