Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 9 of 9
  1. #1

    Default linking to URL from flash button

    I want to link to a URL - so when the user clicks on my button it sends them to another URL in the same window.

    the button I'm using is named: enter

    here's the code that I have so far:

    enter.onRelease = function() {
    getURL("http://www.daviddiebold.com");
    };

    Here's what happens at this point:

    The whole flash file works with the animation, but when the button is clicked nothing happens. Would it have anything to do with a stop command on the last frame of my flash file?

    Thanks in advance,
    David Diebold

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Default

    your syntax is a little off

    the actual syntax is

    on(release){
    getURL("URL","State")
    }

    "state" doesn't need to be filled in, but use
    "_blank" if you want to open it in a new window

    also make sure you are using this code in the actions of the button itself

    hope this helps

  4. #3

    Default actionscript code placement?

    so I need to place the actionscript code where now? I have it in the same keyframe as I placed the button in right now. Do I have to go into edit mode for the button and put the code somewhere like this?

  5. #4

    Default by the way - I'm using Flash MX 2004 right now

    Flash MX 2004

  6. #5

    Default Re: actionscript code placement?

    Quote Originally Posted by diebold
    so I need to place the actionscript code where now? I have it in the same keyframe as I placed the button in right now. Do I have to go into edit mode for the button and put the code somewhere like this?
    Okay, you know when you click the "actions" tab to open up where you type in the actions for a keyframe? You can type in actions not only in keyframes, but also in objects. If you made the button correctly, it should have 4 frames in it when you double click it. IGNORE THESE FRAMES. you don't need to do actions in these

    the code I gave you before is to be used when you click your button on the stage, and then click the actions tab

    if you were to type the code on a keyframe, the code would need to be modified, and would be structured differently.

    try putting that code directly in the actions of the button itself

  7. #6

    Default got it to work - thanks!

    Here's the code I ended up having to use:

    on (release) {
    enterbutton.onRelease = function() {
    getURL("http://www.daviddiebold.com");
    };
    }

    I don't know if I'm using a different version of Flash and that made a bit of a difference, but when I tried to implement the code you had written for me, it kept saying that there was a syntax error and I would have to type the code in expert mode.
    But shouldn't I just be able to click on the commands that I want to use in normal mode each time for it to work?
    I also had to give my button an instance name - do I have to do this everytime I put an action on a button?

    thanks again,
    David

  8. #7

    Default

    Hey guys,

    I'm trying to creat a button which opens an external URL in a window, using this method:

    on(release){
    getURL("brief1.htm","_blank")
    }

    This does open up the external window, but it is blank. All the files are in the same folder, and funnily enough when I already have a different website open and I test the .swf, it works fine.
    It's very simple and I can't understand why it's not working all the time.

    Please help...... It's due soon....

  9. #8
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Testing URL links in the author test mode will open a browser window to process the getURL code. Test it online and you wont receive the blank window.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  10. #9

    Default

    Thanks NTD.

    Though I think I may just have a sotware problem.

    I tried the same thing on a Mac with Flash 8 and there was no problem.
    Thanks for the help though.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Linking in Flash MX 2004 Professional
    By obelisk714 in forum Flash - ServerSide
    Replies: 4
    Last Post: 07-03-2010, 05:25 AM
  2. Linking swf files within the flash player...
    By flashinpeople in forum Newbies
    Replies: 0
    Last Post: 12-20-2006, 05:47 PM
  3. linking a button in a flash movie menue
    By Shorty_K_Dahee in forum Newbies
    Replies: 1
    Last Post: 01-11-2006, 12:59 AM
  4. Linking external video to a button
    By AshleyP in forum Flash Scripting
    Replies: 1
    Last Post: 03-07-2005, 11:10 AM
  5. Linking HTMl from a Flash Pop-Up
    By section8 in forum Advanced Flash
    Replies: 1
    Last Post: 06-29-2004, 08:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial