Adding links to flash buttons

  1. #1
    timbo is offline Full Member

    Question Adding links to flash buttons

    I have recently been playing around with flash mx professional 2004, I am wondering if anyone knows how to add links to buttons. I have looked at tutorials etc and get as far as actions > plus sign > Global functions > Browser/Network > Get URL, I then place the URL in and when I check syntax I get the following.... **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
    getURL(the URL);
    Total ActionScript Errors: 1 Reported Errors: 1
    Does anyone know what is going on? I think I need to add more script but cannot figure that part out, any help is greatfully appreciated.

    timbo


  2. #2
    timbo is offline Full Member
    ok figured some more out, i put in the url, then window and then method, but method wont work, get an error sayin method must be get or post, any ideas?

  3. #3
    D-A-L is offline D-A-L Administrator
    ....From the Macromedia MX 2004 Pro Help File:

    Add a behavior
    Next, you'll add a behavior to the button that will make it open a website. Behaviors enable you to add the power, control, and flexibility of ActionScript coding to your document without having to create the ActionScript code yourself. You can use behaviors to control movie clips, video, and sound files.

    You'll use the Go to Web Page behavior to add navigation to a button that opens a website.

    On the Stage, click the Button component that you added.
    If the Behaviors panel is not already open, select Window > Development Panels > Behaviors to open it.
    Click the Add (+) button at the top of the panel to display a list of behaviors.
    Select Web > Go to Web Page.
    The Go to URL dialog box appears.

    In the URL text box, type any complete URL, such as http://www.macromedia.com. Then click OK.
    When the user clicks the button, a browser will open for the specified URL.

    Save your file.
    For an online introduction to the Flash MX 2004 behaviors see the module, Flash MX 2004 Family: Using Behaviors at Macromedia On Demand.

    Have you followed that exactly?

  4. #4
    timbo is offline Full Member
    Hmmmmmmmmm, On the Stage, click the Button component that you added.
    If the Behaviors panel is not already open, select Window > Development Panels > Behaviors to open it. The tutorial I was going off was telling me to go to Actions instead of Behaviours but thanks to you the problem is solved. Thankyou so very much your a true champion mate (I got a knack for doing things the hard way)

  5. #5
    D-A-L is offline D-A-L Administrator
    Your welcome

  6. #6
    timbo is offline Full Member
    sorry to bother again but no rush to answer as i know many other ppl have bigger problems than me but i was just wondering if you can change the content of more than 1 frame with a flash button and if you can then how? Thankyou in advance

  7. #7
    MartynG is offline Newbie
    Quote Originally Posted by timbo
    I have recently been playing around with flash mx professional 2004, I am wondering if anyone knows how to add links to buttons. I have looked at tutorials etc and get as far as actions > plus sign > Global functions > Browser/Network > Get URL, I then place the URL in and when I check syntax I get the following.... **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
    getURL(the URL);
    Total ActionScript Errors: 1 Reported Errors: 1
    Does anyone know what is going on? I think I need to add more script but cannot figure that part out, any help is greatfully appreciated.

    timbo
    Use the geturl action with a "mailto:username@domainname.com" style procedure. the browser must have an action predefined for this to work e.g clicking on a mail link must open the email program

  8. #8
    D-A-L is offline D-A-L Administrator
    Hi Timbo can you give us a little more info on that last question of what your trying to do?

  9. #9
    yoshi743 is offline Newbie
    I have Flash MX Professional, and am trying to get my buttons to swich between scenes...BUT it contiues to tell me that i have scripting errors...What must i code to get it to work? Thank you!!

    -Yoshi

    ps- i have not yet tried to code for a button to play a sound, but what must i code for that??

  10. #10
    MartynG is offline Newbie
    Tackle the Web with $5.99 .COM's from Go Daddy!
    Ok for individual buttons just drag the button to the stage then right click on it and edit. Make a new layer in the flash timeline and import the sound into the empty layer. Drag it so it only sounds on release or corresponding to the four actions of up, over, down and hit.

    Points to note:Change individual buttons for different sounds, right click on the library one and edit the library one to affect all of them.

    I would reccommend you put a keyframe in so that it only sounds on down for now. To finish up highlight the sound on the timeline and click "edit" to adjust the volume etc.

+ Reply to Thread
Page 1 of 2 1 2 LastLast