FLASH NAV BAR HELP

Associate
Joined
1 Jan 2009
Posts
406
Location
Northampton
ok, im creating a flash animated navigation bar.

see sample: http://www.connectionfx.com/flash/navigation.swf

i have the rollover effect sorted and the down status to play the sound...

but im having a problem getting the button to go to the desired URL

ive tried many diffrent action script combinations to get the onclick go to URL but it never works.

here is the flash timelines to help explain.

I have 7 button on the nav bar. each button is on its own layer with its own animated tween. The button layers are labled 1 - 7 background

1.jpg







i converted the tween symbol to a button and applied the desired "UP" "OVER" "DOWN" "HIT" animations.

2.jpg


here is the down state with the sound applied

3.jpg



but where do i put the code and what code do i use to get it to go to a URL on click?

Any help would be great.

(BTW this is a learning project)
 
i havent done flash in a while, done a A level on it years back.

EDIT
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.

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

if you want a new window it should be "_blank"
 
Last edited:
current selection can not have actions applied to it.

then when i try to apply the action on the timeline under "1 background" which is button 1

is it because its a tween it will only allow the action on 1frame. but if i do that it dont work anyway.

damn this is annoying
 
It looks like your using flash cs3 or even 4? so by default it will create flash documents using Actionscript 3.0 In AS3 you cant apply code directly to button symbols. You need to create an AS2 document to do this.

AS3 is a lot different to AS2 but this code will get you started with a simple button.

PHP:
btn1.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);

function onMouseUp(event:Event)
{
    trace("clicked");
}

if you put that on the timeline that the button exsists on and change the "btn1" text to the instance name of your button you should get somewhere.

HTH :)
 
Back
Top Bottom