Flash CS3 Navigation Button Linking

  • Exc[BluePhoenix]
  • Born
  • Born
  • Exc[BluePhoenix]
  • Posts: 1

Post 3+ Months Ago

Hello,

I am new to flash, however, I wanted to make a site with Flash animated buttons. I then search for tutorials on how to this and I found this one,

Tutorial Link ---> http://www.toxiclab.org/tutorial.asp?ID=85

To my surprise it was easy to do and I got it working. I then assemble the flash navigation into my website, I test it and it worked great,

My Website ----> http://www.325thglider.clanservers.com/ (Its a Day of Defeat 1.3 Site)

However, one thing I had not added and never though of adding until the site was assemble was well LINKS! So then I went back and search on how to add links, but what I get when I search GOOGLE is that you need the symbols to be BUTTONS but in the tutorial all the author tells you to is to make movie clip and graphics. There is a command(function, i dont really know) called getURL, but it does not work unless its a button.

So after my explanation, the question is, is there anyway to add links to this nav bar? If not, then would anyone be kind enough to point to a tutorial that shows a similar example just using buttons.

Thank you very much in advance for any replies. Any help is welcomed!
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

It depends on if you are publishing your file as Actionscript 1.0, 2.0, or 3.0 on what method you will use for this.

You can apply a getURL function to a movieclip as long as you put it within an onMouseEvent handler (onMouseDown, onMouseUp, etc). There are multiple ways you can do this if you are publishing BEFORE AS3.0. If you are publishing as AS3.0 you will need to use the new navigateToURL() function that replaced getURL()... and is a bit more complicated to pull off.


navigateToURL() forum posts...
http://www.kirupa.com/forum/showpost.ph ... tcount=100
http://www.kirupa.com/forum/showthread.php?t=227354
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Code: [ Select ]
//import class/method for handling mouse events
import flash.events.MouseEvent;
//add event listener to instance of myButton movieclip
//event listener waits for the onMouseUp event and runs the launch function
myButton.addEventListener(MouseEvent.MOUSE_UP, launch);
//launch function that executes when button is released.
function launch(event:MouseEvent):void {
    //go to URL
    navigateToURL(new URLRequest("http://www.lostinbeta.com/"));
}
  1. //import class/method for handling mouse events
  2. import flash.events.MouseEvent;
  3. //add event listener to instance of myButton movieclip
  4. //event listener waits for the onMouseUp event and runs the launch function
  5. myButton.addEventListener(MouseEvent.MOUSE_UP, launch);
  6. //launch function that executes when button is released.
  7. function launch(event:MouseEvent):void {
  8.     //go to URL
  9.     navigateToURL(new URLRequest("http://www.lostinbeta.com/"));
  10. }


Here is the basic gist of the AS3.0 version.

Yes the URL is written statically in the function. Unfortunately you cannot pass an argument through an event listener, which is crap. So you'd have to create a new function for every button you have and change the addEventListener line for each instance. Unless you want to go about writing a class that extends MouseEvent that can include arguments, but yeah... that's a bit of work. There's a couple of other hackaround ways too I would imagine. AS3.0 doesn't make anything easy though.
  • munni
  • Born
  • Born
  • munni
  • Posts: 3

Post 3+ Months Ago

Hello sir,

I want Dynamic photo gallery with flash useing XML.

Thanks

Post Information

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

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.