A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: [RESOLVED] simple link question

  1. #1
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478

    resolved [RESOLVED] simple link question

    I am doing a charity website and I have a basic menu.
    It plays in Flash 6.
    The buttons need to be set up as links.
    Can anyone tell me where to place the get url link?
    Attached Files Attached Files
    Last edited by ivor1; 03-14-2010 at 07:02 AM.

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    I can't open the file at the moment, but most calls are done in one of two ways. One: the code is added to the clip event of the button or movieclip. Two: The code is added to the main timeline and an instance name is provided to the button. If you provide an instance name for the button or menu object, then you can have a function that waits until the button is pressed. Here is an example

    If my button's instance name is 'googleBtn', then I would have the following lines of code sitting on the main timeline, usually in its own layer.

    PHP Code:
    googleBtn.onPress = function(){
       
    getURL("www.google.com","_blank");

    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    I tried giving the button an instance name and stuck in the code above replacing the name and url but I still can't get it to work?
    Can you place the code in the menu.fla for one button as an example?

  4. #4
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Okay, first you aren't playing in Flash 6 you are playing Flash 4, which the first version that can use getURL. I also didn't realize you were using AS 1.0, which is something I haven't worked in for many years. You seem to be using a mixture of movieclips and not buttons. If you are willing to move up to Flash 5 or 6, this will make it tons easier.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  5. #5
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Sorry to be such a pain. But yes, I can move up no problem.

  6. #6
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Okay, it seems that the button sit under the graphics. You need to have the button on top for it to work.
    Last edited by samac1068; 03-15-2010 at 06:27 PM.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  7. #7
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Please amend as you want as long as the expand effect can stay.
    Thanks very much.

  8. #8
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Okay, I've fixed it, but there may be another problem. I am using CS4 which only saves down to CS3. What version of Flash are you using?
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  9. #9
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    I'm using Flash 8.

  10. #10
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813

    Corrected

    I had to change the layer order of the buttons and the graphics within your menu panel. Then I added the appropriate code to each of the buttons. Currently, all of the button navigate to www.google.com.

    NOTE: Always remember to add the HTTP:// to the start of the site, if the link is reaching OUTSIDE of the current directory.

    You'll find the CS3 version attached.
    Last edited by samac1068; 08-26-2010 at 03:57 PM.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  11. #11
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Unexpected file format when trying to open the file. My F8 is AS2?

  12. #12
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Yeah, that was expected. Because it is saved in CS3, it need someone with CS3 to open and save it down to Flash 8. I don't have a copy of CS3 any further, but I know it will work when you get it opened.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  13. #13
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Okay, many thanks for your help. Much appreciated.

  14. #14
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Can anyone else save the attached file ivor_menu.zip fla down so I can use it in Flash8?

  15. #15
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Ivor, if you don't get any hits for help, I suggest that you download a trial version of CS3 and save it down yourself. This will eliminate any delay.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  16. #16
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478

    Link Query

    Hi, I'm sorry but I have had this fla saved down to F8 but I can only see one button and can't locate where the url code will go. Sorry for being so dumb. I need each button graphic to go to a separate address.
    Attached Files Attached Files

  17. #17
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    I think there is no need of 9 separate buttons to put separate url

    go inside the menu cube movieClip and go to each big menu buttom frame and select the big button of each perticular frame and change the url in action panel

    marlopax

  18. #18
    Ivor1 ivor1's Avatar
    Join Date
    Aug 2006
    Location
    Dundee, Scotland
    Posts
    478
    Got it, thanks. Feel a bit silly now but very thankful too. Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center